Facebook graph API - OAuth Token

后端 未结 11 1856
小鲜肉
小鲜肉 2021-01-30 09:16

I\'m trying to retrieve data using the new graph API, however the token I\'m retriving from OAuth doesn\'t appear to be working.

The call I\'m making is as follows;

11条回答
  •  佛祖请我去吃肉
    2021-01-30 09:53

    You can request an access token via terminal (OSX Users) using curl:

    curl -F type=client_cred -F client_id=xxxxxxxxxxxxxxx -F client_secret=c0f88xxxxxxxxxxxxxxxxxx1b949d1b8 https://graph.facebook.com/oauth/access_token
    

    Once you have your access token you can then use it in future curl requests to makes changes via the new graph API:

    Post a message to a profile id:

    curl -F 'access_token=xxxxxxxxxxxxx|mGVx50lxxxxxxxxxxxxhzC2w.'  -F 'message=Hello Likers'  -F 'id=1250000000000905'  https ://graph.facebook.com/feed
    

提交回复
热议问题