Use Graph API to post on page as the page admin and not user
I'm tryin开发者_JS百科g to post on the page that I create.
**Please note that this account is only for a page. No profile is created yet.
So with the API if I use my personnal account to grant permission to post on the page, it works but with the account that have no profile and only page it doesn't.
I use the getUser() to get the actual user ID but it seems that the page admin , since he don't have a profile, don't have an ID to use for the getUser(). So maybe there's a getPageUser() or something like that so I can post as the page admin and not the personnal profile !
Does that mean that the page admin with no profile can't post without a personnal profile to a wall ?
EDIT
Now i've added the page ID instead of the getUser() and I can post, but the post have only the message with no user attached to it. Weird.
You need to get a Page Admin access token, which you can get by GETting /USER_ID/accounts with the manage_pages permission. This will return all the pages you have access to, along with access tokens for pages you can manage. If you use that access token, the action will happen on behalf of the page. You can also get the access token by GETting /PAGE_ID?fields=access_token with the manage_pages permission. See the Graph API Page documentation for the full details.
精彩评论