When making requests to the Formitize API, your API token must be included in the Authorization header to authenticate your integration.
Send the token in the Authorization header
Add an Authorization header to every request. Its value is the word Bearer (with a capital B), followed by a space and your token:
Authorization: Bearer 1234-3f2b8c1e-9a4d-4e7b-b6c2-0d5e8f1a2b3c
Send the token exactly as it was provided. Do not encode it or add quotes to the header value. In your integration, don't paste your real token into the code. Store it separately, in an environment variable or secrets store, and have your code read it from there.
Example: cURL
List the first page of Clients:
curl -H "Authorization: Bearer 1234-3f2b8c1e-9a4d-4e7b-b6c2-0d5e8f1a2b3c" "https://service.formitize.com/api/rest/v2/crm/client/list/?page=1"On Windows, type curl.exe instead of curl.
Example: JavaScript
Run this example on a server or within a script using Node.js 18 or later. Avoid running it in a web page, as browser-based code is publicly accessible and may expose your API token.
async function listClients() {
const response = await fetch("https://service.formitize.com/api/rest/v2/crm/client/list/?page=1", {
headers: {
Authorization: "Bearer 1234-3f2b8c1e-9a4d-4e7b-b6c2-0d5e8f1a2b3c",
},
});
const body = await response.json();
if (!response.ok || body.payload?.error) {
throw new Error(body.payload?.error?.message ?? `Request failed with HTTP ${response.status}`);
}
return body.payload; // the list of clients
}
listClients().then(console.log, console.error);The API returns its response data within a payload property.
If your tool only supports Basic authentication
Some tools, such as Power BI and certain no-code platforms, may not allow you to set a Bearer header. In these tools, select Basic authentication and enter the following details:
| Field | Value |
|---|---|
| Username | Your API token, e.g. 1234-3f2b8c1e-9a4d-4e7b-b6c2-0d5e8f1a2b3c |
| Password | x (a lowercase letter x) |
Your tool will encode these details for you. If you are building the header yourself, Base64-encode the token, followed by a colon and x:
1234-3f2b8c1e-9a4d-4e7b-b6c2-0d5e8f1a2b3c:xThis gives the following header:
Authorization: Basic MTIzNC0zZjJiOGMxZS05YTRkLTRlN2ItYjZjMi0wZDVlOGYxYTJiM2M6eA==