getServices

Beschreibung

GetServices liefert alle für diese Application-ID in der Datenbank hinterlegten Provider, damit d.h. Frontendanwendungen in der Lage sind, die korrekten Loginbuttons anzuzeigen.

Kommunikation zwischen

Consuming-Party Backend > allyve Backend

Request-URL

/api/sociallyve/client/application/services/<application-id>

Methoden-Typ

GET

allyve-Backendaktivität

Ermittlung aller hinterlegten Provider aus der Datenbank.

Response

JSON
Das Ergebnis ist ein JSON-Objekt in der üblichen Syntax für API-Results. Das Datenobjekt besteht aus einer einfachen Stringliste aller hinterlegten Provider (alle Namen in Kleinbuchstaben).

Ein exemplarisches JSON-Response-Objekt:

{"timestamp":"1312984657","data":{"resultList":["twitter","facebook"]}}

Code-Beispiel: PHP

//Your application's credentials for using the API
$myAppKey = '12345678910111213';
$myAppSecret = 'IWillNeverTellThisToAnyone';
 
//We want to get the available Services, so this is the API URL to use
$apiUrl = 'https://api.allyve.com/api/sociallyve/client/application/services/' . $myAppKey;
 
//let's call the API with the help of CURL
$curl = curl_init($apiUrl);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
//If you do not have alredy set up a CA cert bundle in PEM format uncomment the next line, BUT YOU SHOULD NOT DO THAT IN PRODUCTION
//curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);
 
//If you have a CA cert bundle set the path to it (http://curl.haxx.se/docs/caextract.html
$pathToMyCertBundle = getcwd().'/cacert.pem';
curl_setopt($curl, CURLOPT_CAINFO, $pathToMyCertBundle);
 
curl_setopt($curl, CURLOPT_POSTFIELDS, $queryStringSigned);
 
$result = curl_exec($curl);
//$result might look like this: {"timestamp":"1321979660","data":{"resultList":["twitter","google","linkedin","facebook","youtube","tonline","gmx","yahoo"]}}
 
curl_close($curl);

Zuletzt aktualisiert am 5. März 2012 von admin - Anmelden

Kommentare

Schreibe einen Kommentar