开发者

Creating A Test User on Facebook

开发者 https://www.devze.com 2023-03-25 21:26 出处:网络
I am new to Facebook application development. I want to create a test user for my application but when I try it using the API

I am new to Facebook application development. I want to create a test user for my application but when I try it using the API

 https://graph.facebook.com/APP_ID/accounts/test-users?installed=true&
name=FULL_NAME&permissions=read_stream&method=post&access_token=APP_ACCESS_TOKEN

It displays the following error:

{开发者_如何学Go
  "error": {
  "type": "OAuthException",
  "message": "(#15) The method you are calling must be called 
              with an app secret signed session"
  }
}

I have read & followed the steps mentioned on

https://developers.facebook.com/docs/authentication/

Still the problem persists. Please guide me, what should I do?

Thank You.


You need to get a valid access token - the application access token will do. To get this use:

https://graph.facebook.com/oauth/access_token?client_id=YOUR_APP_ID&client_secret=YOUR_APP_SECRET&grant_type=client_credentials

substituting YOUR_APP_ID & YOUR_APP_SECRET with your respective values.

This will return a valid access token that you can substitute for APP_ACCESS_TOKEN in:

https://graph.facebook.com/APP_ID/accounts/test-users?installed=true&name=FULL_NAME&permissions=read_stream&method=post&access_token=APP_ACCESS_TOKEN


You need an 'appId' => 'XXXXXXXXXXXXXX' and a 'secret' => 'XXXXXXXXXXXXXX' one.

From the facebook documentation :

In order to authenticate your app, you must pass the authorization code and your app secret to the Graph API token endpoint at https://graph.facebook.com/oauth/access_token. The app secret is available from the Developer App and should not be shared with anyone or embedded in any code that you will distribute

The link seems to be down at the moment though.


You may use the Facebook Test Java API framework, which wraps the process of creating test users in a Java API. The test user also have access to the user details, the wall, and so on so you may create automatic tests to verify your application behavior.

0

精彩评论

暂无评论...
验证码 换一张
取 消