This article describe how to control your mailboxes via its native REST HTTPS API
Parseur API Authentication
Parseur API uses a token-based authentication.
You will find your API Token Key in your Account Overview .
For clients to authenticate, the token key should be included in the Authorization HTTP header. The key should be prefixed by the string literal "Token", with white space separating the two strings. For example:
Authorization: Token 1234d45678c90bcf1234fe123ddae4aabbc6abcd
Unauthenticated responses that are denied permission will result in an HTTP 403 Unauthorized response with an appropriate WWW-Authenticate header. For example:
The curl command line tool may be useful for testing token authenticated APIs. For example:
curl -X GET https://api.parseur.com/ -H "Authorization: Token <enter-your-token-here>"
As per standard REST protocol:
- You can list your mailboxes with a GET request on /parser
- You can create a mailbox with a POST request on /parser passing the following keys: name, email_prefix (optional, if not present, will be derived from name key).
- You can retrieve a mailbox with a GET request on /parser/:mailbox_id
- You can update a mailbox with a PUT or POST request on /parser/:mailbox_id
- You can copy (duplicate) an existing mailbox with a POST on /parser/:mailbox_id/copy
Manage Documents in a mailbox
- To send a document via API, check out this article
- You can list your documents in a given mailbox with a GET request on /parser/:mailbox_id/document_set
- You can retrieve a document and parsed result with a GET request on /document/:document_i
- You can copy a document with a POST on /document/:document_id/copy/:target_mailbox_id
Manage Templates in a mailbox
- You can list your templates in a given mailbox with a GET request on /parser/:mailbox_id/template_set
- You can copy a template with a POST on /template/:template_id/copy/:target_mailbox_id
Manage Webhooks in a mailbox
- You can list your webhooks in a given mailbox with a GET request on /parser/:mailbox_id: all enabled webhooks are under the "webhook_set" key and all paused webhooks are under the "available_webhook_set" key.
- You can create a new webhook with a POST request on /webhook passing the following keys: event (e.g. "document.processed"), target (e.g. "https://api.example.com/parseur"), category (must be "CUSTOM"), name (optional), headers (dictionary, optional), parser_field_set (array of table field ids, only if triggering events on specific tables fields).
- You can enable an existing webhook for a given mailbox with a POST request on /parser/:mailbox_id/webhook_set/:webhook_id
- You can pause an existing webhook for a given mailbox with a DELETE request on /parser/:mailbox_id/webhook_set/:webhook_id
Manage parsed data
- Parseur can send parsed data in real time to your server via its Webhook feature. Check out this article about using webhooks with Parseur.
All GET request that returns a list of documents, templates and mailboxes support the pagination by appending a page option to the URL
For example: /parser?page=12
Do more with the API
This article just lists the most common use cases of using out API. There is much more you can do, feel free to ask us for more details!