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
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 | Accept-Language | no |
Request example
Parameter | Description | Type | Required | Value |
---|---|---|---|---|
actor.id | app_id of the application you are using to log user | string | yes | app id |
actor.objectType | Type of the object which represents the actor. | string | yes | ‘application’ |
verb | Verb used for the login | string | yes | ‘confirm’ |
object.objectType | ObjectType represents the user | string | yes | ‘user’ |
context.code | Code received in email/SMS | string | yes | confirmation code |
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: user confirmed successfully
Parameter | Description | Type |
---|---|---|
result.status | HTTP status code | integer |
Response KO: code not found
Parameter | Description | Type |
---|---|---|
result.status | HTTP status code | integer |
result.results | Struct of errors | array |
result.errors | Array of errors | array |
result.errors[].message | Message error | string |
Reponse KO: code has already been used
Parameter | Description | Type |
---|---|---|
result.status | HTTP status code | integer |
result.results | Struct of errors | array |
result.errors | Array of errors | array |
result.errors[].message | Message error | string |
Response KO: code generated for other method/action
Parameter | Description | Type |
---|---|---|
result.status | HTTP status code | integer |
result.results | Struct of errors | array |
result.errors | Array of errors | array |
result.errors[].message | Message error | 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) |
417 | Error | Expectation Failed: operation could not be performed due to code errors |
417 -> 404 | Error | Code not found in database |
417 -> 410 | Error | Code already used |
417 -> 409 | Error | Code was not generated for that method (eg: when code for register confirmation is used here) |
417 -> 498 | Error | Code is expired |
500 | Error | Internal Server Error: The server encountered an unexpected condition which prevented it from fulfilling the request |
200 | Success | User confirmed successfully |