getOrganisations
Returns the organisations of the addressbook.
| Route | /addressbook/getOrganisations[/:key[/:format[/:limit[/:skip]]]] |
|---|---|
| required Parameters | – |
| Optional Parameters | format limit (max:1000) skip |
| return values | hash name website description labels billingStreet billingPobox billingCity billingState billingPostcode billingCountry deliveryStreet deliveryPobox deliveryCity deliverySate deliveryPostcode deliveryCountry phone fax assignedPersons |
| cross references | – |
| hints | resultCount: Shows the amount of the result without limits. Usefull for pagination. |
Parameters
| labeling | description | value margins | defauilt |
|---|---|---|---|
| format | Legt fest in welchem Format das Ergebnis zurückgeliefert werden soll. | json|xml | json |
| limit | Defines the amount of the returned results. (max:1000) | 0-1000 | 100 |
| skip | Defines the starting page of the result. One page equals the the value of limit. | (0-9)+ | 0 |
Return values
| labeling | description | value margin |
|---|---|---|
| hash | Id der Organisation | (a-z0-9){32} |
| name | Name der Organisation | string |
| website | Website der Org. | string |
| description | Beschreibung der Org. | string |
| labels | Array mit Labelids, die der Organisation zugeordnet sind. | array mit strings |
| billingStreet | Rechnung – Straße | string |
| billingPobox | Rechnung – Postbox | string |
| billingCountry | Rechnung – Bundesland | string |
| billingCity | Rechnung – Stadt | string |
| billingState | Rechnung – Land | string |
| billingPostcode | Rechnung – Postleitzahl | string |
| deliveryStreet | Versandt – Straße | string |
| deliveryPobox | Versandt – Postbox | string |
| deliveryCountry | Versandt – Bundesland | string |
| deliveryCity | Versandt – Stadt | string |
| deliveryState | Versandt – Land | string |
| deliveryPostcode | Versandt – Postleitzahl | string |
| E-Mail-Address | string | |
| phone | Phonenumber | string |
| fax | Fax | array |
| assignedPersons | assigned persons | array |
| format | format of the result | json|xml |
Meldungen
| message | description |
|---|---|
| maximum limit exeeded | The maximum limit is reached. |
| no permission | The key has no access to this function. |
| internal error | An internal error occured. |
| param missing | A required parameter is missing. |
| param invalid | The value of a parameter is not valid. |
| result empty | The request was successful, but the result itself is empty. |
| cost error | The current credit amount is not sufficient to handle the request. |
| 0k. | The processing was successful. |
Examplecode
$root = 'https://suite.xovi.net/api/';
$arrayParams = array(
'service' =>'addressbook',
'method' =>'getOrganisations',
'key' =>'myPersonalKey',
);
$GETparams = implode('/', $arrayParams);
$requestURL = $root.$GETparams;
if (!function_exists('curl_init')) die('cURL not available');
$ch = curl_init();
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_URL, $requestURL);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
// Download the given URL, and return output
$output = curl_exec($ch);
// Close the cURL resource, and free system resources
curl_close($ch);
echo $output;
Beispielergebnisse
JSON
{
"apiErrorCode": 0,
"apiErrorMessage": "0k.",
"apiResult": [{
"hash": "b4b292d0c16f20eee10a7754539a189c",
"name": "myOrg",
"labels": {
"label_0": "kbdnkaaa",
"label_1": "lbdnkaaa"
},
"website": "org.com",
"description": "new org in cologne",
"billingStreet": "orgstreet 2",
"billingPobox": "987654",
"billingCity": "cologne",
"billingState": "germany",
"billingPostcode": "2342334",
"billingCountry": "nrw",
"deliveryStreet": "orgstreet 2",
"deliveryPobox": "123456987654",
"deliveryCity": "cologne",
"deliveryState": "germany",
"deliveryPostcode": "456321",
"deliveryCountry": "nrw",
"email": "[email protected]",
"phone": "123456",
"fax": "3215640",
"assignedPersons": {
"assignedPerson_0": {
"hash": "23424lkjlkjwei3242",
"firstname": "assPers_firstname",
"lastname": "assPers_lastname"
}
}
}]
}
[/php]
XML
<?xml version="1.0" encoding="UTF-8"?>
<result>
<apiErrorCode>0</apiErrorCode>
<apiErrorMessage>0k.</apiErrorMessage>
<apiResult>
<organisations>
<organisation>
<hash>3957d580698c3345c9a962e077c44961</hash>
<name>myOrg</name>
<labels />
<website>titlevalue</website>
<description>firstnamevalue</description>
<billingStreet>lastnamevalue</billingStreet>
<billingPobox>functionvalue</billingPobox>
<billingCity>2000-01-02</billingCity>
<billingState>123</billingState>
<billingPostcode>beschreibungavlue</billingPostcode>
<billingCountry>emailvalue</billingCountry>
<deliveryStreet>emailvalue2</deliveryStreet>
<deliveryPobox>phonewordvalue</deliveryPobox>
<deliveryCity>phoneprivatevalue</deliveryCity>
<deliveryState>phonemodilevalue</deliveryState>
<deliveryPostcode>faxvalue</deliveryPostcode>
<deliveryCountry>facebookvalue</deliveryCountry>
<email>googleplusvalue</email>
<phone>twittervalue</phone>
<fax>xongvalue</fax>
<assignedPersons>
<assignedPerson_0>
<hash>4234fgdert32424</hash>
<firstname>person_firstname</firstname>
<lastname>person_lastname</lastname>
</assignedPerson_0>
</assignedPersons>
</organisation>
</organisations>
</apiResult>
</result>
