Refresh a connected ad account
curl --request POST \
--url https://app.flextell.ai/api/v1/tiktok-lead-ads/advertisers/{id}/refresh \
--header 'Authorization: Bearer <token>' \
--header 'X-Tenant: <x-tenant>'import requests
url = "https://app.flextell.ai/api/v1/tiktok-lead-ads/advertisers/{id}/refresh"
headers = {
"X-Tenant": "<x-tenant>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Tenant': '<x-tenant>', Authorization: 'Bearer <token>'}
};
fetch('https://app.flextell.ai/api/v1/tiktok-lead-ads/advertisers/{id}/refresh', 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.flextell.ai/api/v1/tiktok-lead-ads/advertisers/{id}/refresh",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"X-Tenant: <x-tenant>"
],
]);
$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.flextell.ai/api/v1/tiktok-lead-ads/advertisers/{id}/refresh"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-Tenant", "<x-tenant>")
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.post("https://app.flextell.ai/api/v1/tiktok-lead-ads/advertisers/{id}/refresh")
.header("X-Tenant", "<x-tenant>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.flextell.ai/api/v1/tiktok-lead-ads/advertisers/{id}/refresh")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Tenant"] = '<x-tenant>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": "<string>",
"data": {
"id": 123,
"advertiser_id": "<string>",
"name": "<string>",
"status": "<string>",
"error_message": "<string>",
"auto_enable_new_forms": true,
"settings": {},
"connected_by": {
"id": 123,
"name": "<string>"
},
"forms_count": 123,
"enabled_forms_count": 123,
"subscribed_at": "2023-11-07T05:31:56Z",
"connected_at": "2023-11-07T05:31:56Z",
"last_lead_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"success": true,
"error_code": "RESOURCE_NOT_FOUND",
"message": "<string>",
"errors": null,
"data": null
}{
"message": "<string>",
"errors": {}
}{
"success": false,
"error_code": "SETUP_REQUIRED",
"message": "Complete the required setup steps to continue.",
"data": {
"next_step": "clinic_info"
}
}TikTokLeadAds
Refresh a connected ad account
Checks the ad account’s lead subscription with TikTok (subscribing again when TikTok dropped it) and
reads its forms, adding new ones. An ad account TikTok no longer accepts comes back needs_reconnect.
POST
/
v1
/
tiktok-lead-ads
/
advertisers
/
{id}
/
refresh
Refresh a connected ad account
curl --request POST \
--url https://app.flextell.ai/api/v1/tiktok-lead-ads/advertisers/{id}/refresh \
--header 'Authorization: Bearer <token>' \
--header 'X-Tenant: <x-tenant>'import requests
url = "https://app.flextell.ai/api/v1/tiktok-lead-ads/advertisers/{id}/refresh"
headers = {
"X-Tenant": "<x-tenant>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-Tenant': '<x-tenant>', Authorization: 'Bearer <token>'}
};
fetch('https://app.flextell.ai/api/v1/tiktok-lead-ads/advertisers/{id}/refresh', 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.flextell.ai/api/v1/tiktok-lead-ads/advertisers/{id}/refresh",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"X-Tenant: <x-tenant>"
],
]);
$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.flextell.ai/api/v1/tiktok-lead-ads/advertisers/{id}/refresh"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("X-Tenant", "<x-tenant>")
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.post("https://app.flextell.ai/api/v1/tiktok-lead-ads/advertisers/{id}/refresh")
.header("X-Tenant", "<x-tenant>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.flextell.ai/api/v1/tiktok-lead-ads/advertisers/{id}/refresh")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-Tenant"] = '<x-tenant>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": "<string>",
"data": {
"id": 123,
"advertiser_id": "<string>",
"name": "<string>",
"status": "<string>",
"error_message": "<string>",
"auto_enable_new_forms": true,
"settings": {},
"connected_by": {
"id": 123,
"name": "<string>"
},
"forms_count": 123,
"enabled_forms_count": 123,
"subscribed_at": "2023-11-07T05:31:56Z",
"connected_at": "2023-11-07T05:31:56Z",
"last_lead_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z"
}
}{
"message": "<string>"
}{
"message": "<string>"
}{
"success": true,
"error_code": "RESOURCE_NOT_FOUND",
"message": "<string>",
"errors": null,
"data": null
}{
"message": "<string>",
"errors": {}
}{
"success": false,
"error_code": "SETUP_REQUIRED",
"message": "Complete the required setup steps to continue.",
"data": {
"next_step": "clinic_info"
}
}Yetkilendirmeler
oauth2bearer