繁体   English   中英

我如何使用Graph API删除具有2个以上应用程序的Facebook测试用户

[英]how can i delete a Facebook Test User with 2+ apps using the Graph API

当我尝试按docs( http://developers.facebook.com/docs/test_users/#deleting )中的说明删除用户时,出现错误响应:

(#2903) Cannot delete this test account because it is associated with other applications. Use DELETE app_id/accounts/test-users/test_account_id to remove it from other apps first. Use GET test_user_id/ownerapps to get complete list of owner apps.

然后,当我尝试执行其<app_id> (将<user_id><app_id>替换为Facebook数字ID)时:

DELETE <app_id>/accounts/test-users/<user_id> to remove it from other apps first

我收到此错误:

Unknown path components: /<user_id>

我想念什么吗?

如错误所述,您无法删除用户,因为该用户已分配给两个或多个应用程序。

解决方法是使用此调用获取使用该特定用户的所有应用程序

“ https://graph.facebook.com/TEST_ACCOUNT_ID/ownerapps&access_token=YOUR_APP_ACCESS_TOKEN”

这将为您提供测试帐户所附加的应用程序列表,以便使用JSON序列化程序对对象进行事先解码。 然后,您可以从每个应用中删除而不是删除测试帐户,直到只有一个使用以下帐户:

“ https://graph.facebook.com/APP_ID/accounts/test-users?uid=TEST_ACCOUNT_ID&access_token=APPLICATION_ACCESS_TOKEN&method=delete”

当仅剩一个应用程序时,您可以使用删除测试帐户:

“ https://graph.facebook.com/TEST_ACCOUNT_ID?method=delete&access_token=TEST_ACCOUNT_ACCESS_TOKEN”

希望有帮助!

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM