Facebook ads api: adcreative creation fails with error - facebook

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.

Related

drf social-oauth2 access_denied ,Your credentials aren't allowed

I'm trying to use this package https://github.com/RealmTeam/django-rest-framework-social-oauth2
In Google Example
When I try to request an access_token by
curl -X POST -d "grant_type=convert_token&client_id=<django-oauth-generated-client_id>&client_secret=<django-oauth-generated-client_secret>&backend=google-oauth2&token=<google_token>" http://localhost:8000/auth/convert-token
it's saying
{"error":"access_denied","error_description":"Your credentials aren't allowed"}
What should I put in
django-oauth-generated-client_id and django-oauth-generated-client_secret
is that the thing where you create new application or should I put the google's client and secret ids
I try both but still not working.
Also in
token=<google_token>
I try to put the Authorization code or the access_token in this image but still not working
enter image description here
Can someone help thank you

getting "project not found" when trying to do SonarQube curl GET request

I've just started using the SonarQube Web API in my SonarQube instance. I generated a user token per the api documentation.
To test out using the API I tried doing a simple GET request using curl in Powershell like this:
curl -u [user token] http://[SonarQube instance IP address]/api/project_branches/list?project=UserAdmin
All I get is this response: {"errors":[{"msg":"Project \u0027UserAdmin\u0027 not found"}]}
I've tried doing the curl request and passing the project parameter like this -d 'project=UserAdmin' and I get the same error response.
I'm not sure what I'm doing wrong.
I solved the issue. When the API endpoint calls for the project name it's the project key not the display name.
To get the project key, go to your SonarQube instance -> Administration -> Projects. The key will be listed next to the project name.

How to upload an archive via Graph API for instant game?

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?

Get Github Enterprise Stats using API

i am trying to fetch statistics of GitHub instance using the below command as per https://developer.github.com/enterprise/2.15/v3/enterprise-admin/admin_stats/
curl -u username:password https://<hostname>/api/v3/enterprise/stats/:all
However i am getting the below message. Please help me in fixing this issue
{
"message": "Not Found",
"documentation_url": "https://developer.github.com/enterprise/2.14/v3"
}
Since the documentation states:
It is only available to authenticated site administrators.
Normal users will receive a 404 response if they try to access it.
Check first if you are declared as a site admin on your GitHub Enterprise server.
The issue got sorted by removing : (before all) in the api

How to programmatically publish to a facebook feed for a liked webpage?

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