Create an API Token
Unblocked supports two types of API tokens for authentication:- Personal Access Token
- Team Access Token
Personal Access Tokens are scoped to your individual account and are ideal for personal automation, testing, and development workflows.
Personal Access Tokens have a limit of 1,000 API calls per day.
1
Create the API Token
In the Unblocked web app, click on Settings —> API Tokens.In the Personal API Tokens section, click on Create Token.![Personal Token[]](https://mintcdn.com/unblocked/GOUKpQ80cNM-eQYm/img/personal-token-1.png?fit=max&auto=format&n=GOUKpQ80cNM-eQYm&q=85&s=2f8370f6a500750697cebbc6cc13a5ff)
![Personal Token[]](https://mintcdn.com/unblocked/GOUKpQ80cNM-eQYm/img/personal-token-1.png?fit=max&auto=format&n=GOUKpQ80cNM-eQYm&q=85&s=2f8370f6a500750697cebbc6cc13a5ff)
2
Configure the API Token
Fill out the token name. You can also limit the data sources that the token will have access to in the list under Data Sources.![Personal Token[]](https://mintcdn.com/unblocked/GOUKpQ80cNM-eQYm/img/personal-token-2.png?fit=max&auto=format&n=GOUKpQ80cNM-eQYm&q=85&s=ccaead6818c7c04278e9285082a76b3d)
![Personal Token[]](https://mintcdn.com/unblocked/GOUKpQ80cNM-eQYm/img/personal-token-2.png?fit=max&auto=format&n=GOUKpQ80cNM-eQYm&q=85&s=ccaead6818c7c04278e9285082a76b3d)
3
Copy the API Token
Copy the resulting API token.![Personal Token[]](https://mintcdn.com/unblocked/GOUKpQ80cNM-eQYm/img/personal-token-3.png?fit=max&auto=format&n=GOUKpQ80cNM-eQYm&q=85&s=8ae7b033588bccf513409ad3f6254c6d)
![Personal Token[]](https://mintcdn.com/unblocked/GOUKpQ80cNM-eQYm/img/personal-token-3.png?fit=max&auto=format&n=GOUKpQ80cNM-eQYm&q=85&s=8ae7b033588bccf513409ad3f6254c6d)
All tokens should be provided with each request to the Unblocked API using the
Authorization: Bearer <token> header to authenticate the request.Create a Collection
Next, create a collection. A collection in Unblocked is a group of related documents from various data sources, such as customer support tools, knowledge bases, and internal wikis. Multiple collections can be created to manage documents from different sources.Add a Document
Finally, add a document to the collection using the collection’s ID. In addition to the collection ID, provide a title, a body (in plain text or Markdown), and a URI for the document. A document is uniquely identified by its URI. The URI will be used to link to the source of a reference in an answer.Get Answers
The Answers API allows you to programmatically ask questions about your codebase and receive answers from Unblocked. The API uses an asynchronous pattern where you submit a question and then poll for the response. Responses are in Markdown format.The Answers API is currently limited to 1000 questions per day per organization.
Submit a Question
First, submit your question using a uniquequestionId (must be a globally unique UUID):
204 No Content status, indicating the question has been queued for processing.
Poll for the Answer
Use the samequestionId to poll for the answer:
![Team Token[]](https://mintcdn.com/unblocked/UPT9O22gsEWNRiDD/img/team-token-1.png?fit=max&auto=format&n=UPT9O22gsEWNRiDD&q=85&s=6750d421f417fadac3731603312fc871)
![Team Token[]](https://mintcdn.com/unblocked/WrAe_ZzBHh_yDkhV/img/team-token-2.png?fit=max&auto=format&n=WrAe_ZzBHh_yDkhV&q=85&s=b67bd2f1736f215edc53401852eba6e8)
![Team Token[]](https://mintcdn.com/unblocked/WrAe_ZzBHh_yDkhV/img/team-token-3.png?fit=max&auto=format&n=WrAe_ZzBHh_yDkhV&q=85&s=8553ab50e62f41cc68f7d0b6ab9d59d5)