Get Started With Linkfire API
This guide outlines how to set up your Linkfire API account, authenticate, and make your first request to the Linkfire API.
1. Create your Account
To begin with, you need a Linkfire API user. This user type cannot access the Linkfire Suite, as this requires a Linkfire Suite user.
However, API users can programmatically access boards and campaigns made in the Linkfire Suite. Read more about boards and campaigns here.
To sign up for a Linkfire API user as an existing Linkfire Customer, reach out to your Account Manager. If you are a new customer, or a developer who would like to integrate with the Linkfire API, we would love to hear from you.
Linkfire will set up an API board for you and configure basic settings, such as domains, music services, territory settings, and affiliate/retargeting settings (Premium / Enterprise users only).
You can learn more about Linkfire board settings here.
Once onboarded, you will receive an email invitation to your Linkfire API user document.
Please do not hesitate to get in touch with us at [email protected], should you have any questions.
2. Generate your API Client Credentials
Next, you need to get your hands on a set of API Client credentials for you API user. You will find them in your API user document.
You can regenerate your API credentials any time. Contact your Account Manager or write to [email protected].
3. Whitelist your IP(s)
The Linkfire API enforces IP whitelisting for security purposes.
As part of your onboarding process, you must provide one or more IP addresses to whitelist. For example your development, testing, and production environments.
You can whitelist more IPs any time. Contact your Linkfire Account Manager or get in touch Linkfire Support.
4. Authenticate with the Linkfire API
You are now ready to authenticate with the Linkfire API.
Linkfire uses OAuth 2.0 for authentication. Specifically, the Linkfire API supports the OAuth 2.0 client_credential
flow.
When authenticating with the API, you need to specify the public.api
scope in your request body. You do this by making a POST request to the Generate bearer token endpoint, as seen below, which returns your Bearer Token
.
curl --request POST \
--url https://auth.linkfire.com/identity/connect/token \
--header ‘cache-control: no-cache’ \
--header ‘content-type: application/x-www-form-urlencoded’ \
--data ‘grant_type=client_credentials&client_id=YOURID&client_secret=YOURSECRET&scope=public.api’
{
"access_token": "80085L09-2da0-37eb-0266-RickC1379f9b",
"expires_in": 3600,
"token_type": "Bearer"
}
5. Make your First API Call
Once authenticated against the Linkfire API, you can go ahead and make your first API call.
Boards are an essential part of the Linkfire Object Model. They are containers for your campaigns created in Linkfire and store settings. Let us look at how to interact with Boards via the Linkfire API.
As a Linkfire API user, you have access to at least one board per default. You might have access many boards depending on your company's specific setup.
To see the boards you have access to, make a request to the Get boards endpoint.
var request = require("request");
var options = { method: 'GET',
url: 'https://api.linkfire.com/settings/boards',
headers:
{
authorization: 'Bearer 80085L09-2da0-37eb-0266-RickC1379f9b',
'content-type': 'application/json' }};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
{
"data": [
{
"id": "9d4db9f8-f558-49b1-b753-074cf77265ca", //boardID
"parentId": null,
"name": "my-linkfire-board",
"domains": [
"cb54d38b-ec35-4cb3-bdb9-5d6b404ef667",
"c1515328-2a0b-4a4d-92d8-952b8e684476"
],
"images": []
}
],
"transactionId": "33b1245f-4325-4b0b-96b2-4cc7403a45e3"
}
You should now receive a list containing one or more boards with attributes including name, domains, and BoardID.
Great success!
Updated over 7 years ago
You are now ready to build your Linkfire integration. In the next section, we will walk you through how to create your first campaign(s).