Skip to main content

Authorization in the Gold Apple Unified API Service

Interaction with the service — for example, sending a delivery date change or synchronizing the pickup point directory — requires authorization. Authorization is performed using a login and password issued by Gold Apple technical specialists. The service uses the username and password to generate an access token, which it returns in the response body. Use this token to authenticate subsequent requests. The token's lifetime is 5 minutes.

info

Attention! More than 10 authentication attempts with an incorrect login/password pair will result in the login and IP address being blocked. IP allowlisting is not used; the endpoint is accessible over the public network.

Basic Information​

Request method typePOST
Path / URL/api/v1/auth/login
DescriptionMethod for authenticating the External Courier Service in the Unified API service
DirectionThe request is executed by the courier service. The response is provided by the Gold Apple IS.

Request​

Required Headers​

ParameterData typeRequiredDescriptionComment
Hoststring1Courier service hostFilled in as "subdomain.domain.zone"
Content-Typestring1Request content typeFilled in as "application/json"

Payload​

ParameterData typeRequiredDescription
usernamestring1Username (login) issued by Gold Apple
passwordstring1Password for authentication, issued by Gold Apple

Request example​

{
"username": "ECS_LOGIN",
"password": "*************"
}

Response​

Response Codes and Messages​

CodeStatusMessageReason
200OKSuccess responseEverything completed successfully
400Bad RequestMissing or inappropriate required parametersRequired parameters are missing or invalid
500Internal Server ErrorServer unavailableThe server is unavailable

Successful Response Parameters​

ParameterData typeRequiredDescription
access_tokenstring1Access token, issued for one month per login/password pair.
expires_instring1Token lifetime, specified in seconds.

Successful response example​

{
"access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.
eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.
SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
"expires_in": "2592000"
}

Unsuccessful Response Parameters​

ParameterData typeRequiredDescription
errorstring1Human-readable description of the error

Unsuccessful response example​

{
"error": "Missing or inappropriate required parameters"
}