noqa: E501
Get access and refresh token by code https://yandex.ru/dev/market/partner-api/doc/ru/concepts/how-to-use-refresh-token#get-tokens :param client_id: app client id :param client_secret: app client secret :param code: code, that you got after _auth :return: dict with access_token, expires_in, token_type and refresh_token keys
Source code in marketplace_apis/yandex/oauth/methods.py
Python |
---|
44
45
46
47
48
49
50
51
52
53
54
55
56 | @staticmethod
def get_tokens_by_code(client_id: str, client_secret: str, code: int) -> dict:
"""# noqa: E501
Get access and refresh token by code
https://yandex.ru/dev/market/partner-api/doc/ru/concepts/how-to-use-refresh-token#get-tokens
:param client_id: app client id
:param client_secret: app client secret
:param code: code, that you got after _auth
:return: dict with access_token, expires_in, token_type and refresh_token keys
"""
return OAuthMethods._get_tokens(
client_id, client_secret, code, "authorization_code", "code"
)
|