Description

It lets you determine whether a logged-in user has enough data defined in a section. It comprises 2 parts:

  • Check if data need to be completed.
  • If they need to be completed, show the user an appropriate interface.

This flow is handled using 2 calls to 2 methods.

Step 1: Check if data need to be completed

To check if a user needs to complete the data for a specific section, a call has to be made to the DRUID API with the following data:

Endpoint URL:

 GET https://{your-endpoint-domain.com}/user/api

Request parameters

ParameterDescriptionType
w.sectionThe entry point about which you want to ask.string
fFor this case, this parameter must be set to UserMeta string
sFor this case, this parameter must be set to needsToCompleteData string
oauth_token access_token of the logged userstring

Request example

Response

AttributeDescription
userBelongsTypologyUser belongs to scope typology
needsToCompleteOptionalDataUser does not have some optional field filled, so you can redirect user to complete_account to allow fill it
needsToConfirmIdsUser have pending id confirmation (eg: email, mobile..) so you can redirect user to complete_account to allow confirm it
needsToCompleteDataUser does not have some mandatory field filled, so you can redirect user to complete_account to allow fill it
needsToAcceptConsentsThe user has some non mandatory consent to false, so you can eventually redirect user to the data completion to allow you to set it to true if he/she wish.
needsToAcceptTermsUser must accept some t&c . After login. The user will be required to accept them if he/she wants to continue.

Step 2: Call to the complete account endpoint

If some data  need to be completed, the user has to be asked to complete them. All the parameters have to be appropriately coded.

eg:

https://register.dev.dru-id.com/register/complete_account_input?next=https%3A%2F%2Fauth.dev.dru-id.com%2Foauth2%2Fauthorize%2Fredirect%3Fclient_id%3D231705665113870%26redirect_uri%3Dhttps%253A%252F%252Fshowcase.dev.dru-id.com%252Fshowcase%252Fcallback&completeDataFieldTypes=MANDATORY&completeDataFieldTypes=CONSENTS&oauth_token=231705665113870%7C3%7C2.m2JKxgUfJ4Orm1.3600.1671616474114%7C-ur6k-uzE20TuPGBKcgJdA2_Lq3Yw1MmwJjiTprJhQc.&scope=231705665113870-main&cancel_url=https%3A%2F%2Fauth.dev.dru-id.com%2Foauth2%2Fauthorize%2Fredirect%3Fclient_id%3D231705665113870%26redirect_uri%3Dhttps%253A%252F%252Fshowcase.dev.dru-id.com%252Fshowcase%252Fcallback

Endpoint URL:

 GET https://register.{your-endpoint-domain.com}/register/complete_account_input

Request parameters

ParameterDescriptionType
nexturl encoded of oauth2/authorize endpoint with callback (refer to SDK code for more detail)string
completeDataFieldTypesany of MANDATORY, OPTIONAL, CONSENTS (multiple values can be sent)MANDATORY, OPTIONAL, CONSENTS
oauth_tokenclient token (do no send user access token)string
scopeentrypoint to usestring
cancel_urlurl encoded of oauth2/authorize endpoint with callback (refer to SDK code for more detail)string