Here is how you can get started working with the Fletch Developer APIs.
The API is accessible through the api.fletch.ai domain.
This is a JSON API.
Hence you will need to issue your requests including the Content-Type: application/json
header when not already implicit.
All the APIs require authentication with an API token.
You can obtain a token for (one of) your account(s) by reaching out to us at [[email protected]](mailto:[email protected]?subject=API%20token%20request&body=Hello%20Fletch%20Team%2C%0A%0AI%20would%20like%20request%20the%20creation%20of%20an%20API%20token%20for%20my%20account%20(%3CUPDATE%20ME%3E.beta.fletch.ai).%0A%0AThank%20you%2C%0A%3CYour%20name%3E).
<aside> 💡
Currently, all API tokens are bound to one, and only one, Fletch account.
</aside>
API tokens have an associated expiration: typically 1 year from when they are created. This means, you will need to keep track of the expiration and let our team know when you need a new token.
If you need your API token to be invalidated / disabled at any time, our team can take this action on your behalf; please let us know.
We plan to build a way to self-serve managing API tokens in the near future.
To authenticate with API using a token, you can include it in your requests using the Authorization
header. Here is a example with curl:
curl -sX GET \\
-H 'Authorization: Bearer <token>' \\
-H 'Content-Type: application/json' \\
<https://api.fletch.ai/feed>
Or Python:
import requests
import json
r = requests.get("<https://api.fletch.ai/feed>",
headers={"Authorization": "Bearer <token>"})
with open("results.json", "w") as f:
json.dump(r.json(), f)