Comments (4)
This happens due to an enforcement on requiring 2fa on generating system user tokens. Right now the only workaround for developers is to generate the access token from the UI: https://business.facebook.com/settings/system-users or you could try to generate access tokens on non system users.
from facebook-java-business-sdk.
Hello @stcheng
Thank you for the response.
I can not use an access token of a non system user. I want to invite a user to an existing facebook business account:
new Business.APIRequestCreateBusinessUser("181431399044864",FacebookUtil.createApiContext(request.getAccessToken()))
.setEmail("[email protected]")
.setRole(BusinessUser.EnumRole.VALUE_EMPLOYEE)
.execute();
but it returns me:
{
"error": {
"message": "Application does not have permission for this action",
"type": "OAuthException",
"code": 10,
"error_data": {
"hash": null
},
"error_subcode": 2859030,
"is_transient": false,
"error_user_title": "This Action Is Not Allowed",
"error_user_msg": "Please retry this action in a few minutes",
"fbtrace_id": "AsErZRmD617WCt9yYFZkUZR"
}
}
My App and the access token I am using have the right permission to execute this action. My app has business_management permission (advanced access) and my user has an administrative role, which means I am able to invite the exact new user to the same business manager via facebook ui.
After some investigations I figured out that I can successfully execute the action if using an admin system user access token instead. Now I need to generate a system user access token programmatically.
from facebook-java-business-sdk.
@Denalda-lab right now we do not provide an official way to generate system user access tokens programmatically. thanks for understanding.
from facebook-java-business-sdk.
Thank you for the response @stcheng!
My last tentative: Is it any way to invite a user to join a business account by using an admin access token instead of an admin system user access token?
As I have mentioned above I try to make a call as below:
new Business.APIRequestCreateBusinessUser("181431399044864",FacebookUtil.createApiContext(request.getAccessToken()))
.setEmail("[email protected]")
.setRole(BusinessUser.EnumRole.VALUE_EMPLOYEE)
.execute();
My app has business_management permission (advanced access) and my user has an administrative role.
As a response I get:
{
"error": {
"message": "Application does not have permission for this action",
"type": "OAuthException",
"code": 10,
"error_data": {
"hash": null
},
"error_subcode": 2859030,
"is_transient": false,
"error_user_title": "This Action Is Not Allowed",
"error_user_msg": "Please retry this action in a few minutes",
"fbtrace_id": "AsErZRmD617WCt9yYFZkUZR"
}
}
from facebook-java-business-sdk.
Related Issues (20)
- can not get AdCreativeInsights from sdk HOT 1
- I can't get ad_id,ad_name,adset_id,adset_name's data in AdReportRun.APIRequestGetInsights. HOT 1
- Create Leads via APIs
- create AdCreatives erros
- i can not down this sdk HOT 4
- I only have accesstoken and appid appsecert how to obtain user information HOT 3
- Getting "Two factor authentication required" when generating an admin user system access token. HOT 1
- adSet/reach-estimate does not exist in SDK HOT 1
- AdsInsights gives json parse error when fetching breakdown link_url_asset HOT 5
- Application does not have permission for this action, Please retry this action in a few minutes
- Futures.addCallback is deprecated HOT 3
- Create adset failed
- Create adset failed
- Add `depends_on` support for Batch Request HOT 1
- Async Insights - Exception while parsing image_asset field HOT 3
- lead fetch fail
- Missing `targeting_automation` field in Targeting HOT 2
- AdCreative with `asset_feed_spec` is not creating the Ad with Website destination HOT 1
- not compatible with latest guava HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from facebook-java-business-sdk.