curl -X PUT 'https://services.leadconnectorhq.com/ad-publishing/facebook/ads-v2' \
-H 'Authorization: Bearer YOUR_TOKEN' \
-H 'Version: 2021-07-28' \
-H 'Content-Type: application/json' \
-d '{
"id": "ad_123",
"locationId": "loc_abc123",
"name": "My Ad Creative",
"primaryText": "Check out our offer!",
"headline": "Great Deal",
"description": "Limited time offer",
"imageUrl": "https://example.com/img.jpg",
"mediaType": "SINGLE",
"media": [
{
"src": "https://example.com/image.jpg",
"thumbnailUrl": "https://example.com/thumb.jpg",
"selectedPoster": 0,
"type": "IMAGE",
"name": "ad_image.jpg"
}
],
"multiAdvertiserAds": false,
"campaignId": "camp_123",
"adsetId": "adset_123",
"cta": "LEARN_MORE",
"conversationFormId": "conv_123",
"destinationLink": "https://example.com",
"destinationFormId": "form_123"
}'
const response = await fetch('https://services.leadconnectorhq.com/ad-publishing/facebook/ads-v2', {
method: 'PUT',
headers: {
Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
Version: '2021-07-28',
'Content-Type': 'application/json',
},
body: JSON.stringify({"id": "ad_123", "locationId": "loc_abc123", "name": "My Ad Creative", "primaryText": "Check out our offer!", "headline": "Great Deal", "description": "Limited time offer", "imageUrl": "https://example.com/img.jpg", "mediaType": "SINGLE", "media": [{"src": "https://example.com/image.jpg", "thumbnailUrl": "https://example.com/thumb.jpg", "selectedPoster": 0, "type": "IMAGE", "name": "ad_image.jpg"}], "multiAdvertiserAds": false, "campaignId": "camp_123", "adsetId": "adset_123", "cta": "LEARN_MORE", "conversationFormId": "conv_123", "destinationLink": "https://example.com", "destinationFormId": "form_123"}),
});
const data = await response.json();
import os, requests
response = requests.request(
'PUT',
'https://services.leadconnectorhq.com/ad-publishing/facebook/ads-v2',
headers={
'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
'Version': '2021-07-28',
'Content-Type': 'application/json',
},
json={"id": "ad_123", "locationId": "loc_abc123", "name": "My Ad Creative", "primaryText": "Check out our offer!", "headline": "Great Deal", "description": "Limited time offer", "imageUrl": "https://example.com/img.jpg", "mediaType": "SINGLE", "media": [{"src": "https://example.com/image.jpg", "thumbnailUrl": "https://example.com/thumb.jpg", "selectedPoster": 0, "type": "IMAGE", "name": "ad_image.jpg"}], "multiAdvertiserAds": false, "campaignId": "camp_123", "adsetId": "adset_123", "cta": "LEARN_MORE", "conversationFormId": "conv_123", "destinationLink": "https://example.com", "destinationFormId": "form_123"},
)
data = response.json()
<?php
$ch = curl_init('https://services.leadconnectorhq.com/ad-publishing/facebook/ads-v2');
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({'id': 'ad_123', 'locationId': 'loc_abc123', 'name': 'My Ad Creative', 'primaryText': 'Check out our offer!', 'headline': 'Great Deal', 'description': 'Limited time offer', 'imageUrl': 'https://example.com/img.jpg', 'mediaType': 'SINGLE', 'media': [{'src': 'https://example.com/image.jpg', 'thumbnailUrl': 'https://example.com/thumb.jpg', 'selectedPoster': 0, 'type': 'IMAGE', 'name': 'ad_image.jpg'}], 'multiAdvertiserAds': false, 'campaignId': 'camp_123', 'adsetId': 'adset_123', 'cta': 'LEARN_MORE', 'conversationFormId': 'conv_123', 'destinationLink': 'https://example.com', 'destinationFormId': 'form_123'}),
]);
$data = json_decode(curl_exec($ch), true);