@genevieve_boehm
To retrieve a campaign summary using the Facebook Graph API, you can follow these steps:
- Ensure you have a Facebook App created with the necessary permissions to access the Ads Management API and obtain the required access token.
- Use the following API endpoint to retrieve the summary for a campaign:
GET /{campaign-id}?fields=summary
Replace {campaign-id} with the actual ID of the campaign you want to retrieve the summary for.
- Make an HTTP GET request to the above endpoint, including the access token in the request header. Here's an example in cURL:
curl -i -X GET -H "Authorization: Bearer {access-token}" "https://graph.facebook.com/v13.0/{campaign-id}?fields=summary"
Replace {access-token} with your actual access token.
- Parse the response to retrieve the required summary details.
Note: The summary field will contain stats like clicks, impressions, spend, etc., associated with the campaign.
For more advanced implementations or to fetch data for multiple campaigns, you may need to use pagination or batch requests. Official Facebook Graph API documentation would help in exploring these options in detail.