import cobo_waas2
from cobo_waas2.models.refresh_token200_response import RefreshToken200Response
from cobo_waas2.models.refresh_token_request import RefreshTokenRequest
from cobo_waas2.rest import ApiException
from pprint import pprint
# See configuration.py for a list of all supported configurations.
configuration = cobo_waas2.Configuration(
# Replace `<YOUR_PRIVATE_KEY>` with your private key
api_private_key="<YOUR_PRIVATE_KEY>",
# Select the development environment. To use the production environment, change the URL to https://api.cobo.com/v2.
host="https://api.dev.cobo.com/v2",
)
# Enter a context with an instance of the API client
with cobo_waas2.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = cobo_waas2.OAuthApi(api_client)
refresh_token_request = cobo_waas2.RefreshTokenRequest()
try:
# Refresh Org Access Token
api_response = api_instance.refresh_token(refresh_token_request)
print("The response of OAuthApi->refresh_token:\n")
pprint(api_response)
except Exception as e:
print("Exception when calling OAuthApi->refresh_token: %s\n" % e)
Access tokens
Refresh Org Access Token
This operation is only applicable to Cobo Portal Apps developers. To call this operation, you need to use the Cobo OAuth authentication method that requires an app key.
For security purposes, Org Access Tokens expire after a certain period. Once they expire, the app needs to call this operation to get a new Org Access Token and a new Refresh Token.
