Access Token Endpoint
Request an Access Token
Request Parameters
Sample Request
Response
Success Response
Refresh Token Endpoint
The Access Token Endpoint
enables clients to acquire an OAuth2 access token by submitting valid client credentials. This token is required for authenticating subsequent API requests.
URL:
https://api.accounda.com/v1/token/
Method:
POST
Content-Type:
application/x-www-form-urlencoded
client_id
string
The client identifier issued during client registration.
client_secret
string
The client secret associated with the client_id.
https
POST /v1/token/ HTTP/1.1 Content-Type: application/x-www-form-urlencoded client_id=your_client_id&client_secret=your_client_secret
Content-Type:
application/json
On success, the API returns a JSON object containing the access token, token type, and expiration time.
Error Response
Status Code:
200 OK
json
{ "access_token": "your_access_token", "token_type": "Bearer", "expires_in": 3600 }
If the request fails due to missing or invalid client credentials, the API returns an error message.
Security
Status Code:
400 Bad Request
Missing Client Credentials
json
{ "error": "Missing client credentials" }
Invalid Client Credentials
json
{ "error": "Invalid client credentials" }
This endpoint requires client credentials (client_id and client_secret). All API requests should be made over HTTPS to ensure data security.
Example Usage
Here’s an example using
Notes
curl
to obtain an access token:
bash
curl -X POST https://api.accounda.com/v1/token/ \ -d "client_id=your_client_id" \ -d "client_secret=your_client_secret"
- Ensure that the client_secret is kept secure and never shared publicly.
- The access token is valid for a limited time (3600 seconds by default) and should be refreshed before it expires.
Refresh an Access Token
Aktualisiere einen abgelaufenen Zugriffstoken, um eine erneute Authentifizierung zu vermeiden.
Refresh Token Endpoint
Validate User Authentication
Verifiziere die Authentifizierung eines Nutzers, um eine korrekte Anmeldung sicherzustellen.
User Validation Endpoint
Retrieve User Information
Greife auf die Benutzerinformationen zu, um Details zu einem autorisierten Nutzer abzurufen.
User Information Endpoint