Create Activation Code
Creates an Activation code for an existing mID user, to activate the user in the mID Server(SSMS).
Resource Informations
Name | Value |
---|---|
Requires authentication? | Yes |
Rate limited? | No |
Request
Request headers
Key | Value |
---|---|
Authorization | Bearer token |
Content-Type | application/json |
HTTP request URL for SSMS
POST https://{tenantId}.{hostname}/digitanium/v4/users/{userName}/activationcodes?responseQrType=mpower
HTTP request URL for SHIFT
POST https://{hostname}/auth/realms/{tenantId}/v3_activationcode/{userName}/?responseQrType=mpower
note
At this moment, this API is applicable only for SSMS based installations.
note
API requests must be made over https. Calls made over plain http will fail.
Parameters
No parameter fields are required.
Query Parameters (Optional)
Parameter Name | Type | Description |
---|---|---|
responseQrType | String | Format of the QR code in which you wanted to embed activation code. Set the value 'mpower' to get the mpower qr code format or Set the value to 'normal' to get the normal qr code format. |
Request body
Field Name | Type | Description |
---|---|---|
activationCode | String | activationcode value. If empty is will be autogenerated. Length of activationcode is configurable per tenant. |
activationNotAfter | String | Time after activationcode is not valid anymore. Invalid activation codes will be removed after predefined period of time. Follows Epoch time stamp. |
secret | Boolean | Invisible for administrator or other operators and encrypted in database. |
Sample Request
{
"activationCode": null,
"activationNotAfter": "epoch timestamp in seconds",
"secret": false
}
Response
Field Name | Type | Description |
---|---|---|
message | String | Message explains result of the API call. Refer Response status Information for details. |
status | String | The status of the API call. Refer Response status Information for details. |
subSystem | Integer | subSystem categorizes the type of API that has been called. Refer Subsystem details for details. |
data | Array | Response Data - a list of all activation code informations of the given userId. |
activationCode | String | Value of activationcode |
activationNotAfter | String | Time after activationcode is not valid anymore. Invalid activation codes will be removed after predefined period of time. |
creationDate | String | Time when activationcode was created in epoch unix time in seconds |
info | String | Information about activation code |
issuer | String | Which operator was issued. This will be internal service name |
userID | String | UserId of user for whom the activationcode was created |
qrImage | String | PNG representation of qrcode includes base64 format as well. |
Sample Response
{
"data": {
"activationCode": "12345673",
"activationNotAfter": "1617136566",
"creationDate": "1617107766",
"issuer": "DEV3",
"qrImage": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMgAAADIAQAAAACFI5MzAAABIklEQVR42u2YQRLDIAhFceUxvGmiN/UYrqR8sGlmareFRZw0Y3lZ0K98SYl/DXrIQ/5MKskoPApzTwNfUhjS5DNKpTJzP8E1EoQMSqM01bHpI9HIzJKsKBqRSKCqorGIrnbDRbt94EmsStobftWPJ+G1B5Fy2/iOJ9FFppM7ZbhLwjwKYVExs1iLaHnAAj+KuhNRcRIseXHJPQxBiXA/yAbmZxxiWQ/IaemnMERVZDvKJmFLxiEqJ5JVIt5880RvIpkeWe+rRK7V9id1xYq2AHCXFIbYECFNy9tJ60/sNKvmKwOTFIZYF2CTZsdaHKLdE5rijF9w24lRiAhpdSwVw8HIREDCnTa9sh+xt5ysYa0VDkOurnMS7erHkzz/HzzEn7wAl5jttDd1ZhMAAAAASUVORK5CYII=",
"userID": "demotest"
},
"message": "Activation codes created successfully",
"status": "CREATED",
"subSystem": 5
}
Response Status Information
Status Code | Status | Message |
---|---|---|
200 | CREATED | Activation codes created successfully |
401 | Unauthorized | HTTP 401 Unauthorized |
404 | Not Found | User does not exist |
Possible Error Codes
Error codes | Description |
---|---|
PERMISSION_DENIED | If the permission is denied. |
ACTIVATION_CODE_INVALID | If the ActivationCodeParam object is null. |
USERID_INVALID | If the userID is null or empty. |
ACTIVATION_INFO_INVALID | If an information is set, but the text is too long. The maximum allowed is 255 (printable ASCII) characters. |
USER_NOT_FOUND | If the given user cannot be found. |
DATE_FORMAT_ERROR | If the given date format cannot be found or invalid. |
ACTIVATION_TIME_INVALID | The activation time is in epoch milliseconds. |
ACTIVATION_TIME_HAS_EXPIRED | If the activation time has already expired. |
ACTIVATION_CODE_ALREADY_EXIST | If the activation code does already exist for the given user. |
ACTIVATION_TIME_EXCEED_MAX_DURATION | If activationNotAfter date exceeds the maximum duration. |
ACTIVATION_CODE_LENGTH_INVALID | If the length of the activation code exceeds the maximum of 32 digits. |
GENERAL_ERROR | If an internal error occurs. |
INVALID_CHARACTERS | If the activation code contains invalid characters. Only printable ASCII characters between 32 and 126 (decimal code) are allowed |