How to use the FB Graph API to post a note on a company page

My personal FB account is in the Admin Role of "Manager" on our company's FB page.

I have an Access Token w/ the correct permissions that I can use to successfully post a Note to the Company page using the REST API.

However, when I use the same Access Token to Post a note to https://graph.facebook.com/PROFILE_ID/notes (where PROFILE_ID is replaced with the ID of our Company page, it posts the note to my personal FB page.

How do I use the Graph API to post notes to the company page.

Thanks!

Answers


POST requests generally seem to post to the profile of the user that is authenticated, not necessarily the user with the profile ID supplied - it's odd.

Hence, you need to authenticate as the page, rather than as yourself. The details regarding this are here: https://developers.facebook.com/docs/authentication/pages/

Essentially, you authenticate as yourself, retrieve a list of pages that you manage with associated access tokens, which you can then use to post the note.

For the benefit of other users, the process is thus:

Firstly, acquire the create_post permission, as described in the API Reference A POST request must be issued to https://graph.facebook.com/PAGE_ID/notes?message="MESSAGE_BODY_TEXT"&subject="NOTE_SUBJECT"


Need Your Help

Vector comparison with string

c++ vector comparison

I have a string vector of user-input data containing strings. Now I need to make sure program won't execute if strings are different than specified few. Vector contains 4 fields and every has diffe...

check if some SPECIFIC inputs are not empty on a button click using jquery

jquery validation if-statement for-loop

i have a button and some inputs, i want to let jquery check for me if none of the inputs is empty before doing some action : so this is what i've done :