Skip to content
bynhDocs

Make your first API call

Read your certificates with a token, handle errors and rate limits, and find the endpoint you need.

1 min readUpdated

Before you start

  • A token from Create an API token
  • Your workspace’s address, the dokan in app.bynh.io/trust/dokan

List your certificates

Every call goes to https://api.bynh.io/api/v1/workspaces/{workspace}/… with your token as a bearer token.

curl https://api.bynh.io/api/v1/workspaces/dokan/certificates \
  -H "Authorization: Bearer $BYNH_TOKEN" \
  -H "Accept: application/json"

Responses wrap their payload in data. Ids are numbers, dates are YYYY-MM-DD and times are ISO 8601 in UTC. Messages come back in your own language, English or Arabic, as set in the app.

When something goes wrong

Errors are JSON with a message that says how to fix it. A 422 also has errors, with the messages for each field. A 403 means the token is read-only, your role can’t do it, or editing is paused on the workspace. See Errors.

Stay within the limits

You can make 120 requests a minute, shared by all your tokens and your browser. Some actions have their own, lower limit, such as 20 uploads a minute. When you go over, you get a 429; wait and try again. See Rate limits.

Find the right endpoint

The API reference lists every endpoint a token can call, with the role it needs, its parameters, a sample response and examples in curl, JavaScript and PHP.

Was this helpful?

Edit this page on GitHub