Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to post to my own page using the Facebook API

I would like to post updates to a Facebook Page I own, using the API.

I followed the instructions in this answer to obtain:

  1. a short-lived access token for my user, making sure to grant permissions for publish_stream and manage_pages
  2. a long-lived access token, which the token debugger actually shows as never expiring
  3. a Permanent Page Access Token specific for my page, which again is shown as never expiring

I can use the long-lived access token to post to my wall, but neither that nor the specific page access token allow me to post to my page.

If I try to use the personal long-lived access token to post to my Page ID, it returns OK and an actual post ID, but the post never appears on the page.

If I try to use the page access token to post either to /me/feed (which should be the page) or to the page ID, I get #200 The user hasn't authorized the application to perform this action which I clearly did.

What am I doing wrong?

Do I need to submit my app for review? How can I do so, when I don't even have an "app"? It has no public facing website, nothing, because it's only a single script for my own personal use, which I'd like to use to update my page.

like image 325
Tobia Avatar asked Apr 20 '15 16:04

Tobia


1 Answers

according to the docs you will need publish_pages permission to post as page from api v2.3 . Prior, it needed permission publish_actions in addition to manage_pages. Now they have introduced publish_pages specifically for that purpose. .

A page access token with publish_pages permission can be used to publish new posts on behalf of that page. Posts will appear in the voice of the page.

like image 143
Sojan Jose Avatar answered Oct 20 '22 14:10

Sojan Jose