Description

You have to call this method when you want to confirm an user that just register. When an user register in DRUID, system will send an email/sms to user with a confirmation code. You also can use Send confirmation notification to send to user more notifications with confirmation code. User must insert code to use this 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/user/confirm

Request parameters

ParameterDescriptionTypeRequired
Authorization“Bearer app_token” Literal text Bearer followed by app_token that is the token obtained from /oauth2/token endpointstringyes
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 of this requestAccept-Languageno

Request example

ParameterDescriptionTypeRequiredValue
actor.idapp_id of the application you are using to log userstringyesapp id
actor.objectTypeType of the object which represents the actor.stringyes‘application’
verbVerb used for the loginstringyes‘confirm’
object.objectTypeObjectType represents the userstringyes‘user’
context.codeCode received in email/SMSstringyesconfirmation code
source.idType of device doing the activitystringyes‘unknown’ | ‘pc’ | ‘mobile’ | ‘tablet’ | ‘game_console’ | ‘itv’
source.objectTypeType of sourcestringyes‘device’

Response examples

Response: user confirmed successfully

ParameterDescriptionType
result.statusHTTP status codeinteger

Response KO: code not found

ParameterDescriptionType
result.statusHTTP status codeinteger
result.resultsStruct of errorsarray
result.errorsArray of errorsarray
result.errors[].messageMessage errorstring

Reponse KO: code has already been used

ParameterDescriptionType
result.statusHTTP status codeinteger
result.resultsStruct of errorsarray
result.errorsArray of errorsarray
result.errors[].messageMessage errorstring

Response KO: code generated for other method/action

ParameterDescriptionType
result.statusHTTP status codeinteger
result.resultsStruct of errorsarray
result.errorsArray of errorsarray
result.errors[].messageMessage errorstring

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)
417ErrorExpectation Failed: operation could not be performed due to code errors
417 -> 404ErrorCode not found in database
417 -> 410ErrorCode already used
417 -> 409ErrorCode was not generated for that method (eg: when code for register confirmation is used here)
417 -> 498ErrorCode is expired
500ErrorInternal Server Error: The server encountered an unexpected condition which prevented it from fulfilling the request
200SuccessUser confirmed successfully