POST /users/{username}/requests

Creates a user request of the desired type. 

This resource is available only for Global admin, Domain admin, or User manager

Since BellaDati 2.7.19.1, this endpoint is public for requests PASSWORD_RESET and UNLOCK_ACCOUNT. Thus, no authenticated user is required to call it for these 2 requests

Resource Information

Request Parameters

Parameters

Detail

username
(path parameter)

Username of the user the request is created for.
If "Allow login with email" is enabled, user's email must be used instead

request_type
(form parameter)

Specifies the type of request. Available types are:

  • LOGIN_UNATTENDED - for issuing AJAX request to do the login (see Implementing simple SSO)
  • PASSWORD_SET - user is prompted to set the password
  • PASSWORD_RESET - password reset link is sent to the email
  • UNLOCK_ACCOUNT - account is unlocked
  • LOGIN - user is automatically logged in without entering username/password
  • CUSTOM - creates user, send PIN and executes request.

requestPin

(form parameter, optional)

Specifies whether PIN will be sent instead of URL link. If not set URL link is sent by default.

Available values: true / false

endpoint When custom request is used, path to belladati endpoint to be executed
OK or ERROR is returned as process request action.
parametersWhen custom request is used, set parameters for endpoint

Returns

request_id and request_code of the created request.

Example: 1544;RDQX1Qx9UokSf4n3KAVWgNClvrFUqncSZg7fK3gnVAfNIAOylN

Gathered request_id and request_code are consumed by the specific BellaDati service. You should create AJAX call with following URL pattern:

http://belladati_host/user/processRequest/{request_id}/{request_code}?redirect={redirect_url}

Sample Request / Response

Using curl:

curl -H "Authorization: OAuth realm=\"https://service.belladati.com/\", oauth_consumer_key=\"myConsumer\", oauth_token=\"mh7an9dkrg59\", oauth_timestamp=\"135131231\", oauth_nonce=\"randomString\"" -d "request_type=LOGIN_UNATTENDED" https://service.belladati.com/api/users/username1/requests

Response in format oauth_token;oauth_token_secret:

1544;RDQX1Qx9UokSf4n3KAVWgNClvrFUqncSZg7fK3gnVAfNIAOylN
  • No labels