Session API
The Session API provides functionality for authentication and secure session management through two main services.
Refresh Token
This endpoint allows clients to renew their access token once it has expired, maintaining an active session without needing to log in again.
Endpoint
POST /api/v3/business/oauth/access_token
Request Body
{
"refresh_token": "string",
"grant_type": "refresh_token"
}
| Parameter | Type | Required | Description |
|---|---|---|---|
| refresh_token | string | Yes | The refresh token used to obtain a new access token |
| grant_type | string | Yes | The type of grant being requested, must be "refresh_token" |
Response
{
"access_token": "string"
}
| Field | Type | Description |
|---|---|---|
| access_token | string | The new access token obtained |
Example
curl -X POST \
'https://api.parkup.cl/api/v3/business/oauth/access_token' \
-H 'Content-Type: application/json' \
-d '{
"refresh_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"grant_type": "refresh_token"
}'
Validate Token
This endpoint provides a way to verify if an access token is valid and has not expired or been revoked.
Endpoint
POST /api/v3/business/validate
Headers
| Header | Value | Required |
|---|---|---|
| Authorization | Bearer {token} | Yes |
Response
{
"id": 0,
"name": "string",
"brandimagen": "string"
}
| Field | Type | Description |
|---|---|---|
| id | number | The ID of the business |
| name | string | The name of the business |
| brandimagen | string | The image URL of the business brand |
Example
curl -X POST \
'https://api.parkup.cl/api/v3/business/validate' \
-H 'Authorization: Bearer \{your_access_token\}'
Error Responses
401 Unauthorized
{
"statusCode": 401,
"message": "Unauthorized"
}
This error occurs when:
- The access token is invalid
- The access token has expired
- The access token is missing