AffiliatePipe

Partner API / Create a link

Create a link

POST/v1/links

A tracking link for any page on a program's site, tagged with where it is posted.

Parameters

urlstringRequired. A full address on a program's site.
utm_sourcestringWhere the link is posted, for example discord. Expected: without it the response carries a missing_utm_source warning.
utm_mediumstringWhat kind of post, for example social. Expected: without it the response carries a missing_utm_medium warning.
utm_campaignstringOptional, for example race-day.

Returns

The new link, ready to share.

Errors: 401, 422, 429. Counts towards your rate limit.

curl -X POST https://api.affiliatepipe.com/v1/links \
  -H "Authorization: Bearer $AP_KEY" \
  -H "Content-Type: application/json" \
  -d '{"url": "https://greyhoundapi.com/pricing", "utm_source": "discord", "utm_medium": "social"}'
$ch = curl_init('https://api.affiliatepipe.com/v1/links');
curl_setopt_array($ch, [
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('AP_KEY'), 'Content-Type: application/json'],
  CURLOPT_POSTFIELDS => '{"url": "https://greyhoundapi.com/pricing", "utm_source": "discord", "utm_medium": "social"}',
]);
$data = json_decode(curl_exec($ch), true);
import os, requests

r = requests.post(
    "https://api.affiliatepipe.com/v1/links",
    headers={"Authorization": "Bearer " + os.environ["AP_KEY"]},
    json={"url": "https://greyhoundapi.com/pricing", "utm_source": "discord", "utm_medium": "social"},
)
data = r.json()
const r = await fetch("https://api.affiliatepipe.com/v1/links", {
  method: "POST",
  headers: { Authorization: `Bearer ${process.env.AP_KEY}`, "Content-Type": "application/json" },
  body: JSON.stringify({"url": "https://greyhoundapi.com/pricing", "utm_source": "discord", "utm_medium": "social"}),
});
const data = await r.json();
Response, 200
{
  "link": "https://affiliatepipe.com/r/GhnOaC/greyhoundapi.com/pricing?utm_source=discord&utm_medium=social",
  "domain": "greyhoundapi.com",
  "warnings": []
}