Description

You have to call this method when you want to log in an user at DRUID, but user need to accept new Terms & Conditions. Normally first, you had call the login service, and receive a response that indicates that user needs to accept new Terms & Conditions (in the response you will receive number of assertions to accept and text of each).

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/assertions/accept

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 requestLocaleno

Request example

ParameterDescriptionTypeRequiredValue
actor.idapp_id of the application you are using to log userstringyesapp id
actor.objectTypeType of the object which represents the actorstringyes‘application’
verbVerb used for the loginstringyes‘accept’
object.objectTypeObjectType represents the userstringyes‘user’
object.passwordPassword of the user. it must be send plainstringyesuser password
object.idsUser identifiers. More info about user identifiers User Infostructyesstruct
object.assertionsStruct that defines legalities manage by the user. More info about user assertions User Infostructyesstruct
source.idType of device doing the activitystringyes‘unknown’ | ‘pc’ | ‘mobile’ | ‘tablet’ | ‘game_console’ | ‘itv’
source.objectTypeType of sourcestringyes‘device’

Response examples

Response: user logged

ParameterDescriptionType
contentData receive with the responsestruct
content.userData of the user logged with the request. More info about user struct at User Infostruct
content.access_tokenaccess tokenstring
result.statusHTTP status codeinteger

Response KO: Terms & Conditions not approved by the user

ParameterDescriptionType
contentData receive with the responsestruct
content.assertionsList of assertions not completed by the userarray
content.assertions.objectTypeObjectType represents the assertions list‘assertions’
content.assertions.itemsList of assertions. More info about assertions at User Infoarray
result.statusHTTP status codeint
errors.messageErrors descriptionstring

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)
403ErrorForbidden: user id or password are invalid
451ErrorUnavailable For Legal Reasons: user must accept new terms and conditions
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
200SucessUser accept t&c conditions and logged successfully. You will get ‘user logged JSON response’