-2

I'm having some trouble with the facebook SDK on Android. I would like to search a user by his phone number. For example when I'm on my account on my computer, if I put my friend's phone number in the search field, it gives me his profil, I would like to do exactly the same but programmatically speaking. I thought it would have worked with this :

/search?q=0123456789&type=user

But it gives me this error (even if I granted all the permissions to my access token) :

"message": "(#200) Must have a valid access_token to access this endpoint",
"type": "OAuthException",
"code": 200

Does anyone knows how to achieve this goal ? Thank you!

omaflak
  • 165
  • 1
  • 1
  • 9

2 Answers2

2

Searching by phone number isn't (and, afaik, never was) possible via the Graph API. The error you're receiving is not related to this, but because you're apparently not using a user access token when using the /search endpoint.

Still, this will not work.

Tobi
  • 31,405
  • 8
  • 58
  • 90
0

Try this

/search?q=mark&type=user&access_token=<your_user_access_token>
Sunny Tambi
  • 2,393
  • 3
  • 23
  • 27