Create token for Subscriber Repository

The create token for Subscriber Repository request allows the client application to create Subscriber Repository tokens.

Create Subscriber Repository tokens for userdescribes the API structure for creating Subscriber Repository tokens.

Table 1. Create Subscriber Repository tokens for user
Title Create Subscriber Repository tokens for user
URL http://<impact_url>/m2m/token/subscriber-repo
Method PUT
Content-Type application/json
URL Params

The following are the URL parameters:

  • description:[string]: Specifies the description of the newly created token.

  • groupName:[string]: Specifies the group name for which the token needs to be created.

  • username:[string]: Specifies the user who creates the token.

Data Params

The following are the data parameters:

  • msg:[string]: success or failure message

  • tokenResponse:[string]: list of tokens created for a group

Success Code
Response Code: 202
Error Code
201 : Created 
401 : Unauthorized 
403 : Forbidden 
404 : Not Found
Sample Call

Request:

Request
PUT /m2m/token/subscriber-repo HTTP/1.1
Host: devlwm2m-edge-01
Authorization: Basic dGVzdDp0ZXN0
Content-Type: application/json
Content-Length: 86

{"description": "Token for Subscriber Repo","groupName": "TEST" , "username": "test" }
Response Body:

Response:
{
    "tokenResponse": {
        "token": "qdya7zm10rj6",
        "secret": "G0dAwveiOalgGmBfXXCMFTC/+dvnLJPwp3Bv9ujW9rA=",
        "username": "TEST",
        "description": "Token for Subscriber Repo",
        "messageId": "1669015119.885_7115_163487_3"
    },
    "msg": "Success",
    "code": 1000
}
Notes

If length of username field in the request, is more than 50 characters, the following message appears:

‘username' cannot be more than 50 characters.
Note: The username used in the request body need not be the same as the registered enterprise user.