Zympler.

Authentication

Getting access tokens for your service account.

Use Obtain an oauth token (POST /oauth/token) to exchange your service account's client ID and secret for an access token and a refresh token, and then once the access token is about to expire, use Obtain an oauth token (POST /oauth/token) with the refresh token to get a new access token and refresh token. See Authentication for the full flow.

Obtain an oauth token

POST /oauth/token

Exchange client credentials or refresh token for an access token.

Supports three methods:

  1. Client credentials via HTTP Basic Auth (Authorization header) with grant_type=client_credentials in body.
  2. Client credentials in form-urlencoded request body with grant_type=client_credentials.
  3. Refresh token in form-urlencoded request body with grant_type=refresh_token.

curl

curl -X POST "https://api.zympler.com/v1beta/oauth/token" \
  -u "$ZYMPLER_CLIENT_ID:$ZYMPLER_CLIENT_SECRET" \
  -d 'grant_type=client_credentials'

Rust

let response = reqwest::Client::new()
    .post("https://api.zympler.com/v1beta/oauth/token")
    .basic_auth(&client_id, Some(&client_secret))
    .form(&[("grant_type", "client_credentials")])
    .send()
    .await?
    .error_for_status()?;
let body: serde_json::Value = response.json().await?;

Python

response = requests.post(
    "https://api.zympler.com/v1beta/oauth/token",
    auth=(client_id, client_secret),
    data={
        "grant_type": "client_credentials",
    },
    timeout=30,
)
response.raise_for_status()
data = response.json()
Request body

application/x-www-form-urlencoded (required)

One of: ClientCredentialsGrantBody

FieldTypeRequiredDescription
grant_typestring: client_credentialsyes
client_idstringyes
client_secretstring (password)yes

Or: RefreshTokenGrantBody

FieldTypeRequiredDescription
grant_typestring: refresh_tokenyes
refresh_tokenstring (password)yes

Or: GrantTypeBody

FieldTypeRequiredDescription
grant_typestring: client_credentialsyes
Responses

Fields

FieldTypeRequiredDescription
access_tokenstringyesBearer token to be used as authentication for other API calls
token_typestring: Beareryes
expires_ininteger (uint64)yesNumber of seconds until the token expires
refresh_tokenstringyesRefresh token to get a new access_token when this one expires

Status codes

StatusDescription
200Ok
400Bad Request
401Unauthorized
Search