The Facebook Open Graph Debugger does a terrific job of taking a URL and parsing / loading it into a title / description / image / etc. Does this API expose a JSON format or does a similar service exist for 'linting' URLs into more rich objects? I'm trying to do an iOS integration. Obviously I'd like to avoid parsing XML and extracting the metadata myself if possible.
https://developers.facebook.com/docs/sharing/opengraph/using-objects#update
“This Graph API endpoint is simply a call to: POST /?id={object-instance-id or object-url}&scrape=true The response from this endpoint will be a JSON object that contains all the information about the object that was scraped (the same data returned when the Object ID is read from the Graph API).”
Related
I am trying to send an API request in my flutter App for filtering the items in my app. I want the data to be filtered between certain 2 numbers.
This is what I want.
http://3.237.223.130/careWorker/get-parttime-jobList?workingHoursFrom=02.30&workingHoursTo=03.00
but the API call going from the app looks like this
http://3.237.223.130/careWorker/get-parttime-jobList?workingHoursFrom=02%3A30&workingHoursTo=03%3A00
The '.' is being converted into '%3A'
How can I send the API request in the form I want?
Both of them is the same value.
Seems like the query parameters are being urlEncoded while sending via API.
I have attached the image to show you the example.
You can test the URL encoded and decoded value HERE.
I am trying to get the form data from a multipart/form-data POST to my ASW Lambda web service via API Gateway.
The HTTP POST has Content-Type "multipart/form-data" and body that is URL encoded. File data is also sent in this post (hence the multipart, I guess).
The web service needs to integrate with a thirdparty service, so changing the format of the POST isn't really an option.
I have seen this thread talking about converting the URL encoded data to JSON object for use in Lambda, but this doesn't do the trick.
I have also tried setting the Integration Request -> Mapping Templates for content type multipart/form-data to Input passthrough. This didn't help either.
I did come across another question about uploading a file using multipart/form-data, but since I'm not interested in the file, just the body, that answer didn't help.
Below find screenshot (sorry) of the captured post via runscope.
If the goal is to use Lambda, you'll need to pass valid JSON to the function. Currently there isn't a way to JSON-ify data inside Api Gateway that comes in as non-JSON data.
Our short term fix (on our backlog) is to provide a variable in the mapping templates to grab the raw input of the request. That way you could do a simple JSON conversion using a template like:
{
"body" : "$input.body"
}
or something like that.
Check out the mapping template reference for more info: http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-mapping-template-reference.html
Edit 4/7 - feature has been released as $input.body
I have started to work with REST APIs - specifically JIRA REST APIs.
I'm using the API to get response to a JIRA query but the JSON response I am getting contains lot of HTML chunk inside it.
It is not clean enough as showcased here
How can I use it in such a way to get a proper JSON response?
I think, JIRA response in JSON format only if request is successful, if request has any error than it comes in HTML response. actually that html belongs to the JIRA's error page. So correct your request, you will not get any response in HTML fomat. :)
In the app, I want to post a photo, and some text. I am able to post if I am using local stored data in resources but when data (in JSON format) is coming from server at the run time, I am not able to post that image and text which is coming from server in the JSON format.
Is there any way to post data at the runtime or I have to store the data at the client side, but in that case, the app will be bulky because data could be different at different locations?
I am not sure but you may be asking about posting an image using a URL instead of assuming data is local. If so, see this blog post - https://developers.facebook.com/blog/post/526/ and it introduced the ability to post an image by passing in a "url" parameter through the Graph API.
How to make facebook FQL query response in XML format?
You would have to have set your API Client's mode to XML. By default, it is responding in JSON these days (and the PHP client converts that to a PHP Array) but if you look at the API Test Console, you will see you can set the response mode of the client from XML, JSON, and what the PHP client returns.