Instructions on how to use API

Basic information

What is ApiClient(Tenant)

Each API client has the same data, a copy of what is stored in public db schema. After your registration, we create a new database schema -> <your_email_before_@_random_6_digit_string>. Then we apply migrations and copy data from the public schema. In the end, you have complete copy of the public DB (except for users(exception is you)). You can do whatever you want with it, others API clients won't be affected by that.

Login into admin panel

To log in to the admin panel follow link in navigation bar. There will be a form, pick your client and enter your info which you used during registration. Note: if you just created an account, it will take 5-10min for it to complete set up. So you can spend time reading these docs.

There you will find UI to manipulate all data in your DB(you have full access).

Using API via OpenAPI docs

If you click Open OpenAPI you will be moved to API documentation specs. To not authenticate each time, you can first log into the admin, and then return to spec(refresh page to be sure).

Pointing you API to your database

To make the backend understand which database to use, you need to pass your API key in the header like this Api-Key:<your-api-key>. API key is located in the dropdown on the top right.

API Information

Auth

For authentication, we're using jwt tokens. Access token lifetime is five minutes and Refresh is one day.

Response codes

  • 200 - Everything is ok.
  • 201 - Everything is ok, usually is returned when you are creating an object.
  • 400 - That data you submitted is not valid. Note: while in all responses all fields are always returned, in this case, only fields with errors are returned.
  • 401 - Authentication header wasn't found or the active token is expired.
  • 403 - You have no permissions to perform an action. Note: public schema is read-only.
  • 404 - The object you were looking for is not found.
  • 500 - Not your fault. But you need to inform backend developers about it, because it shouldn't be happening.
  • 502 - Timeout, request took more than 60 seconds. Ping backend developers to investigate it.
  • 503 - Issue on DevOps side, ping devops-help to investigate.