Retrieve the Access Token
You can use the following REST service to login with Service Account. The Access Token retrieved from this API can be used to access other APIs.
URL: http://%3Clocalhost%3E:31443/avxapi/acctmgmt-get-service-token?gwsource=web&gwkey=f000ca01
Type: POST
http://appviewx.eval.com:31443/avxapi/login?gwsource=external
- Method: POST
- Response Format: JSON
- Requires authentication: Yes
- Request timeout period: 15 minutes.
Parameters
| Param Type | Name | Description | Field Type |
|---|---|---|---|
| Header | Content Type** | Specifies the nature of the data in the payload (The value of the param should be "application/x-www-form-urlencoded" | string |
| Header | client_id** | Client ID of the Service Account | String |
| Header | client_secret** | Client Secret of the Service Account | String |
| Payload | grant_type | Specifies the grant type. (The value of the param should be "client_credentials" | String |
** - Mandatory value
Possible Response Message and Code
| HTTP Code | Description | Response Message |
|---|---|---|
| 400 | Bad request | Login failed. Invalid credentials. |
| 200 | OK | Login successful |
| 401 | Unauthorized | Authentication failed. The reason - Invalid Credentials. |
Sample Request/Response
Use Case
Get Access token with Client ID and Client Secret.
Request URL
http://localhost:31443/avxapi/acctmgmt-get-service-token?gwsource=web&gwkey=f000ca01
Headers
Content-Type: application/x-www-form-urlencoded
client_id: 521c3ad2-ea4e-447b-a51b-9621bb7ea126
client_secret: 55AU#NO8%*ZhgvNfaYUmtvX0dkEhodbi
grant_type=client_credentials
Request Payload
{}
"{
""response"": ""eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJwbGF0Zm9ybSIsImF1ZCI6ImF2eCIsImNsaWVudElkIjoiOTcwNzRlNDEtOGFmOS00NTZkLTlhNjQtZjBjNGJiOTA4MDQ4IiwiaXNzIjoiYXZ4IiwiZXhwIjoxNjUwMzY5MzY3LCJncmFudCB0eXBlIjoiY2xpZW50X2NyZWRlbnRpYWxzIn0.HZnkuUEjXIeqJWqpqiNWFHqIDI7GYf4cWx6VwbjGD_0"",
""message"": null,
""appStatusCode"": null,
""tags"":{},
""headers"": null
}"