Skip to main content

Create Activation Code

Creates an Activation code for an existing mID user, to activate the user in the mID Server(SSMS).

Resource Informations

NameValue
Requires authentication?Yes
Rate limited?No

Request

Request headers

KeyValue
AuthorizationBearer token
Content-Typeapplication/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 NameTypeDescription
responseQrTypeStringFormat 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 NameTypeDescription
activationCodeStringactivationcode value. If empty is will be autogenerated. Length of activationcode is configurable per tenant.
activationNotAfterStringTime after activationcode is not valid anymore. Invalid activation codes will be removed after predefined period of time. Follows Epoch time stamp.
secretBooleanInvisible for administrator or other operators and encrypted in database.

Sample Request

{
"activationCode": null,
"activationNotAfter": "epoch timestamp in seconds",
"secret": false
}

Response

Field NameTypeDescription
messageStringMessage explains result of the API call. Refer Response status Information for details.
statusStringThe status of the API call. Refer Response status Information for details.
subSystemIntegersubSystem categorizes the type of API that has been called. Refer Subsystem details for details.
dataArrayResponse Data - a list of all activation code informations of the given userId.
activationCodeStringValue of activationcode
activationNotAfterStringTime after activationcode is not valid anymore. Invalid activation codes will be removed after predefined period of time.
creationDateStringTime when activationcode was created in epoch unix time in seconds
infoStringInformation about activation code
issuerStringWhich operator was issued. This will be internal service name
userIDStringUserId of user for whom the activationcode was created
qrImageStringPNG 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 CodeStatusMessage
200CREATEDActivation codes created successfully
401UnauthorizedHTTP 401 Unauthorized
404Not FoundUser does not exist

Possible Error Codes

Error codesDescription
PERMISSION_DENIEDIf the permission is denied.
ACTIVATION_CODE_INVALIDIf the ActivationCodeParam object is null.
USERID_INVALIDIf the userID is null or empty.
ACTIVATION_INFO_INVALIDIf an information is set, but the text is too long. The maximum allowed is 255 (printable ASCII) characters.
USER_NOT_FOUNDIf the given user cannot be found.
DATE_FORMAT_ERRORIf the given date format cannot be found or invalid.
ACTIVATION_TIME_INVALIDThe activation time is in epoch milliseconds.
ACTIVATION_TIME_HAS_EXPIREDIf the activation time has already expired.
ACTIVATION_CODE_ALREADY_EXISTIf the activation code does already exist for the given user.
ACTIVATION_TIME_EXCEED_MAX_DURATIONIf activationNotAfter date exceeds the maximum duration.
ACTIVATION_CODE_LENGTH_INVALIDIf the length of the activation code exceeds the maximum of 32 digits.
GENERAL_ERRORIf an internal error occurs.
INVALID_CHARACTERSIf the activation code contains invalid characters. Only printable ASCII characters between 32 and 126 (decimal code) are allowed