API Details

HCL Unica Link uses the Facebook Ad API to perform the following activities:

  • Connect to the Facebook ad platform and authorize the user.
  • List the “audiences”.
  • Create new audience list.
  • Upload/Append users to the audience and API response is sent back to Unica.

Generate Authorization Code

For detailed documentation to generate auth code, see https://developers.facebook.com/docs/marketing-api/overview/authorization.

API Details

URL
https://www.facebook.com/v8.0/dialog/oauth?client_id=%3Cclient_id%3E&redirect_uri=%3Credirect_uri%3E&state=unica-integration&response_type=code&scope=ads_management,business_management,public_profile"
Method
GET

Generate Access Token

For detailed documentation to generate access token, see https://developers.facebook.com/docs/marketing-apis/overview/authentication.

API Details

URL
https://graph.facebook.com/v14.0/oauth/access_token
Method
GET

List Business Owned Ad Accounts

For detailed documentation to list business owned Ad accounts, see https://developers.facebook.com/docs/marketing-api/reference/business/owned_ad_accounts/.

API Details

URL
https://graph.facebook.com/v14.0/<business-id>/owned_ad_accounts
Method
GET

List All Audiences on the Ad Manager

For detailed documentation to list all audiences on the Ad manager, see https://developers.facebook.com/docs/marketing-api/reference/ad-account/customaudiences/.

API Details

URL
https://graph.facebook.com/v14.0/act_<AD_Account_ID> /customaudiences?fields=name
Method
GET

Create Custom Audience

For detailed documentation to create custom audience, see https://developers.facebook.com/docs/marketing-api/reference/ad-account/customaudiences/.

API Details

URL
https://graph.facebook.com/v14.0/act_<AD_Account_ID> /customaudiences
Method
POST

Adding Users to an Audience

For detailed documentation to add users to an audience, see https://developers.facebook.com/docs/marketing-api/reference/custom-audience/users/.

API Details

URL
https://graph.facebook.com/v14.0/<CUSTOM_AUDIENCE_ID>/users
Method
POST

Important Notes

Refer the following information:

  • Redirect URL is https://hcltechsw.com/wps/portal.
  • Facebook Ads API URL format except Generate Auth Code API is https://graph.facebook.com/<API VERSION>, where host name is graph.facebook.com and <API VERSION> could be as v13.0, v14.0, or v15.0.
  • Generate Auth Code API format is https://www.facebook.com/<API VERSION>, where host name is facebook.com and explicitly highlight the following:

    Host name

    • graph.facebook.com
    • facebook.com

    Port: 443