Every example uses
$LEKALAO_TOKEN (a Read and write token) and
$LIST, the id of the list. A list’s id is in GET /api/v1/lists.Subscribe one person
201:
id in your own database: it is what names the person in later calls.
What happens, case by case
Addresses are stored in lower case, without surrounding spaces.
Subscribe in a batch
Up to 1,000 people in one call, for a nightly synchronisation for example:
One refused line does not spoil the others. If all of them fail, the code is
422.
Past 100 lines, the batch goes to the background like an import. The answer is 202 with the import to follow:
GET /api/v1/imports/{id} until status is completed or failed. The added, updated and failed counters and the detail of the errors are there.
replace_tags: true replaces each person’s tags with those of their line instead of adding them.
Import a file
For a CSV or Excel file that is already prepared, send it as it is:mapping, columns are recognised from their headers. Imported people are subscribed without a confirmation e-mail, and those who had unsubscribed come back only when resubscribe_unsubscribed is true. See Import and export.
Find someone
GET /api/v1/subscribers/{id} reads one person.
Update
- A field left out, or
null, changes nothing. attributes, when sent, replaces every attribute.tags, when sent, replaces every tag.
Add and remove tags
To add or remove without knowing the other tags:GET /api/v1/lists/{id}/tags and created in advance with POST /api/v1/lists/{id}/tags.