how to use https://api.facebook.com/method/fql.query?query= - api

Hi i need to use https://api.facebook.com/method/fql.query?query= to get user profile picture and other user information on PHP.
i know that https://api.facebook.com/method/fql.query?query= return some json or XML.
but i don't know how to get json to use.
thank you

PHP has built in json support. See json_decode manual.
And if you are wondering how to run FQL from PHP - it was just asked.

You can add a parameter format=json to get result in json format. So the url will be
https://api.facebook.com/method/fql.query?query=fql&format=json&access_token=t
By default format is xml.

The REST API has been deprecated. To make FQL queries you should use the Graph API. To do so, just issue an HTTP GET request to https://graph.facebook.com/fql?q= and provide your FQL statement as the value of the q parameter. For more info, check out the FQL documentation. You can use the Graph API Explorer to easily test FQL queries.

Related

Refference JSON schema from "define" API YAML file in Postman instead of creating a variable with actual JSON

I have an API in Postman that has defined JSON schemas for every request\response.
I also have a collection of tests that i use for testing this API.
But I don't know how to connect these two substances(things)
I have been searching for a solution for quite a while now and havent found an example set-up or a tutorial how? instead of creating a variable with actual schema in my test collection, I want to reuse already existing schema from API by $ref or some other link method.
This is my first question here, writing it just cause i haven't found a proper answer but functionality that i seek sounds really basic and logical.
Update from Valentin Despa:
"Please note that the API definition is written in a specification like Open API (or similar). It is not the same as the JSON schema which refers to the response body only."
So we can't validate response using that schema.

Can someone explain to me in what language this API code is written in?

I am supposed to create an API using this code. However I am not sure what language this is written in.
You are currently doing a curl using a shell:
See what is a shell(bash for example):
https://fr.wikipedia.org/wiki/Bourne-Again_shell
You are sending data using POST request, and for sending this data you are using a JSON format file.
I think you will have to create a webservice that accept JSON input
https://fr.wikipedia.org/wiki/JavaScript_Object_Notation
Please be more specific in your question, if it is not what you want.

ResultSet in JSON format using JAVA code

I have a java code that uses YouTube Data API to search for videos based on user entered query. I have the results stored in a Map Data structure of JAVA. I want to get the result in JSON format or store it in JSON file. Can someone please help me with it?
There are several libraries out there that will do this. Try Jackson or GSON.

How does api archive.org works?

As you surely know web.archive.org lets you inspect the history of a domain, ie:http://web.archive.org/web/*/besttatoo.com
I also has an API: http://archive.org/help/json.php
I need to get data from the API but I can't get many info on how to use it, has anyone used it and can paste some examples of use?
This link provides details about the item LovingU on archive.org:
http://archive.org/details/LovingU&output=json
To create an API query to your liking, use this page:
https://archive.org/advancedsearch.php#raw
That page allows you to choose your output format: JSON, XML, HTML, CSV or RSS and also the parameters your want to see. You can limit the number of results, too.

Yii Framework, JSON API, Restricted by URL

I am trying to build an API service for my Yii based website,
I have create an API controller with all the functions that returns objects in JSON format.
I also created a system to generate API keys for a specific URL... but I cant seem to understand how to detect the url from where the call is being made to my api so I can compare and validate.
I have tryed with HTTP_REFERER ...not working...
Any idea how is this possible ?
Thanks
try this:
Yii::app()->request->urlReferrer
or
Yii::app()->request->host
or
Yii::app()->request->hostAddress
for more details see http://www.yiiframework.com/doc/api/1.1/CHttpRequest