Set Predefined Code
š Set Predefined Code API
This API allows enterprise backend applications to set a predefined code and verification key for a REL-ID user. This code acts as an access code or OTP and will be used during the user's activation process.
š Endpoint
PUT https://REL-ID-SERVER-IP:9442/v1/users/{userId}/predefinedCode
š Authorization
Authorization: Bearer <access_token>
Content-Type: application/jsonš„ Path Parameter
| Parameter | Type | Required | Description |
|---|---|---|---|
userId | String | ā Yes | Unique REL-ID user ID for which the code is being set. |
š§¾ Request Body
{
"predefinedCode": "ACCESS123",
"predefinedVerKey": "KEY456"
}| Field | Type | Required | Description |
|---|---|---|---|
predefinedCode | String | ā Yes | The access code or OTP value that should be set for the user. |
predefinedVerKey | String | ā Optional | A verification key shown alongside the access code. |
ā
Success Response
{
"message": "Predefined code set successfully"
}ā Error Responses (Collapsible)
š 404 - User Not Found
{
"timeStamp": "2023-05-30T12:33:32IST",
"status": 404,
"error": "Data not present.",
"message": "User not found.",
"path": "/v1/users/su1/predefinedCode"
}ā ļø 422 - Invalid or Missing Fields
{
"timeStamp": "2023-05-30T12:33:32IST",
"status": 422,
"error": "Invalid data.",
"message": "Mandatory fields missing",
"path": "/v1/users/u1/predefinedCode"
}š„ 500 - Internal Server Error
{
"timeStamp": "2023-05-30T12:33:32IST",
"status": 500,
"error": "Internal Server Error",
"message": "Unexpected error occurred while processing request",
"path": "/v1/users/u1/predefinedCode"
}š Notes
- This API is typically used when the enterprise wants to control the activation code instead of letting REL-ID generate it dynamically.
- The code set via this API will be used by the REL-ID SDK during device activation.
Updated 10 months ago
