Sokin's API uses OAuth2 with the Client Credentials flow for server-to-server authentication.The Client Credentials flow allows your application to authenticate using a Client ID and Client Secret to obtain an access token, which is then used to make authorized API requests.Getting Started#
Prerequisites#
Before you begin, you'll need:API base URL: https://api-sokin.com
Authentication Steps#
Step 1: Obtain an Access Token#
Make a POST request to the token endpoint with your client credentials:
Endpoint:Step 2: Use the Access Token#
Include the access token in the Authorization header of your subsequent API requests.Step 3: Refresh When Expired#
Access tokens expire after 24 hours. When a token expires, repeat Step 1 to obtain a new access token. We recommend requesting a new token shortly before expiration to avoid service interruption.Best Practices#
Secure Your Credentials: Never expose your Client Secret in client-side code or public repositories. Store credentials securely using environment variables or a secrets management system.Cache Access Tokens: Don't request a new token for every API call. Cache the token and reuse it until it expires to reduce unnecessary requests.Handle Token Expiration: Implement logic to detect expired tokens (401 Unauthorized responses) and automatically request a new token.Use HTTPS: Always use HTTPS for all API requests to protect your credentials and tokens in transit. Modified at 2025-12-05 13:29:35