Create One-Time Password Token Request
POST Create One-Time Password Token Request
https://useast.api.elasticpath.com/v2/authentication-realms/:realm-id/password-profiles/:profile-id/one-time-password-token-request
Parameters
Headers
| Name | Required | Type | Description | 
|---|---|---|---|
| Authorization | Required | string | The Bearer token required to get access to the API. | 
Body
| Name | Required | Type | Description | 
|---|---|---|---|
| type | Required | string | Represents the type of object being returned. You must use one_time_password_token_request. | 
| username | Required | string | The username. | 
| purpose | Required | string | Represents the purpose for requesting one-time password token. Value must be reset_passwordorpasswordless_authentication. | 
Request Examples
Curl
curl -X POST https://useast.api.elasticpath.com/v2/authentication-realms/:realm-id/password-profiles/:profile-id/one-time-password-token-request \
    -H "Authorization: Bearer XXXX" \
    -H "Content-Type: application/json" \
    -d $'{
    "data": {
      "type": "one_time_password_token_request",
      "username": "john.doe",
      "purpose": "reset_password"
    }
  }'
JavaScript SDK
const MoltinGateway = require('@moltin/sdk').gateway
const Moltin = MoltinGateway({
  client_id: 'X'
})
const realmId = 'XXXX'
const profileId = 'XXXX'
const body = {
    type: "one_time_password_token_request",
    username: "john.doe",
    purpose: "reset_password"
}
Moltin.OneTimePasswordTokenRequest.Create({
      realmId,
      profileId,
      body
    }
  )
Response Example
202 Accepted