I am experimenting with differnt API's of websites right now because I am building my own API for site, On bebo.com through there API they have a php cient which passes a key and secret that the owner of the app has. you then have a client library with a bunch of methods/functions you can call, all of the methods work like this:
public function score_getHigh($uid='', $name='') {
return $this->execute('score.getHigh', array('member_id' => $uid, 'name' => $name));
}
You can see they all just pass in a name of a function and put the params into an array and pass it through the execute(METHOD-NAME, METHOD PARAMS) function. This function then runs code like this
//execute function
//flatten array
foreach ($params as $k => $v) {
if (is_array($v)) {
$params[$k] = implode(',', $v);
}
}
To make a list of all the functions and params to run, it then POST or GET this to the API page with CURL and this is the result that comes back below in my browser if I visit the page myself in a browser instead of letting curl post it then I view the page source of the web browser it shows this array just how I posted it in the browser,
Array
(
[error_code] => 102
[error_msg] => Session key invalid or no longer valid
[request_args] => Array
(
[0] => Array
(
[key] => v
[value] => 1.0
)
[1] => Array
(
[key] => api_key
[value] => Qnw1Moc22Y9m3XY5zUZohbxiwfkURaPJpN3m
)
[2] => Array
(
[key] => method
[value] => friends.get
)
[3] => Array
(
[key] => call_id
[value] => 1262417906.33
)
[4] => Array
(
[key] => sig
[value] => 18b8592f383a5f0abc332745284a0e99
)
)
)
So finally the question here, What kind of response is this, it's not JSON and I don't think it is XML, what would this be called and the script that is trying to get this result with CURL, how can it process this back into something to work with?