HTTP quickstart
Create an API key and read one page of campaigns. The request starts no paid research.
This quickstart sends one read request to the Signal HTTP API. The request starts no run and uses no credits.
Create an API key
Open Settings > API keys in the dashboard and create an API key. Copy the key at once: the dashboard shows it one time only. The key starts with sk-. Use a key with effective campaign.read access for this quickstart. The key's assigned access is limited by your current product permissions. Read Permissions. Keep the key on your server or on your local machine. Do not put the key in browser code.
Set the environment variables
Set two environment variables. Every request sample in this documentation reads them.
| Variable | Value |
|---|---|
LINKT_API_URL | The origin of your API environment, with no path. Production uses https://api.signal.linkt.ai. Shared staging uses https://api.sandbox.signal.linkt.ai with staging API keys. Every sample adds /v2. |
LINKT_API_KEY | Your API key. |
| Environment | API origin | API key settings |
|---|---|---|
| Production | https://api.signal.linkt.ai | Production keys |
| Staging | https://api.sandbox.signal.linkt.ai | Staging keys |
A key works only in the environment that issued it.
Read the key from a secret store. Do not write the key in a file that you commit.
A sample with an ID in the path also reads a variable, for example CAMPAIGN_ID, ACCOUNT_ID, RUN_ID or SIGNAL_ID. Each guide tells you when to set it, from an earlier response. Samples also read these variables for IDs in request bodies and query filters. Install jq to run cURL samples that build a JSON body.
List campaigns
Send this request. It reads at most five campaigns.
curl --fail-with-body --request GET "$LINKT_API_URL/v2/campaigns?limit=5" \
--header "x-api-key: $LINKT_API_KEY"The response has the status 200. A new organization has no campaigns, so data can be an empty list. When LINKT_API_URL ends in /v2, the request goes to /v2/v2/campaigns and gives 404. Remove the path from the variable.
Read the cursor
Every list response has the same shape:
A campaign object has more fields than this sample shows. next_cursor is null on the last page. When next_cursor has a value, send it as the cursor query parameter to read the next page. Keep the same filters and limit.
Continue
Follow First campaign, run and monitor for a complete workflow. To create a campaign without research, follow Create a campaign.