curl --request POST \
--url https://app.levanta.io/api/creator/v1/links/cpc/{campaign_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"source_id": "<string>",
"source_sub_id": "<string>",
"source_name": "",
"auto_join": "true"
}
'import requests
url = "https://app.levanta.io/api/creator/v1/links/cpc/{campaign_id}"
payload = {
"source_id": "<string>",
"source_sub_id": "<string>",
"source_name": "",
"auto_join": "true"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
source_id: '<string>',
source_sub_id: '<string>',
source_name: '',
auto_join: 'true'
})
};
fetch('https://app.levanta.io/api/creator/v1/links/cpc/{campaign_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.levanta.io/api/creator/v1/links/cpc/{campaign_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'source_id' => '<string>',
'source_sub_id' => '<string>',
'source_name' => '',
'auto_join' => 'true'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.levanta.io/api/creator/v1/links/cpc/{campaign_id}"
payload := strings.NewReader("{\n \"source_id\": \"<string>\",\n \"source_sub_id\": \"<string>\",\n \"source_name\": \"\",\n \"auto_join\": \"true\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.levanta.io/api/creator/v1/links/cpc/{campaign_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"source_id\": \"<string>\",\n \"source_sub_id\": \"<string>\",\n \"source_name\": \"\",\n \"auto_join\": \"true\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.levanta.io/api/creator/v1/links/cpc/{campaign_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"source_id\": \"<string>\",\n \"source_sub_id\": \"<string>\",\n \"source_name\": \"\",\n \"auto_join\": \"true\"\n}"
response = http.request(request)
puts response.read_body{
"asin": "<string>",
"id": "<string>",
"sourceId": "<string>",
"sourceSubId": "<string>",
"sourceName": "<string>",
"url": "<string>",
"mobileOptimizedUrl": "<string>",
"active": true,
"type": "product",
"marketplace": "amazon.com",
"cpcCampaignId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"status": 401,
"message": "Unauthorized"
}{
"status": 403,
"message": "You do not have access to CPC APIs"
}{
"status": 404,
"message": "CPC Campaign or Link Not Found"
}{
"status": 415,
"message": "Invalid Content Type: Must be \"application/json\" for post requests"
}{
"status": 422,
"message": "Input Validation Failed"
}Create CPC Link
Create a link for a CPC campaign
curl --request POST \
--url https://app.levanta.io/api/creator/v1/links/cpc/{campaign_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"source_id": "<string>",
"source_sub_id": "<string>",
"source_name": "",
"auto_join": "true"
}
'import requests
url = "https://app.levanta.io/api/creator/v1/links/cpc/{campaign_id}"
payload = {
"source_id": "<string>",
"source_sub_id": "<string>",
"source_name": "",
"auto_join": "true"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
source_id: '<string>',
source_sub_id: '<string>',
source_name: '',
auto_join: 'true'
})
};
fetch('https://app.levanta.io/api/creator/v1/links/cpc/{campaign_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.levanta.io/api/creator/v1/links/cpc/{campaign_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'source_id' => '<string>',
'source_sub_id' => '<string>',
'source_name' => '',
'auto_join' => 'true'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.levanta.io/api/creator/v1/links/cpc/{campaign_id}"
payload := strings.NewReader("{\n \"source_id\": \"<string>\",\n \"source_sub_id\": \"<string>\",\n \"source_name\": \"\",\n \"auto_join\": \"true\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://app.levanta.io/api/creator/v1/links/cpc/{campaign_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"source_id\": \"<string>\",\n \"source_sub_id\": \"<string>\",\n \"source_name\": \"\",\n \"auto_join\": \"true\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.levanta.io/api/creator/v1/links/cpc/{campaign_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"source_id\": \"<string>\",\n \"source_sub_id\": \"<string>\",\n \"source_name\": \"\",\n \"auto_join\": \"true\"\n}"
response = http.request(request)
puts response.read_body{
"asin": "<string>",
"id": "<string>",
"sourceId": "<string>",
"sourceSubId": "<string>",
"sourceName": "<string>",
"url": "<string>",
"mobileOptimizedUrl": "<string>",
"active": true,
"type": "product",
"marketplace": "amazon.com",
"cpcCampaignId": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}{
"status": 401,
"message": "Unauthorized"
}{
"status": 403,
"message": "You do not have access to CPC APIs"
}{
"status": 404,
"message": "CPC Campaign or Link Not Found"
}{
"status": 415,
"message": "Invalid Content Type: Must be \"application/json\" for post requests"
}{
"status": 422,
"message": "Input Validation Failed"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
An ID that identifies where the created link will be used. Allowed characters: [a-zA-Z0-9-_@./ ]
1 - 256^[a-zA-Z0-9-_@./ ]*$An ID that identifies where the created link will be used. Allowed characters: [a-zA-Z0-9-_@./ ]
1 - 256^[a-zA-Z0-9-_@./ ]*$Display name for the source within Levanta
250Whether or not to join the campaign if not yet joined
true, false Response
Success
Amazon Standard Identifier (ASIN) for an Amazon product. Example: B09G9FPHY6
An ID that identifies where the created link will be used. Allowed characters: [a-zA-Z0-9-_@./ ]
An ID to further identify the link underneath the source_id namespace. Allowed characters: [a-zA-Z0-9-_@./ ]
Display name for the source within Levanta
Whether or not the link is active. Inactive links do not earn commissions.
The type of the link. Product links are for amazon asin pages. Storefront links are for amazon storefront pages.
product, storefront The marketplace the link is associated with
amazon.com, amazon.co.uk, amazon.com.mx, amazon.ca, amazon.de, amazon.es, amazon.fr, amazon.it, amazon.nl The ID of the CPC campaign for the link