I want to get public reach and send a requests to the Facebook graph api. This is my request:
page_id/insights?metric=page_impressions&period=day&since=1557654435&until=1557740835&access_token=token
In response I get filed data with empty list.
Could you tell me with with what it can be related?
Related
I'm trying to call Users.messages: get api using POSTMAN:
Request type : GET
Request : https://www.googleapis.com/gmail/v1/users/<my-email>/messages/<id>?key=<API-KEY>
Authorization : Bearer-token : <access_token received on successful login using Google>
What is the value of id?
What else is required to be added ?
Why does this return this error?
400. That’s an error. Your client has issued a malformed or illegal request. That’s all we know.
The 400 error code means you are sending the request in the wrong way. I could guess it's because you are sending an id which doesn't exist, due to the fact you don't know what represents.
That id, as the docs says, represents:
The ID of the message to retrieve.
One easy way to retrieve the messages' id, it's using the Users.messages: list endpoint and then you can try to retrieve that specific message using the Try this API tool.
I want to get my hands dirty with code and start working on some small projects, so I decided to work on a facebook scraper that pulls feed from a public page and sends results via email.
when I try the URL : https://graph.facebook.com/page_id/posts?access_token=APP_TOKEN, I'm getting " This endpoint requires the 'manage_pages' permission or the 'Page Public Content Access' feature.
What am I missing?!
Thank you <3
In order to pull the feed with the Graph API, you need to:
Manage the Page, and use a Page Token of that Page to get the feed
or apply for Page Public Content Access, if you do not manage/own the Page
I wanted to make a facebook API request that will post a message to page that I am admin of. Here i found out how can i do that but after trying it out in facebook graph api explorer with this scheme:
graph.facebook.com/page-id/feed
?message=Hello&access_token=your-access-token"
assuming I have a developer account linked to my page and publish_pages and manage_pages permissions are enabled and page-id and acces-token are replaced with my real ones. The problem is that I get a response of latest post on that website, the same as if I would write just graph.facebook.com/page-id/feed and there is no new post on my page.
I dont know if the recent facebook API update removed or modified that or if its just not possible.
trying it out in facebook graph api explorer with this scheme
graph.facebook.com/page-id/feed?message=Hello&access_token=your-access-token
You are making a GET request here - and GET is for reading data, not creating it.
Creating data requires a POST request. So you can either switch the request method from GET to POST via the dropdown there, and then click + Add parameter to add your parameters and values;
or you can add &method=post to the end of your GET request query string here - that is a way the API offers to explicitly overwrite the request method in environments, where you can only make GET requests.
I am using wso2 1.10.0 api manager for first time. I need to access the http backend with simple query parameter. I published the api and tried either by setting as queryparam or json object, it's not giving me the expected result. I will get binary response or method not allowed. When tried setting only http endpoint I never got response its just keeping processing for long time. Please suggest me how do I access simple http backend. Need to show demo in a week.
Please help to solve this.
You get 'method not allowed' when you try to access a resource which was not defined for that method (say backend has POST method supporting resource only and you try to do a GET request)
I guess the issue is with the way you have defined the resources for the api from the publisher application. (invalid HTTP methods for resources)
If you think you have defined them correctly, then the next step to identify the issue is wirelogs. wirelogs provide all the info in request passing through the api manager gateway (request headers, body etc)
Follow this article http://mytecheye.blogspot.com/2013/09/wso2-esb-all-about-wire-logs.html on how to enable and read them
You can then directly call the backend (say curl -v to the backend) and compare the request from the direct call vs the one going out from
gateway to the backend and check the difference. This would help you start finding the issue
Since you are new to API manager, I would recommend you to do following first
Try out a simple scenario similar to your one. You can google it. This is from official documentation. would recommend to try out a simple scenario first. say https://docs.wso2.com/display/AM1100/Convert+a+JSON+Message+to+SOAP+and+SOAP+to+JSON
Then use SOAP UI or similar app to directly call the backend web service (not the api manager) and get the SOAP request and SOAP response for the backend.
Then create the api in API manager. you need to do the same thing in the sample i provided. only difference is the soap payload. use the previously collected SOAP messages.
Enable wire logs. for that see the comments in the previous answer. In wirelogs you will see >> and << signs
To read the wire log, first we have to identify message direction.
DEBUG - wire >> - This represent the message coming into API manager from the wire (will notice two set of these. one coming in to the
gateway from the rest client and response coming in to the api manager from the backend. )
DEBUG - wire << - This represents the message going to the wire from API manager (again two sets. request going from api manager to the
backend service and the response sent to the rest client from the api manager.)
the soap message will be printed in this log. check for the request going from api manager to the backend and the response coming from the
backend to the api manager. you can compare that to the onces you collected in the step 2 and do modifications if needed to the sequnces.
the wirelogs will also print the http headers. so check that as well.
hope you could set up a working sample using these steps
I'm making facebook graph api call for search user. Query is https://graph.facebook.com/search?q=vijay&type=user&access_token=MY_ACCESS_TOKEN.
I got empty response like {"data": []}.
But I'm make same API call with full name of user https://graph.facebook.com/search?q=vijaykrishnan&type=user&access_token=MY_ACCESS_TOKEN. Hear I got correct response.
I tried it via my application and Graph API Explorer. I got same result. Is there any issue in facebook side?