Integration
Connect integration accounts
Final step of the OAuth flow: stores one integration per selected account with the token from POST /v1/integration/code. Reconnecting an existing account updates its token and keeps a deactivated integration deactivated. Also looks up the account type where the platform has one, runs an immediate options sync, and posts to Slack for non-admin users.
POST
/
v1
/
integration
Connect integration accounts
curl --request POST \
--url https://api.tagdeliver.com/v1/integration \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"platform": "GAM",
"token": "ya29.example-token",
"expires": "2026-11-18 10:15:00",
"refresh_token": "1//example-refresh",
"accounts": [
{
"code": "21700000",
"name": "Example Media"
}
]
}
'import requests
url = "https://api.tagdeliver.com/v1/integration"
payload = {
"platform": "GAM",
"token": "ya29.example-token",
"expires": "2026-11-18 10:15:00",
"refresh_token": "1//example-refresh",
"accounts": [
{
"code": "21700000",
"name": "Example Media"
}
]
}
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({
platform: 'GAM',
token: 'ya29.example-token',
expires: '2026-11-18 10:15:00',
refresh_token: '1//example-refresh',
accounts: [{code: '21700000', name: 'Example Media'}]
})
};
fetch('https://api.tagdeliver.com/v1/integration', 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://api.tagdeliver.com/v1/integration",
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([
'platform' => 'GAM',
'token' => 'ya29.example-token',
'expires' => '2026-11-18 10:15:00',
'refresh_token' => '1//example-refresh',
'accounts' => [
[
'code' => '21700000',
'name' => 'Example Media'
]
]
]),
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://api.tagdeliver.com/v1/integration"
payload := strings.NewReader("{\n \"platform\": \"GAM\",\n \"token\": \"ya29.example-token\",\n \"expires\": \"2026-11-18 10:15:00\",\n \"refresh_token\": \"1//example-refresh\",\n \"accounts\": [\n {\n \"code\": \"21700000\",\n \"name\": \"Example Media\"\n }\n ]\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://api.tagdeliver.com/v1/integration")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"platform\": \"GAM\",\n \"token\": \"ya29.example-token\",\n \"expires\": \"2026-11-18 10:15:00\",\n \"refresh_token\": \"1//example-refresh\",\n \"accounts\": [\n {\n \"code\": \"21700000\",\n \"name\": \"Example Media\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tagdeliver.com/v1/integration")
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 \"platform\": \"GAM\",\n \"token\": \"ya29.example-token\",\n \"expires\": \"2026-11-18 10:15:00\",\n \"refresh_token\": \"1//example-refresh\",\n \"accounts\": [\n {\n \"code\": \"21700000\",\n \"name\": \"Example Media\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true
}{
"success": false,
"message": "Form errors found: date_range: The data should match one item from enum"
}{
"success": false,
"message": "Token not found."
}{
"success": false,
"message": "User forbidden"
}{
"success": false,
"message": "Resource not found"
}{
"status": 500,
"message": "An error occurred [4f2k], please try again shortly or contact your account manager for further assistance."
}Authorizations
Body
application/json
Was this page helpful?
⌘I
Connect integration accounts
curl --request POST \
--url https://api.tagdeliver.com/v1/integration \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"platform": "GAM",
"token": "ya29.example-token",
"expires": "2026-11-18 10:15:00",
"refresh_token": "1//example-refresh",
"accounts": [
{
"code": "21700000",
"name": "Example Media"
}
]
}
'import requests
url = "https://api.tagdeliver.com/v1/integration"
payload = {
"platform": "GAM",
"token": "ya29.example-token",
"expires": "2026-11-18 10:15:00",
"refresh_token": "1//example-refresh",
"accounts": [
{
"code": "21700000",
"name": "Example Media"
}
]
}
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({
platform: 'GAM',
token: 'ya29.example-token',
expires: '2026-11-18 10:15:00',
refresh_token: '1//example-refresh',
accounts: [{code: '21700000', name: 'Example Media'}]
})
};
fetch('https://api.tagdeliver.com/v1/integration', 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://api.tagdeliver.com/v1/integration",
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([
'platform' => 'GAM',
'token' => 'ya29.example-token',
'expires' => '2026-11-18 10:15:00',
'refresh_token' => '1//example-refresh',
'accounts' => [
[
'code' => '21700000',
'name' => 'Example Media'
]
]
]),
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://api.tagdeliver.com/v1/integration"
payload := strings.NewReader("{\n \"platform\": \"GAM\",\n \"token\": \"ya29.example-token\",\n \"expires\": \"2026-11-18 10:15:00\",\n \"refresh_token\": \"1//example-refresh\",\n \"accounts\": [\n {\n \"code\": \"21700000\",\n \"name\": \"Example Media\"\n }\n ]\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://api.tagdeliver.com/v1/integration")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"platform\": \"GAM\",\n \"token\": \"ya29.example-token\",\n \"expires\": \"2026-11-18 10:15:00\",\n \"refresh_token\": \"1//example-refresh\",\n \"accounts\": [\n {\n \"code\": \"21700000\",\n \"name\": \"Example Media\"\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tagdeliver.com/v1/integration")
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 \"platform\": \"GAM\",\n \"token\": \"ya29.example-token\",\n \"expires\": \"2026-11-18 10:15:00\",\n \"refresh_token\": \"1//example-refresh\",\n \"accounts\": [\n {\n \"code\": \"21700000\",\n \"name\": \"Example Media\"\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"success": true
}{
"success": false,
"message": "Form errors found: date_range: The data should match one item from enum"
}{
"success": false,
"message": "Token not found."
}{
"success": false,
"message": "User forbidden"
}{
"success": false,
"message": "Resource not found"
}{
"status": 500,
"message": "An error occurred [4f2k], please try again shortly or contact your account manager for further assistance."
}