Authentication
Authentication with the Leadfox API is made using a JWT token. You can obtain your token by authenticating using an apikey & secret combination.
Generate an API key and Secret
Open the application at the API page, then proceed by generating a new apikey & secret if none exists. The DNS domain name is irrelevant in this context and can be ignored. For example, you can use your current website domain or leadfox.co if you want to create an new independent key for security.
An apikey is Client scoped and shared by all users of the Client.
A secret is user scoped and is used to impersonate you as if you were the one executing an action.
It means that you will be limited by your own Role in the Client.
Generating a new secret will revoke the previous one with no way to revert.
This means that any automated script using this secret will stop working.
Generate your JWT token
To generate your JWT token, make a POST request to the /v1/auth/ endpoint with your apikey & secret in the request body as JSON.
- cURL
curl \
--location 'https://rest.leadfox.co/v1/auth/' \
--header 'Content-Type: application/json' \
--data '{
"apikey": "...",
"secret": "..."
}'
{
"jwt": "ey...",
"mode": "apikey",
"client": "My Client Name",
"clientid": "..."
}
Use your JWT token
Once you have obtained your JWT token, you can use it to authenticate your requests to the Leadfox API by including it in the Authorization header like so:
- cURL
curl \
--location 'https://rest.leadfox.co/v1/contact/' \
--header 'Authorization: JWT <token>'
[
{
"_id": "string",
"email": "string",
// ...
},
// ...
]
Make sure to have a space between JWT and your actual token in the Authorization header.