Get campaign and stats
curl --request GET \
--url https://app.targeter.tech/api/campaign \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.targeter.tech/api/campaign"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.targeter.tech/api/campaign', 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.targeter.tech/api/campaign",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.targeter.tech/api/campaign"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.targeter.tech/api/campaign")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.targeter.tech/api/campaign")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"campaign": {
"id": "AbC123xyz",
"name": "Majorstuenveien 14",
"reference_id": "CLIENT-PROP-123456",
"destination_url": "https://client-website.no/property/123",
"status": "active"
},
"stats": {
"impressions": 12500,
"clicks": 340,
"cpm": 120,
"cpc": 4.41,
"ctr": 0.0272,
"reach": 8200,
"frequency": 1.52,
"conversion": 28,
"cost_per_conversion": 53.57,
"video_views": {
"p25": 5469,
"p50": 4031,
"p75": 2472,
"p100": 1031
},
"from_date": "2025-01-01",
"to_date": "2025-01-31"
},
"href": "https://app.targeter.tech/campaigns/AbC123xyz"
}{
"error": "Missing required field",
"details": [
{
"message": "Reference ID is required",
"path": [
"source",
"reference_id"
]
}
]
}{
"error": "Campaign not found"
}{
"error": "Missing required field",
"details": [
{
"message": "Reference ID is required",
"path": [
"source",
"reference_id"
]
}
]
}Campaigns
Get campaign
Fetch a campaign, its performance stats, and app link
GET
/
campaign
Get campaign and stats
curl --request GET \
--url https://app.targeter.tech/api/campaign \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.targeter.tech/api/campaign"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.targeter.tech/api/campaign', 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.targeter.tech/api/campaign",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.targeter.tech/api/campaign"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.targeter.tech/api/campaign")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.targeter.tech/api/campaign")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"campaign": {
"id": "AbC123xyz",
"name": "Majorstuenveien 14",
"reference_id": "CLIENT-PROP-123456",
"destination_url": "https://client-website.no/property/123",
"status": "active"
},
"stats": {
"impressions": 12500,
"clicks": 340,
"cpm": 120,
"cpc": 4.41,
"ctr": 0.0272,
"reach": 8200,
"frequency": 1.52,
"conversion": 28,
"cost_per_conversion": 53.57,
"video_views": {
"p25": 5469,
"p50": 4031,
"p75": 2472,
"p100": 1031
},
"from_date": "2025-01-01",
"to_date": "2025-01-31"
},
"href": "https://app.targeter.tech/campaigns/AbC123xyz"
}{
"error": "Missing required field",
"details": [
{
"message": "Reference ID is required",
"path": [
"source",
"reference_id"
]
}
]
}{
"error": "Campaign not found"
}{
"error": "Missing required field",
"details": [
{
"message": "Reference ID is required",
"path": [
"source",
"reference_id"
]
}
]
}Overview
Returns the campaign, its performance stats, and anhref to the campaign in the Targeter app. Requires a valid Bearer token from POST /auth/token.
Use the campaign_id returned from POST /campaign as the query parameter.
Request
Headers
Authorization: Bearer {jwt_token}(required — obtained using your issued partner credentials)
Query Parameters
string
required
Campaign id returned from
POST /campaignExample Request
curl "https://app.targeter.tech/api/campaign?id=AbC123xyz" \
-H "Authorization: Bearer YOUR_JWT_TOKEN"
Response
Success (200)
object
Campaign details including
id, name, reference_id, destination_url, and status (draft, setup,
setup_failed, ready, scheduled, active, paused, or completed)object
Performance metrics including
impressions, clicks, cpm, cpc, ctr, reach, frequency, conversion,
cost_per_conversion, video_views, from_date, and to_datestring (uri)
URL to the campaign in the Targeter app
{
"campaign": {
"id": "AbC123xyz",
"name": "Majorstuenveien 14",
"reference_id": "CLIENT-PROP-123456",
"destination_url": "https://client-website.no/property/123",
"status": "active"
},
"stats": {
"impressions": 12500,
"clicks": 340,
"cpm": 120.0,
"cpc": 4.41,
"ctr": 0.0272,
"reach": 8200,
"frequency": 1.52,
"conversion": 28,
"cost_per_conversion": 53.57,
"video_views": {
"p25": 5469,
"p50": 4031,
"p75": 2472,
"p100": 1031
},
"from_date": "2025-01-01",
"to_date": "2025-01-31"
},
"href": "https://app.targeter.tech/campaigns/AbC123xyz"
}
Error Responses
401 - Unauthorized
MissingAuthorization header, or invalid or expired token.
{
"error": "Missing or invalid Authorization header"
}
{
"error": "Invalid or expired token"
}
404 - Campaign not found
{
"error": "Campaign not found"
}
500 - Server Error
{
"error": "Unexpected server error. Please try again later."
}
Authorizations
Use Authorization: Bearer <token>. Obtain the token from POST /auth/token.
Query Parameters
Campaign id returned from POST /campaign