Web API: Token: Difference between revisions

From QPR ProcessAnalyzer Wiki
Jump to navigation Jump to search
No edit summary
Line 1: Line 1:
The Web API session starts with a login. Session id is get as a response which is used to authenticate other Web API operations.
==Request==
==Request==
* The request url has the following form: https://HOSTNAME/qprpa/token. Note that the path doesn't contain '''api''' unlike all other operations in the API.
* Request url has the following form: <nowiki>https://SERVER/qprpa/token</nowiki>, where SERVER is the DNS name of the server. Note that the path doesn't contain '''api''' unlike all other operations in the Web API.
* The request method is POST
* Request method is '''POST'''.
* '''Content-Type''' in the HTTP request header must be '''application/x-www-form-urlencoded'''
* '''Content-Type''' in the HTTP request header must be '''application/x-www-form-urlencoded'''.
* The payload contains the parameters as url encoded:
* Payload contains the following parameters as url encoded:
** '''username''': Username.
** '''password''': User password.
** '''grant_type''': '''password''' (always use that value)
** '''grant_type''': '''password''' (always use that value)
** '''username''': Username
** '''password''': User password.


Example:
Example:
<pre>
<pre>
grant_type=password&username=myUserName&password=myPassword
username=myUserName&password=myPassword&grant_type=password
</pre>
</pre>


==Response==
==Response==
The response as a JSON object with several properties. One of them is ''access_token'' containing the session id.
The response is a JSON object with several properties. One of them is '''access_token''' containing the session id.
 
[[Category: QPR ProcessAnalyzer]]

Revision as of 19:37, 15 May 2020

The Web API session starts with a login. Session id is get as a response which is used to authenticate other Web API operations.

Request

  • Request url has the following form: https://SERVER/qprpa/token, where SERVER is the DNS name of the server. Note that the path doesn't contain api unlike all other operations in the Web API.
  • Request method is POST.
  • Content-Type in the HTTP request header must be application/x-www-form-urlencoded.
  • Payload contains the following parameters as url encoded:
    • username: Username.
    • password: User password.
    • grant_type: password (always use that value)

Example:

username=myUserName&password=myPassword&grant_type=password

Response

The response is a JSON object with several properties. One of them is access_token containing the session id.