0

I am doing a little test on a facebook API call. I am using the graph api explorer and the Api Key is a page key. The general idea is to get the feed from the page, which I can do. But I'm concerned about the way i'm doing it:

/me/posts

From the documentation:

/me is a special endpoint that translates to the user ID of the person whose access token is being used to make the request

But in this context, I understand me is being translated to the page's id somehow. Am I reading this wrong?

My main concern is that at some point I might get a post or info from some place different than the Page in question.

Ernesto
  • 1,523
  • 1
  • 14
  • 32

1 Answers1

1

Every access token has an identity. Your access token has your identity, mine has my identity, your page's access token has it's identity and so on..

(I've highlighted access token because it's very important to understand how facebook manages access tokens and most of the doubts are resolved once you understand what exactly access token does and how to get them)

/me does nothing but replaces itself with the concerned id when used with an access token. Without access token it is nothing. So-

  • /me?access_token={my-access-token} is similar to /{user-id-associated-with-me}?...
  • /me?access_token={page-access-token} is similar to /{page-id-associated-the page-access-token}?...

So in your case, unless you use the access token other than your page's, you are good to use /me and it will query everything related ONLY to YOUR PAGE.

Since, you are dealing with page, you may want to get a page access token that'll never expire. To get one check out this answer.

You may also like to play around with Graph API Explorer

Community
  • 1
  • 1
Sahil Mittal
  • 20,697
  • 12
  • 65
  • 90
  • Thanks, yes i got to that part with the permanent access token and what not, but I wanted confirmation on the "identity" of /me. Do you know if I can restrict the page's access token permissions? Oh, maybe that's another question. – Ernesto May 06 '16 at 15:53
  • 1
    You cannot restrict the permissions for a page access token. As mentioned in the link I've mentioned that `page access token they permission to APIs that read, write or modify the data belonging to a Facebook Page`. So you asked user for `manage_pages` permissions, you got the page access token and you can do all the available actions related to a user's page - that's it – Sahil Mittal May 09 '16 at 05:58
  • Thanks, i really appreciate it. – Ernesto May 09 '16 at 15:28