Ad Unit Native Styles
Replace an ad unit native style mapping
Replaces the native style mapped to the specified ad unit and format.
PUT
/
api
/
manager
/
ad-unit-native-styles
/
{ad_unit_id}
/
{format_id}
Replace an ad unit native style mapping
curl --request PUT \
--url https://your_a2_service/api/manager/ad-unit-native-styles/{ad_unit_id}/{format_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"style_id": "<style_id>"
}
'import requests
url = "https://your_a2_service/api/manager/ad-unit-native-styles/{ad_unit_id}/{format_id}"
payload = { "style_id": "<style_id>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({style_id: '<style_id>'})
};
fetch('https://your_a2_service/api/manager/ad-unit-native-styles/{ad_unit_id}/{format_id}', 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/{ad_unit_id}/{format_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'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/{ad_unit_id}/{format_id}"
payload := strings.NewReader("{\n \"style_id\": \"<style_id>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://your_a2_service/api/manager/ad-unit-native-styles/{ad_unit_id}/{format_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"style_id\": \"<style_id>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your_a2_service/api/manager/ad-unit-native-styles/{ad_unit_id}/{format_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\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": "<string>"
}Authorizations
Bearer authentication. Pass the access token in the Authorization: Bearer <token> header.
Body
application/json
Request body for PUT /ad-unit-native-styles/{ad_unit_id}/{format_id}.
NativeStyle to replace the current mapping with.
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
Replace an ad unit native style mapping
curl --request PUT \
--url https://your_a2_service/api/manager/ad-unit-native-styles/{ad_unit_id}/{format_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"style_id": "<style_id>"
}
'import requests
url = "https://your_a2_service/api/manager/ad-unit-native-styles/{ad_unit_id}/{format_id}"
payload = { "style_id": "<style_id>" }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({style_id: '<style_id>'})
};
fetch('https://your_a2_service/api/manager/ad-unit-native-styles/{ad_unit_id}/{format_id}', 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/{ad_unit_id}/{format_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'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/{ad_unit_id}/{format_id}"
payload := strings.NewReader("{\n \"style_id\": \"<style_id>\"\n}")
req, _ := http.NewRequest("PUT", 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.put("https://your_a2_service/api/manager/ad-unit-native-styles/{ad_unit_id}/{format_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"style_id\": \"<style_id>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://your_a2_service/api/manager/ad-unit-native-styles/{ad_unit_id}/{format_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\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": "<string>"
}