This API allows enterprise backend applications to set a predefined code and verification key for a Ditto ID user. This code acts as an access code or OTP and will be used during the user's activation process.
PUT https://REL-ID-SERVER-IP:9442/v1/users/USERID/predefinedCode
HTTP
Authorization: Bearer <access_token>
Content-Type: application/json
Parameter Type Required Description userIdString ✅ Yes Unique Ditto ID user ID for which the code is being set.
JSON
{
"predefinedCode": "ACCESS123",
"predefinedVerKey": "KEY456"
}
Field Type Required Description predefinedCodeString ✅ Yes The access code or OTP value that should be set for the user. predefinedVerKeyString ❌ Optional A verification key shown alongside the access code.
JSON
{
"message": "Predefined code set successfully"
}
🔍 404 - User Not Found
JSON
{
"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
JSON
{
"timeStamp": "2023-05-30T12:33:32IST",
"status": 422,
"error": "Invalid data.",
"message": "Mandatory fields missing",
"path": "/v1/users/u1/predefinedCode"
}
💥 500 - Internal Server Error
JSON
{
"timeStamp": "2023-05-30T12:33:32IST",
"status": 500,
"error": "Internal Server Error",
"message": "Unexpected error occurred while processing request",
"path": "/v1/users/u1/predefinedCode"
}
This API is typically used when the enterprise wants to control the activation code instead of letting Ditto ID generate it dynamically.
The code set via this API will be used by the Ditto ID SDK during device activation.