Processing.

Request

Note: For testing purpose, Client Id and Password are read-only

u34_start u34_end u34_line
u35_start u35_end u35_line
u36_start u36_end u36_line
u36_start u36_end u36_line
u36_start u36_end u36_line
u36_start u36_end u36_line
u36_start u36_end u36_line
u36_start u36_end u36_line
u36_start u36_end u36_line
u37_start u37_end u37_line

Shipping Label

Manifest

Close-Out

Tracking

English

Thai

Chinese

AUTHENTICATION ENDPOINT - ACCESS TOKEN

To access any of DHL eCommerce's resources an access token may be required. This call is used for retrieving the authentication token required to invoke the API/s authorized to user for access. The user is assigned a client ID / user ID and password during subscription, and these are required parameters when making a call. The following information will help guide you through obtaining an access token.

/rest/v1/OAuth/AccessToken

u103_start u103_end u103_line

GET

REQUEST

u108_start u108_end u108_line

The request has to conform with the below specifications:

ENVIRONMENT

PROTOCOL

FORMAT

u119_start u119_end u119_line

HOST

RESOURCE PATH

u124_start u124_end u124_line

Production

https

api.dhlecommerce.dhl.com

json(default)

• xml

/rest/v1/OAuth/AccessToken

PreProd

https

apitest.dhlecommerce.asia

json(default)

• xml

/rest/v1/OAuth/AccessToken

QUERY STRING PARAMETERS

u148_start u148_end u148_line

The API user will send a request, which conforms to following parameters, to the query component of the authorization format:

NAME

REQUIRED

DESCRIPTION

u160_start u160_end u160_line

clientId

Yes

Client identification is assigned when the user/client subscribes to the API

returnFormat

No

Return message format. Option of

 

•     json (default)

•     xml

 

Case sensitive.

u173_start u173_end u173_line
u180_start u180_end u180_line
-

password

Yes

Password is assigned when the user/client subscribes to the API

Sample Request

cURL

curl -X GET -H "Cache-Control: no-cache" "https://apitest.dhlecommerce.asia/rest/v1/OAuth/AccessToken?clientId=LTExMTgwNTI4MTY=&password=APITest1&returnFormat=json"

RESPONSE

If the authentication request is valid and authorized, the authorization server will issue an access token, and add the following parameters to the entity body.

u192_start u192_end u192_line
NAME REQUIRED TYPE DESCRIPTION
u132_line
token Yes String Access token issued by authorization server
u173_line
token_type Yes String HTTP Authentication type
u173_line
expire_in_seconds Yes String The lifetime of the access token in seconds.
u173_line
client_id Yes String Client identification provided in the request.
u173_line
responseStatus
Yes Group Response status returned by the service.
u173_line
code
Yes Integer Status Code - A unique code that identifies successful or failure in the processing
u173_line
message
Yes String Short description indicating successful or failure in the processing
u173_line
messageDetails
Yes String Additional description indicating successful or failure in the processing

RESPONSE STATUS CODES

u192_start u192_end u192_line


STATUS CODE STATUS MESSAGE STATUS MESSAGE DETAILS
u132_line
100000 Service operation completed successfully Access token assigned.
u173_line
100099 Exception occured when assigning token. Make sure valid scope and clientId are provided.

Sample Response

Client Id

Password

Return Format

TEST IT

Response

 Access Token Expiration

   A new token will be generated for the clientID requested every 12 hours. All generated tokens last for 24 hours. The system will return the same access token when

   receiving multiple requests for the access token from the same user (same clientId) within 12 hours, after which a new token is generated, however the old token

   is still valid for remainder of the validity period. When it expires, the requested resource will throw the following error: "Access token authentication failed."

   At this time, a new access token needs to be requested. A new access token is not needed for each request.