Skip to main content
Add a member to a Facebook custom audience
PUT https://services.leadconnectorhq.com/ad-publishing/facebook/custom-audience/{audienceId}/member

Autorización

Authorization
string
required
Bearer token generado desde el portal Leadway. Ver Autenticación.
Version
string
default:"2021-07-28"
required
Versión de la API.

Path parameters

audienceId
string
default:"23851234567890123"
required
Custom audience identifier

Body

locationId
string
default:"loc_abc123"
required
Account identifier
contactId
string
default:"contact_123"
required
Contact identifier
fbAdAccountId
string
default:"act_123456"
Facebook ad account ID

Respuestas

{}
{}
{}

Ejemplo

curl -X PUT 'https://services.leadconnectorhq.com/ad-publishing/facebook/custom-audience/YOUR_audienceId/member' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Version: 2021-07-28' \
  -H 'Content-Type: application/json' \
  -d '{
  "locationId": "loc_abc123",
  "contactId": "contact_123",
  "fbAdAccountId": "act_123456"
}'
const response = await fetch('https://services.leadconnectorhq.com/ad-publishing/facebook/custom-audience/YOUR_audienceId/member', {
  method: 'PUT',
  headers: {
    Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
    Version: '2021-07-28',
    'Content-Type': 'application/json',
  },
  body: JSON.stringify({"locationId": "loc_abc123", "contactId": "contact_123", "fbAdAccountId": "act_123456"}),
});
const data = await response.json();
import os, requests
response = requests.request(
    'PUT',
    'https://services.leadconnectorhq.com/ad-publishing/facebook/custom-audience/YOUR_audienceId/member',
    headers={
        'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
        'Version': '2021-07-28',
        'Content-Type': 'application/json',
    },
    json={"locationId": "loc_abc123", "contactId": "contact_123", "fbAdAccountId": "act_123456"},
)
data = response.json()
<?php
$ch = curl_init('https://services.leadconnectorhq.com/ad-publishing/facebook/custom-audience/YOUR_audienceId/member');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'PUT',
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
        'Version: 2021-07-28',
        'Content-Type: application/json',
    ],
    CURLOPT_POSTFIELDS => json_encode({'locationId': 'loc_abc123', 'contactId': 'contact_123', 'fbAdAccountId': 'act_123456'}),
]);
$data = json_decode(curl_exec($ch), true);