Authentication tokens API Resource

DELETE /api/authtokens

Revoke authentication token

Example of request:

{"token":"existing token"}

Request Body
media type data type
application/json TokenInfoTO (JSON)
Response Body
media type data type description
application/json HdcSuccessTO (JSON) JSON Response with information, whether the revoking has or has not been succeeded.

Example

Request
DELETE /api/authtokens
Content-Type: application/json
Accept: application/json

                
{
  "userFullName" : "...",
  "currentUserId" : 12345,
  "context" : [ "AddCommentToChangeRequest", "ChangeStateOfChangeRequest" ],
  "lastUpdate" : "...",
  "userInfo" : { },
  "contextAsCodesArray" : [ 12345, 12345 ],
  "token" : "...",
  "userId" : 12345
}
                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/json

                
{ }
                
              

POST /api/authtokens

Create new authentication token

Example of request:

{"userId":user_id,"context":[list of contexts]}

Request Body
media type data type
application/json TokenInfoTO (JSON)
Response Body
media type data type description
application/json HdcSuccessTO (JSON) JSON Response with information, whether the creation has or has not been succeeded.

Example

Request
POST /api/authtokens
Content-Type: application/json
Accept: application/json

                
{
  "userFullName" : "...",
  "currentUserId" : 12345,
  "context" : [ "AddCommentToChangeRequest", "AddCommentToChangeRequest" ],
  "lastUpdate" : "...",
  "userInfo" : { },
  "contextAsCodesArray" : [ 12345, 12345 ],
  "token" : "...",
  "userId" : 12345
}
                
              
Response
HTTP/1.1 201 Created
Content-Type: application/json

                
{ }
                
              

PUT /api/authtokens

Update authentication token

Example of request:

{"token":"existing token","userId":user_id,"context":[list of contexts]}

Request Body
media type data type
application/json TokenInfoTO (JSON)
Response Body
media type data type description
application/json HdcSuccessTO (JSON) JSON Response with information, whether the updating has or has not been succeeded.

Example

Request
PUT /api/authtokens
Content-Type: application/json
Accept: application/json

                
{
  "userFullName" : "...",
  "currentUserId" : 12345,
  "context" : [ "ChangeStateOfChangeRequest", "AddCommentToChangeRequest" ],
  "lastUpdate" : "...",
  "userInfo" : { },
  "contextAsCodesArray" : [ 12345, 12345 ],
  "token" : "...",
  "userId" : 12345
}
                
              
Response
HTTP/1.1 204 No Content
Content-Type: application/json

                
{ }
                
              

GET /api/authtokens/json

Get all authentication tokens.

Response Body
media type data type description
application/json object (JSON) JSON Response with the list of tokens.

Example of response:

{"list":[{"context": [{"name": "Context name","code": context_code}],"userId":user_id,"userFullName":"User Full Name","token":"alphanumeric_token"}]}

Example

Request
GET /api/authtokens/json
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
...
                
              

GET /api/authtokens/context/json

Get all possible contexts for authentication tokens.

Response Body
media type data type description
application/json object (JSON) JSON Response with the list of contexts with possible endpoints.

Example of response:

{list: [{"code": 1,"name": "contextName1"},{"code":2,"name":"contextName2"}]}

Example

Request
GET /api/authtokens/context/json
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
...