curl --request POST \
--url https://dashboard.launchpointhq.com/api/v1/posts/{id}/ad-code-request \
--header 'x-api-key: <api-key>'import requests
url = "https://dashboard.launchpointhq.com/api/v1/posts/{id}/ad-code-request"
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
fetch('https://dashboard.launchpointhq.com/api/v1/posts/{id}/ad-code-request', 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://dashboard.launchpointhq.com/api/v1/posts/{id}/ad-code-request",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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://dashboard.launchpointhq.com/api/v1/posts/{id}/ad-code-request"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://dashboard.launchpointhq.com/api/v1/posts/{id}/ad-code-request")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://dashboard.launchpointhq.com/api/v1/posts/{id}/ad-code-request")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "bde652e1-6784-45ac-9245-a636bc444c23",
"adCodeState": "waiting",
"requestOpened": true
}Request a post's ad code
Ask the creator for one post’s ad code (a TikTok Spark code or a Meta partnership code), as the portal’s Request code does. The request is saved and the creator is told in the app. The creator can submit the code or decline. Nothing is sent to TikTok or Meta.
The request is made only when the post owes no code: adCodeState is not_requested (never asked) or declined (the creator said no). In every other state the call changes nothing, so repeating it is safe. A post whose campaign already requires codes, or that already has a code, is left as it is.
The answer gives the post’s adCodeState after the call and requestOpened, which is true only when this call opened the request. Read the code later from adCode on /posts/{id}.
adCodeState values: ready (code checked against your ad account), not_verified (code collected without a check), waiting (owed by the creator), rejected, expired, brand_setup_required (connect your ad account first), not_requested, declined.
curl --request POST \
--url https://dashboard.launchpointhq.com/api/v1/posts/{id}/ad-code-request \
--header 'x-api-key: <api-key>'import requests
url = "https://dashboard.launchpointhq.com/api/v1/posts/{id}/ad-code-request"
headers = {"x-api-key": "<api-key>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {'x-api-key': '<api-key>'}};
fetch('https://dashboard.launchpointhq.com/api/v1/posts/{id}/ad-code-request', 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://dashboard.launchpointhq.com/api/v1/posts/{id}/ad-code-request",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$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://dashboard.launchpointhq.com/api/v1/posts/{id}/ad-code-request"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://dashboard.launchpointhq.com/api/v1/posts/{id}/ad-code-request")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://dashboard.launchpointhq.com/api/v1/posts/{id}/ad-code-request")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"id": "bde652e1-6784-45ac-9245-a636bc444c23",
"adCodeState": "waiting",
"requestOpened": true
}Query Parameters
Response
The post's code state after the call