We try to upload archive to web hosting per doc
curl -X POST https://graph-video.facebook.com/{App ID}/assets
-F 'access_token={ASSET UPLOAD ACCESS TOKEN}'
-F 'type=BUNDLE'
-F 'asset=#./{YOUR GAME}.zip'
-F 'comment=Graph API upload'
and get the upload access token by this link
curl -X GET "https://graph.facebook.com/oauth/access_token
?client_id={your-app-id}
&client_secret={your-app-secret}
&grant_type=client_credentials"
However, we got the following error
{"error":{"message":"(#200) Permissions error","type":"OAuthException","code":200,"fbtrace_id":"A8uQbx3l5o5atIQJjaddy"}}
Is there anything we are missing? or how to get ASSET UPLOAD ACCESS TOKEN correctly?
Related
I am trying to login to dcos-cli (OAuth enables).
When i type dcos auth login -> this gives me a URL
If i open the URL in browser and enter credentials a code (token) is being generated, using which i am able to log-in into the cli.
This has to be automated so i am sending a curl request
curl -s --data \
"grant_type=password&client_id=dcos&username=dcosuser&password=<>" \
-H "Content-Type: application/x-www-form-urlencoded" \
https://ip:port/auth/realms/DCOS/protocol/openid-connect/token \
| jq -r '.access_token'
But using this access token i am not able to login.
Can anyone please help.
Solved this by a java program which gets the access code from the keycloak-server .and then runs the dcos auth login.
The java code does a GET to https://<ip>/login?redirect_uri=urn:ietf:wg:oauth:2.0:oob
And then from the page extract the "action" attribute from the returned page and then from a POST request to the URL obtained from the "action" with other parameters like password.
Ex: https://<ip>:<port>/auth/realms/DCOS/login-actions/authenticate?code=erpkJ0BaLcp9VV2eTkY_a9xdpeNNzc375Ic7vHxhcMg.1b1461c6-51cd-484e-8c0e-a615600b7156&execution=8ad82be0-2471-40b1-b7e0-3192e0c8a381
Post parameters : username=dcosuser&password=<pass>&login=Log+in
While trying to create an adcreative using the facebook ads api, I am giving the following POST request:
curl -F 'title=yahoo test ad creative' -F 'name=yahoo_test_creative' -F 'body=this is a test ad created by yahoo' -F 'image_hash=' -F 'object_url=http://earthled.com' -F 'access_token=' https://graph.facebook.com/act_74021791/adcreatives
I am getting the following error:
{"error":{"type":"Exception","message":"The Adcreative Create Failed for the following reason: The destination URL of your creative has to be a valid web page.","code":1487390}}
The documentation url is: https://developers.facebook.com/docs/reference/ads-api/adcreative
Not able to figure out what is wrong with the object_url. Any help will be appreciated.
I had the same problem. It turned out that I needed to switch object_url to link_url because my account had not yet been migrated to the new settings. Maybe that'll help you too.
I'm trying to get this to work: https://developers.facebook.com/blog/post/465/
Step 1: I'm getting an access token:
https://graph.facebook.com/oauth/access_token?type=client_cred&client_id=myAppIdclient_secret=myAppSecret
Step 2: I'm posting via curl
curl -F 'access_token=myAccessToken' -F 'message=Hello World!' -F 'id=http://example.com' https://graph.facebook.com/feed
Where myUrl is say http://example.com
I am getting this error, does not resolve to a valid user ID:
{"error":{"message":"(#100) http:\/\/example does not resolve to a valid user ID","type":"OAuthException","code":100}}
Step 3: If I first post my url to the linter, and get its ID:
https://developers.facebook.com/tools/debug/og/object?q=http%3A%2F%2Fexample.com
https://graph.facebook.com/10150096126766188
curl -F 'access_token=myAccessToken' -F 'message=Hello World!' -F 'id=10150096126766188' https://graph.facebook.com/feed
Then I get 'The user hasn't authorized the application to perform this action' error:
{"error":{"message":"(#200) The user hasn't authorized the application to perform this action","type":"OAuthException","code":200}}
From the Facebook Graph API docs:
Most write operations require extended permissions[1] for the active user.
See the authentication guide[2] for details on how you can request extended
permissions from the user during the authentication step.
1 https://developers.facebook.com/docs/authentication/permissions
2 https://developers.facebook.com/docs/authentication/
Going by the blog post this is done via an app, for this to work the app needs the extended permissions 'publish_actions' and 'publish_stream' in order to make posts/comments/likes/links
i want to post daily note to facebook user profile which using my facebook application via it's own. how can i do it?
Since you didn't provide what language or what you've tried so far, these are quick tips to get you started:
Ask for the publish_stream permission
Then using your SDK or the technology you are using (source):
curl -F 'access_token=...' \
-F 'subject=This is a note' \
-F 'message=Test note.' \
https://graph.facebook.com/PROFILE_ID/notes
No need for the access_token parameter.
Okay.. i got the offline access session key
Can some please tell me how can i update my FB status using the offline access session key i have ?
Looked in the Graph API and PHP SDK but nothing helps
I assume when you say 'offline access session key' you mean the oauth access token.
Take a look at the 'Publishing to Facebook' section here: http://developers.facebook.com/docs/api#publishing
There is even a short example using curl:
curl -F 'access_token=...' \
-F 'body=Hello, Arjun. I like this new API.' \
https://graph.facebook.com/arjun/feed