OAuth 2.0 — получение токена по Client Credentials
curl --request POST \
--url https://seller-api.teez.kz/api/v1/auth/token \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"clientId": "client",
"clientSecret": "secret"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({clientId: 'client', clientSecret: 'secret'})
};
fetch('https://seller-api.teez.kz/api/v1/auth/token', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://seller-api.teez.kz/api/v1/auth/token"
payload = {
"clientId": "client",
"clientSecret": "secret"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"accessToken": "<string>",
"expiresIn": 123,
"tokenType": "<string>"
}{
"statusCode": 400,
"message": "One or more errors occurred!",
"errors": {}
}Авторизация
Токен авторизации
Выдает токен авторизации (access token) и срок его жизни в секундах (expiresIn).
POST
/
api
/
v1
/
auth
/
token
OAuth 2.0 — получение токена по Client Credentials
curl --request POST \
--url https://seller-api.teez.kz/api/v1/auth/token \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"clientId": "client",
"clientSecret": "secret"
}
'const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({clientId: 'client', clientSecret: 'secret'})
};
fetch('https://seller-api.teez.kz/api/v1/auth/token', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://seller-api.teez.kz/api/v1/auth/token"
payload = {
"clientId": "client",
"clientSecret": "secret"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"accessToken": "<string>",
"expiresIn": 123,
"tokenType": "<string>"
}{
"statusCode": 400,
"message": "One or more errors occurred!",
"errors": {}
}Требуемые параметры
- client_id — уникальный ID клиента, который продавец получает при создании ключа;
- client_secret — ключ Api клиента, который продавец получает при создании ключа.