Find the business related to a Facebook App through the API

189 views Asked by At

Since Facebook introduced API V2.0, there is the new Business Mapping API that let us associate a Facebook App to a Business. One of the great feature is the new token_for_business field :

Once an app has been associated with a Business Manager, you may request the token_for_business field on the User node. This returns a string which is the same for this person across all the apps managed by the same Business Manager.

I want to take advantage of that in my code. The thing is, my code is likely to be executed with several Facebook App, and a check on the app config is needed.

To ensure the things won't go wrong, i want to check if the app belongs to the good Business. How can i do that through the graph API? I have an app access_token, but I can't find a way to read that property. Is that possible ?

The documentation on the application endpoint lets me think that it's not, but I know that the doc can be incomplete, especially for the new features !

1

There are 1 answers

0
Shireesh Asthana On

You can get it the other way around by checking the connected objects of the business.

You can retrieve all Facebook objects (e.g. pages, apps, etc) where an Ad User is an administrator (or developer/advertiser) for a specific business:

    curl -G\
    -d "business_id=<business_id>" \
    -d "access_token=<ACCESS_TOKEN>" \
"https://graph.facebook.com/<API_VERSION>/act_<AD_ACCOUNT_ID>/connectionobjects"

https://developers.facebook.com/docs/marketing-api/businessmanager/v2.3#connection-objects