curl \
-H "Authorization: Bearer API_KEY" \
-X GET https://api.ayrshare.com/api/ads/facebook/dsaRecommendations?accountId=1234567890
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/ads/facebook/dsaRecommendations?accountId=1234567890", {
method: "GET",
headers: {
"Authorization": `Bearer ${API_KEY}`
}
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
headers = {'Authorization': 'Bearer API_KEY'}
r = requests.get('https://api.ayrshare.com/api/ads/facebook/dsaRecommendations?accountId=1234567890', headers=headers)
print(r.json())
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ayrshare.com/api/ads/facebook/dsaRecommendations?accountId=1234567890",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer API_KEY"
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer API_KEY");
var response = await client.GetAsync("https://api.ayrshare.com/api/ads/facebook/dsaRecommendations?accountId=1234567890");
var content = await response.Content.ReadAsStringAsync();
Console.WriteLine(content);
}
}
package main
import (
"fmt"
"io/ioutil"
"net/http"
)
func main() {
client := &http.Client{}
req, _ := http.NewRequest("GET", "https://api.ayrshare.com/api/ads/facebook/dsaRecommendations?accountId=1234567890", nil)
req.Header.Add("Authorization", "Bearer API_KEY")
resp, _ := client.Do(req)
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class GetDsaRecommendations {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.ayrshare.com/api/ads/facebook/dsaRecommendations?accountId=1234567890"))
.header("Authorization", "Bearer API_KEY")
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
require 'net/http'
require 'json'
uri = URI('https://api.ayrshare.com/api/ads/facebook/dsaRecommendations?accountId=1234567890')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = 'Bearer API_KEY'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http|
http.request(req)
}
puts res.body
{
"status": "success",
"dsaRecommendations": [
"Beneficiary 1",
"Beneficiary 2",
"Beneficiary 3"
],
"count": 1
}
{
"action": "ads",
"status": "error",
"code": 413,
"message": "There was an error getting the DSA recommendations. Please try again."
}
Facebook Ads
DSA-Empfehlungen
Facebook-DSA-Empfehlungen abrufen
GET
/
ads
/
facebook
/
dsaRecommendations
curl \
-H "Authorization: Bearer API_KEY" \
-X GET https://api.ayrshare.com/api/ads/facebook/dsaRecommendations?accountId=1234567890
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/ads/facebook/dsaRecommendations?accountId=1234567890", {
method: "GET",
headers: {
"Authorization": `Bearer ${API_KEY}`
}
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
headers = {'Authorization': 'Bearer API_KEY'}
r = requests.get('https://api.ayrshare.com/api/ads/facebook/dsaRecommendations?accountId=1234567890', headers=headers)
print(r.json())
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ayrshare.com/api/ads/facebook/dsaRecommendations?accountId=1234567890",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer API_KEY"
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer API_KEY");
var response = await client.GetAsync("https://api.ayrshare.com/api/ads/facebook/dsaRecommendations?accountId=1234567890");
var content = await response.Content.ReadAsStringAsync();
Console.WriteLine(content);
}
}
package main
import (
"fmt"
"io/ioutil"
"net/http"
)
func main() {
client := &http.Client{}
req, _ := http.NewRequest("GET", "https://api.ayrshare.com/api/ads/facebook/dsaRecommendations?accountId=1234567890", nil)
req.Header.Add("Authorization", "Bearer API_KEY")
resp, _ := client.Do(req)
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class GetDsaRecommendations {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.ayrshare.com/api/ads/facebook/dsaRecommendations?accountId=1234567890"))
.header("Authorization", "Bearer API_KEY")
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
require 'net/http'
require 'json'
uri = URI('https://api.ayrshare.com/api/ads/facebook/dsaRecommendations?accountId=1234567890')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = 'Bearer API_KEY'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http|
http.request(req)
}
puts res.body
{
"status": "success",
"dsaRecommendations": [
"Beneficiary 1",
"Beneficiary 2",
"Beneficiary 3"
],
"count": 1
}
{
"action": "ads",
"status": "error",
"code": 413,
"message": "There was an error getting the DSA recommendations. Please try again."
}
Rufen Sie Empfehlungen zum Digital Services Act (DSA) für Ihr Facebook-Werbekonto ab.
Als Teil der Anforderungen des Digital Services Act (DSA) der Europäischen Union (EU) verlangt Facebook für Anzeigen, die einen Teil der EU als Zielgruppe haben, Zeichenfolgenwerte für den Begünstigten und den Zahler der erstellten Anzeige.
Dieser Endpunkt liefert eine Liste empfohlener DSA-Begünstigter und -Zahler, die beim Bewerben von Beiträgen verwendet werden können.
Diese Felder können in
dsaBeneficiary und dsaPayor verwendet werden.
- Gibt eine Liste von Zeichenfolgen (maximal 25) aus, die Facebook als wahrscheinlichen Begünstigten/Zahler identifiziert hat, basierend auf der jüngsten Aktivität des Werbekontos.
- Diese Empfehlungen können als Werte für die Parameter
dsaBeneficiaryunddsaPayorim Endpunkt Beitrag bewerben verwendet werden. - Sowohl
dsaBeneficiaryals auchdsaPayormüssen zusammen gesetzt werden, wenn eines davon beim Bewerben von Beiträgen angegeben wird.
Header-Parameter
Query-Parameter
Die ID des Facebook-Werbekontos, für das DSA-Empfehlungen abgerufen werden sollen. Die Konto-ID kann
über den Werbekonten-Endpunkt abgerufen werden.
curl \
-H "Authorization: Bearer API_KEY" \
-X GET https://api.ayrshare.com/api/ads/facebook/dsaRecommendations?accountId=1234567890
const API_KEY = "API_KEY";
fetch("https://api.ayrshare.com/api/ads/facebook/dsaRecommendations?accountId=1234567890", {
method: "GET",
headers: {
"Authorization": `Bearer ${API_KEY}`
}
})
.then((res) => res.json())
.then((json) => console.log(json))
.catch(console.error);
import requests
headers = {'Authorization': 'Bearer API_KEY'}
r = requests.get('https://api.ayrshare.com/api/ads/facebook/dsaRecommendations?accountId=1234567890', headers=headers)
print(r.json())
<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ayrshare.com/api/ads/facebook/dsaRecommendations?accountId=1234567890",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
"Authorization: Bearer API_KEY"
],
]);
$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
using System;
using System.Net.Http;
using System.Threading.Tasks;
class Program
{
static async Task Main()
{
var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", "Bearer API_KEY");
var response = await client.GetAsync("https://api.ayrshare.com/api/ads/facebook/dsaRecommendations?accountId=1234567890");
var content = await response.Content.ReadAsStringAsync();
Console.WriteLine(content);
}
}
package main
import (
"fmt"
"io/ioutil"
"net/http"
)
func main() {
client := &http.Client{}
req, _ := http.NewRequest("GET", "https://api.ayrshare.com/api/ads/facebook/dsaRecommendations?accountId=1234567890", nil)
req.Header.Add("Authorization", "Bearer API_KEY")
resp, _ := client.Do(req)
body, _ := ioutil.ReadAll(resp.Body)
fmt.Println(string(body))
}
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class GetDsaRecommendations {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.ayrshare.com/api/ads/facebook/dsaRecommendations?accountId=1234567890"))
.header("Authorization", "Bearer API_KEY")
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
require 'net/http'
require 'json'
uri = URI('https://api.ayrshare.com/api/ads/facebook/dsaRecommendations?accountId=1234567890')
req = Net::HTTP::Get.new(uri)
req['Authorization'] = 'Bearer API_KEY'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http|
http.request(req)
}
puts res.body
{
"status": "success",
"dsaRecommendations": [
"Beneficiary 1",
"Beneficiary 2",
"Beneficiary 3"
],
"count": 1
}
{
"action": "ads",
"status": "error",
"code": 413,
"message": "There was an error getting the DSA recommendations. Please try again."
}
⌘I
