Facebook is built on authentic relationships and the ability for real people to connect to what’s important to them. As such, we have internal systems designed to detect and disable fake profiles, but this can make testing applications a challenge for Platform developers.
Today, we’re releasing a new way for developers to create and manage test accounts using the Graph API. You can use the API to create up to 50 test users per application and define specific permissions for each user. The creation API returns a login_url and access token, which allows you to easily sign in as the test user for manual testing or use the access token for automated testing.
Creating a test user using the Graph API:
POST /app_id/accounts/test-users?installed=true&permissions=read_stream
In addition, you can easily generate friend connections between test users of the same application via the API to test interactions between users.
Generate friend request:
POST /test_user_id_1/friends/test_user_id_2Accept friend request:
POST /test_user_id_2/friends/test_user_id_1
This system is designed to let you to test your application in either live mode or sandbox mode. These test users cannot interact with real users, so they do not need to be verified and their activity is not monitored by our spam detection systems. More details are available on the test users documentation page.
In building the new test user system, we incorporated a variety of feedback from developers, and we hope that you will agree that the new test accounts are a great improvement over our old methods. With these enhancements, we plan to disable all old test accounts and the developer test network at the end of the year. We welcome your feedback in the comments below
Harshdeep Singh is an engineer on the Facebook Platform team.
TAGS
Sign up for monthly updates from Meta for Developers.