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

ParameterDescriptionTypeRequired
Authorization“Bearer” Literal text Bearer followed by client_token that is the token obtained from /oauth2/token endpointtstringyes
Content-TypeThe type of content that will be used for requests to be JSONstringyes
AcceptThe type of content that will be used for responses to be JSONstringyes
FromName of the entry pointstringyes
Accept-LanguageLanguage for this requestLocaleno

Query string parameters

None

Request Example

ParameterDescriptionTypeRequiredValue
actor.idapp_id of the application you are using to replace the typologystringyesapp id
actor.objectTypeType of the object which represents the actor.stringyes‘application’
verbVerb used for replacing the typologystringyes‘replace’
object.objectType ObjectType represents the typologystringyes‘typology’
object.nameName or key of the typology to be replaced.stringyes‘My Typology’
object.replacedByName or key of the typology that the user will acquire, if the last typology is removed.stringno. Only if the app tries to remove the last typology of the user.‘Another Typology’
targetThe user who is going to lose the typologystructyesUser with ids
target.objectTypeType of the object which represents the target.stringyes‘user’
target.ids.obejct_idThe object ID of the userstructyes
source.idType of device doing the activitystringyes‘unknown’ | ‘pc’ | ‘mobile’ | ‘tablet’ | ‘game_console’ | ‘itv’
source.objectTypeType of sourcestringyes‘device’

Response examples

Response: Typology Replaced

ParameterDescriptionType
resultCommon http resultstruct
result.statusHttp codeinteger
contentUser with the new typology added. Please refer to the User Info to see the full detail of the content.struct

Response codes

CodeTypeDescription
400ErrorBad Request: The request could not be understood by the server due to malformed syntax
401ErrorUnauthorized: authentication is required and has failed or has not yet been provided (token is invalid, etc)
412ErrorPrecondition failed: Typology not found or the user cannot lose its last typology
500ErrorInternal Server Error: The server encountered an unexpected condition which prevented it from fulfilling the request
504ErrorGateway TimeoutService can not contact with oauth server to do some internal operations
304Success Not modified: The user did not own that typology.
200SuccessMFA code configured succesfully