Ad Unit Native Styles
Create an ad unit native style mapping
Maps a native style to an ad unit and format.
POST
/
api
/
manager
/
ad-unit-native-styles
Create an ad unit native style mapping
curl --request POST \
--url https://your_a2_service/api/manager/ad-unit-native-styles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ad_unit_id": "<ad_unit_id>",
"format_id": "<format_id>",
"style_id": "<style_id>"
}
'import requests
url = "https://your_a2_service/api/manager/ad-unit-native-styles"
payload = {
"ad_unit_id": "<ad_unit_id>",
"format_id": "<format_id>",
"style_id": "<style_id>"
}
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({ad_unit_id: '<ad_unit_id>', format_id: '<format_id>', style_id: '<style_id>'})
};
fetch('https://your_a2_service/api/manager/ad-unit-native-styles', 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://your_a2_service/api/manager/ad-unit-native-styles",
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([
'ad_unit_id' => '<ad_unit_id>',
'format_id' => '<format_id>',
'style_id' => '<style_id>'
]),
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://your_a2_service/api/manager/ad-unit-native-styles"
payload := strings.NewReader("{\n \"ad_unit_id\": \"<ad_unit_id>\",\n \"format_id\": \"<format_id>\",\n \"style_id\": \"<style_id>\"\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://your_a2_service/api/manager/ad-unit-native-styles")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ad_unit_id\": \"<ad_unit_id>\",\n \"format_id\": \"<format_id>\",\n \"style_id\": \"<style_id>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your_a2_service/api/manager/ad-unit-native-styles")
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 \"ad_unit_id\": \"<ad_unit_id>\",\n \"format_id\": \"<format_id>\",\n \"style_id\": \"<style_id>\"\n}"
response = http.request(request)
puts response.read_body{
"ad_unit_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"format_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"style_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"updated_at": "2023-11-07T05:31:56Z",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"no": 123
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Authorizations
Bearer authentication. Pass the access token in the Authorization: Bearer <token> header.
Body
application/json
Response
Successful Response
Response schema for AdUnitNativeStyle mutation/read operations.
AdUnit this mapping applies to.
NativeFormat for which this style is selected (part of composite PK).
NativeStyle to use when rendering this format on this AdUnit.
Was this page helpful?
⌘I
Create an ad unit native style mapping
curl --request POST \
--url https://your_a2_service/api/manager/ad-unit-native-styles \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ad_unit_id": "<ad_unit_id>",
"format_id": "<format_id>",
"style_id": "<style_id>"
}
'import requests
url = "https://your_a2_service/api/manager/ad-unit-native-styles"
payload = {
"ad_unit_id": "<ad_unit_id>",
"format_id": "<format_id>",
"style_id": "<style_id>"
}
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({ad_unit_id: '<ad_unit_id>', format_id: '<format_id>', style_id: '<style_id>'})
};
fetch('https://your_a2_service/api/manager/ad-unit-native-styles', 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://your_a2_service/api/manager/ad-unit-native-styles",
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([
'ad_unit_id' => '<ad_unit_id>',
'format_id' => '<format_id>',
'style_id' => '<style_id>'
]),
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://your_a2_service/api/manager/ad-unit-native-styles"
payload := strings.NewReader("{\n \"ad_unit_id\": \"<ad_unit_id>\",\n \"format_id\": \"<format_id>\",\n \"style_id\": \"<style_id>\"\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://your_a2_service/api/manager/ad-unit-native-styles")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"ad_unit_id\": \"<ad_unit_id>\",\n \"format_id\": \"<format_id>\",\n \"style_id\": \"<style_id>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your_a2_service/api/manager/ad-unit-native-styles")
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 \"ad_unit_id\": \"<ad_unit_id>\",\n \"format_id\": \"<format_id>\",\n \"style_id\": \"<style_id>\"\n}"
response = http.request(request)
puts response.read_body{
"ad_unit_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z",
"format_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"style_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"updated_at": "2023-11-07T05:31:56Z",
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"no": 123
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}