iPeakoin API Authentication

Use Access Token to authenticate your client requests when utilizing iPeakoin APIs.

Access Token are unique data strings used to authenticate a user and enable access to privileged operations on iPeakoin APIs. All iPeakoin APIs use access token as the mechanism to authenticate client requests. Your access token should be kept confidential and secure at all times.

  • Authentication is required for all API requests; without it, the requests will fail.
  • All API requests must be made over HTTPS.

API Authentication

x-ipeakoin-access-token: YOUR_ACCESS_TOKEN

API requests without authentication will fail. It is also important to note that all API requests must be made over HTTPS.

Test Authentication

1. Get Code

# Replace ${IPEAKOIN_CLIENT_ID} with your client id
curl -H 'Accept: application/json' \
  -X GET --url https://api-sandbox.ipeakoin.com/open-api/oauth/authorize?clientId=${IPEAKOIN_CLIENT_ID}

๐Ÿ‘

Successful Response

{
"timestamp": 1678775522,
"code": "a38810c9e0bdac584f86953721b9a965"
}

2. Request Access Token

# Replace ${IPEAKOIN_CLIENT_ID} with your client id
# Replace ${IPEAKOIN_CLIENT_SECRET} with your client secret
# Replace ${IPEAKOIN_AUTH_CODE} with your code
curl -H 'Accept: application/json' \
  -X GET --url https://api-sandbox.ipeakoin.com/open-api/oauth/access-token \
  --data "{
    \"clientId\": ${IPEAKOIN_CLIENT_ID},
    \"clientSecret\": ${IPEAKOIN_CLIENT_SECRET},
    \"code\": ${IPEAKOIN_AUTH_CODE}
  }"

๐Ÿ‘

Successful Response

{
"accessToken": "be41c06e11795655e439cbd4b02c335e770ba27f",
"refreshToken": "b93a7ac26e7b70ef322fab08f234d8b7d0bda50c32dc5d6d972716e66788ad61",
"expiresIn": 86400,
"timestamp": 1678775835
}