RCL API Docs

Download as pdf or txt
Download as pdf or txt
You are on page 1of 4

API Documentation

Version 1.0
( http://api-dev.rcl.co.id/api/v1/documentation )

IT Team
Red Carpet Logistics
Base URL:

 Sandbox: http://api-dev.rcl.co.id/api/v1
 Production: http://api.rcl.co.id/api/v1

1. Authorization – Get Access Token

Title Get Access Token


Note: Use this endpoint to get access token, which will be used to access
authorized endpoint. Put the access token on the header request.

URL /oauth/access_token

Method POST

Data Body
Params {
"grant_type": [string],
"client_id": [string],
"client_secret": [string],
"scope": [string]
}

Data example
{
"grant_type": "client_credentials",
"client_id": "3pl_abc",
"client_secret": "1q2w3e4r5t6y7u8i9o",
"scope": "3pl"
}

Success Code: 200


Response Content:
{
"access_token": "1Vf9HXgZhXFmfT8izVVsc8OISgiFo3bnqkp4EuNu",
"token_type": "Bearer",
"expires_in": 2592000
}

Error Code: 500 Internal Server Error


Response Content:
{
"message": "Client authentication failed.",
"status_code": 500
}
Notes We recommend to save the access token on your server side. It can be
used multiple times and expires in 30 days. You can get access token
again when having 401 error response code.

2. 3PL Update Package Status

Title 3PL Update Package Status


Note: This is an authorized endpoint. Use this endpoint to update 3PL
package status.

URL /couriers/package/update

Method POST

Data Params Header


Authorization: Bearer [access_token]
Content-Type: application/json

Body (array of awb)


[
{
"awb": [string],
"status": [string],
"notes": [string]
},
{
"awb": [string],
"status": [string],
"notes": [string]
}
]

Data Example

Header
Authorization: Bearer 1Vf9HXgZhXFmfT8izVVsc8OISgiFo3bnqkp4EuNu
Content-Type: application/json

Body (array of awb)


[
{
"awb": 123123123,
"status": "Delivered",
"notes": "Receiver: Budi. Relation: Orang Tua."
},
{
"awb": 456456456,
"status": "Delivered",
"notes": "Receiver: Tuti. Relation: Pembantu Rumah
Tangga."
}
]

Success Code: 200


Response Content:
{
"status": "SUCCESS",
"message": "Package status successfully updated"
}

Error Code: 400 Bad Request


Response Content:
{
"status": "ERROR",
"message": {
"0.awb": [
"The selected 0.awb is invalid."
],
"1.awb": [
"The selected 1.awb is invalid."
]
}
}

Code: 401 Unauthorized


Content:
{
"message": "The resource owner or authorization server
denied the request.",
"status_code": 401
}

You might also like