Description
You have to call this method when you have T&Cs and/or consents that have been requested from other systems and you want to migrate them to DruID users. This method only assigns those T&C and/or consents that the user does NOT have associated, the rest will be ignored. To perform updates, please review the user update method.
Please, read first: https://dru-id.com/developers/apis/oauth-2/ to learn about Oauth2 protocol and the meaning of each token.
Endpoint URL:
POST https://{your-endpoint-domain.com}/activityid/v1/migration/assertions
Request parameters
Parameter | Description | Type | Required |
---|---|---|---|
Authorization | “Bearer app_token” Literal text Bearer followed by app_token that is the token obtained from /oauth2/token endpoint | string | yes |
Content-Type | The type of content that will be used for requests to be JSON | string | yes |
Accept | The type of content that will be used for responses to be JSON | string | yes |
From | Name of the entry point | string | yes |
Accept-Language | Language of this request | Locale | no |
Request example
Parameter | Description | Type | Required | Value |
---|---|---|---|---|
actor.id | app_id of the application you are using | string | yes | app id |
actor.objectType | Type of the object which represents the actor | string | yes | ‘application’ |
verb | Verb used for the assertions accept | string | yes | ‘accept’ |
object.objectType | ObjectType represents the object | string | yes | ‘collection’ |
object.items | Dynamic list of users to migrate assertions to. The limit of users per request is 1000. | array | yes | array |
object.totalItems | Number of users to migrate assertions to | int | yes | 3 |
object.items.objectId | UserID generated by DruID. Necessary to identify the user to migrate assertions to | string | yes | objectId |
object.items.assertions | Struct that defines legalities manage by the user. More info about user assertions User Info | struct | yes | struct |
source.id | Type of device doing the activity | string | yes | ‘unknown’ | ‘pc’ | ‘mobile’ | ‘tablet’ | ‘game_console’ | ‘itv’ |
source.objectType | Type of source | string | yes | ‘device’ |
Response examples
Response: 200 OK
Parameter | Description | Type |
---|---|---|
content | List of data received with the response to each of the users sent. | array |
content.status | HTTP status code for each user | int |
content.message | Response message describing the status of the operation for that user | string |
content.objectId | UserID identifying the user of that operation | string |
result.status | HTTP status code | int |
errors.message | Errors description | string |
Response KO: User must accept T&C and fill consents
Parameter | Description | Type |
---|---|---|
content | List of data received with the response to each of the users sent. | array |
content.status | HTTP status code for each user | int |
content.message | Response message describing the status of the operation for that user | string |
content.objectId | UserID identifying the user of that operation | string |
result.status | HTTP status code | int |
errors.message | Errors description | string |
Response KO: User doesn’t have any consent that must be filled
Parameter | Description | Type |
---|---|---|
content | List of data received with the response to each of the users sent. | array |
content.status | HTTP status code for each user | int |
content.message | Response message describing the status of the operation for that user | string |
content.objectId | UserID identifying the user of that operation | string |
result.status | HTTP status code | int |
errors.message | Errors description | string |
Response codes
Code | Type | Description |
---|---|---|
400 | Error | Bad Request: The request could not be understood by the server due to malformed syntax |
401 | Error | Unauthorized: authentication is required and has failed or has not yet been provided (token is invalid, etc) |
403 | Error | Forbidden: user id or password are invalid |
410 | Error | Gone: User doesn’t have any consent that must be filled |
451 | Error | Unavailable For Legal Reasons: user must accept new terms and conditions |
500 | Error | Internal Server Error: The server encountered an unexpected condition which prevented it from fulfilling the request |
504 | Error | Gateway TimeoutService can not contact with oauth server to do some internal operations |
200 | Sucess | Assertions set correctly |