Create generic tokens

The create generic tokens request allows the client application to create generic tokens.

Create generic tokens for user describes the API structure for creating generic tokens.

Table 1. Create generic tokens for user
Title Create generic tokens for user
URL http://<impact_url>/m2m/token
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

Curl:

curl -X PUT --header 'Content-Type: application/json' --header 'Accept: application/json'  --header 'Authorization: Basic amFpX21mb3JtYWRtaW46bWZvcm1RMXcyZSM=' -d '{
   "description": "testtoken",
  "groupName": "DM.MFORM.SURYA",
  "username": "test1234"
}' 'http://mfussip02.mformation.com:9090/m2m/token'
Response Body:
{
  "msg": "Success",
  "tokenResponse": {
    "token": "1jylmg8lwa1cy",
    "secret": "iJ6ZIaJNUsILm3WGNr55LDDCV3iQ+RjmOcQbY2IGquY=",
    "username": "TEST1234",
    "description": "testtoken"
  },"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.