POST Services
GET TOKEN
This service should only be consumed when OAuth is active in the application. It generates a token to consume the other services.
| PARAMETER | TYPE | MEDIUM | DESCRIPTION |
|---|---|---|---|
| grant_type | String | FormData | Type of Authorization |
| username | String | FormData | Username assigned by Ado for the token query. |
| password | String | FormData | Password corresponding to the assigned user for the token query, must be in SHA-1 hash format. |
Example consumption:
|
1
|
curl -X POST "http://localhost:62859/api/token" -H "accept: application/json" -H "Content-Type: application/x-www-form-urlencoded" -d "grant_type=password&username=username&password=sha1password" |
| Code | Description |
|---|---|
| 200 | JSON object containing the token and other fields described in the RESPONSE FIELDS table |
| 400 | unsupported_grant_type The user name or password is incorrect. |
| Field Name | TYPE | DESCRIPTION |
|---|---|---|
| access_token | String | El token emitido. |
| token_type | String | Tipo de token generado. |
| expires_in | Int | Tiempo de vigencia del token en minutos. |
| issued | String | Fecha y hora de emisión de emisión del token. |
| expires | String | Fecha y hora de vencimiento del token. |
Example response:
|
1
2
3
4
5
6
7
|
{ "access_token": "laK8SdjrKUAN7ja4SicUS-mL8eNWW74OTU2ZmSzjABLCGUgZknEifQkNtd5F20pBQiWvDpVwda9Bf31hB-mnzJLWmuKYY1sygHT37RQGI3Ym1HkLHwduutHwze2m9ZSBWCSV9NgOjO5Zd0Rcl9eexjFOS7cR6lOIZxxu31rLI_mHMbgtdSMAG-gToiHkgeXw6zbYjVaO1IzKMDjczyLZuvlYOfKNiJeh-3XbfjRxUy0", "token_type": "bearer", "expires_in": 59, ".issued": "Mon, 27 Jul 2020 20:38:24 GMT", ".expires": "Mon, 27 Jul 2020 20:39:24 GMT"} |