Description
Before using this endpoint, please review the OAuth2 authentication protocol and the purpose of each token by visiting: https://dru-id.com/developers/apis/oauth-2/.
To successfully invoke this service, a valid client_token
associated with an authorized API client is required. Ensure that your application is properly registered and has been granted the necessary permissions to obtain and use this token.
Removes one of the current typologies assigned to a user. It is mandatory for every user to have an assigned typology; therefore, replacing the last typology of an user must always involve providing a new one to ensure continuous classification.
Endpoint URL:
POST https://{your-endpoint-domain.com}/activityid/v1/typology/replace
Request Headers
Parameter | Description | Type | Required |
---|---|---|---|
Authorization | “Bearer” Literal text Bearer followed by client_token that is the token obtained from /oauth2/token endpointt | 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 for this request | Locale | no |
Query string parameters
None
Request Example
Parameter | Description | Type | Required | Value |
---|---|---|---|---|
actor.id | app_id of the application you are using to replace the typology | string | yes | app id |
actor.objectType | Type of the object which represents the actor. | string | yes | ‘application’ |
verb | Verb used for replacing the typology | string | yes | ‘replace’ |
object.objectType | ObjectType represents the typology | string | yes | ‘typology’ |
object.name | Name or key of the typology to be replaced. | string | yes | ‘My Typology’ |
object.replacedBy | Name or key of the typology that the user will acquire, if the last typology is removed. | string | no. Only if the app tries to remove the last typology of the user. | ‘Another Typology’ |
target | The user who is going to lose the typology | struct | yes | User with ids |
target.objectType | Type of the object which represents the target. | string | yes | ‘user’ |
target.ids.obejct_id | The object ID of the user | struct | yes | – |
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: Typology Replaced
Parameter | Description | Type |
---|---|---|
result | Common http result | struct |
result.status | Http code | integer |
content | User with the new typology added. Please refer to the User Info to see the full detail of the content. | struct |
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) |
412 | Error | Precondition failed: Typology not found or the user cannot lose its last typology |
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 |
304 | Success | Not modified: The user did not own that typology. |
200 | Success | MFA code configured succesfully |