Преминавате от Airtable? Получете безплатна помощ за преминаването от нашия екип. Започнете →

Използвайте REST API и API токени

Обновено

An API token is a key that lets another program work with your Artavolo data: your website, your warehouse system or a script someone writes for you. You make the key in Artavolo, choose which bases it may open, and give it to the program. The program can then read, add, change and delete records, just as you could on screen.

The API tokens window with a new token in a green box, the note Your new token. Copy it now: it is shown only this once, a copy button and Done, and below it the token Warehouse app for the workspace Linden Bakery

Make a token

  1. Click the round button with your initial or photo at the top right and choose Моят профил.
  2. Scroll down to API токени and click Manage tokens.

The API Tokens part of the My Account page with the Manage tokens button

  1. In the API tokens window, click Създай токен.
  2. Under Заглавие, type a name that says which program will use it, for example Warehouse app. Under Работно пространство, choose the workspace that holds your bases. Click Запази.

The API tokens window with Add new token: the title Warehouse app, the workspace Linden Bakery, and the Close and Save buttons

  1. The token appears in a green box. Click the copy button beside it and paste it into the other program, or somewhere safe. Then click Готово.

The token is shown only this once. Artavolo keeps only a fingerprint of it, so nobody can read it back later, not even us. Lost it? Make a new one (see below).

Choose the bases a token may open

A new token reaches every base in its workspace. To limit it:

  1. In the API tokens window, click the blue pencil on the token.
  2. Each base has its own Enable switch. Switch off every base the program does not need. The Enable switch at the top, beside the token's name, turns the whole token off.
  3. Натиснете Запиши.

The token Warehouse app opened for editing: an Enable switch for the whole token, an Enable switch for the base Bakery orders, and the Cancel and Save buttons

Rename, replace or remove a token

Click the small arrow beside the token's name. The menu shows the first characters of the token, so you can tell tokens apart, and three choices:

  • Преименувай lets you type a new name.
  • Генерирай нов токен makes a new value and shows it once. The old value stops working at once.
  • Премахни deletes the token. Programs that use it are refused from then on.

The menu beside the token Warehouse app: the first characters of the token, Rename, Generate new token and Remove

For the developer: call the API

Send the token in an API-KEY header, or use Basic authentication with the account's e-mail address as the user name and the token as the password. Send writes as JSON.

  • The data API has one address per table: /api/v2/bases/{code}/tables/{table}/rows, where {code} is the code in the base's web address. A read returns up to 10,000 records a page (100 if you do not ask for more) and can filter, sort, search and group. One request can create up to 100 records.
  • The API, съвместимо с Airtable answers Airtable's own addresses under /v0, so scripts written for Airtable keep working.

A change made through the API counts as a change made on screen by you: the base's rules on who may add, change and delete apply, it appears in the base's history and audit log, it starts the table's automations and webhooks, and a deleted record goes to the table's trash for 30 days.

Добре е да знаете

  • A token can do only what you can do. If you may only read a base, so may the token. When you leave a workspace, your tokens stop working there.
  • Treat a token like a password. Keep it on a server, never in a web page, a phone app or a shared code repository. If it may have leaked, use Генерирай нов токен or Премахни.
  • Give each program its own token, so you can stop one without stopping the others.
  • In our cloud, one token may send 600 requests a minute and a whole workspace 3,000. Above that, the answer is 429 with a Retry-After header saying when to try again. On your own server there is no limit unless an administrator sets one.
  • Formula, lookup, rollup and AI fields can be read through the API but not written. Files are uploaded separately, not written as values.
  • Assistants such as Claude and ChatGPT connect through the AI connector instead. Those connections are listed under Connected assistants in the same window, where Withdraw stops one. An AI connector token is refused by the data API.

Свързани