Saltar al contenido principal

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"
}
ParameterTypeRequiredDescription
refresh_tokenstringYesThe refresh token used to obtain a new access token
grant_typestringYesThe type of grant being requested, must be "refresh_token"

Response​

{
"access_token": "string"
}
FieldTypeDescription
access_tokenstringThe 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​

HeaderValueRequired
AuthorizationBearer {token}Yes

Response​

{
"id": 0,
"name": "string",
"brandimagen": "string"
}
FieldTypeDescription
idnumberThe ID of the business
namestringThe name of the business
brandimagenstringThe 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