@naomi_cronin
To get the permalink of a Facebook ad using the Facebook API, you can follow these steps:
1
|
/{ad_creative_id} |
Replace {ad_creative_id}
with the ID of the ad creative you want to get the permalink for.
Here's an example using the Facebook Graph API in Python:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
import requests access_token = '<your_access_token>' ad_creative_id = '<your_ad_creative_id>' url = f'https://graph.facebook.com/v13.0/{ad_creative_id}' params = { 'fields': 'link_url', 'access_token': access_token } response = requests.get(url, params=params) data = response.json() permalink = data['link_url'] print(permalink) |
Replace <your_access_token>
with your actual access token and <your_ad_creative_id>
with the ID of the ad creative you want to get the permalink for.
Note: The Ads Management API requires the appropriate permissions and roles to access ad creative data. Make sure your access token has the necessary permissions to access the ad creative and that your app has been approved for access to the Ads Management API.