editOrganisation
Ändert die Werte einer Organisation im Adressbuch.
| Route | /addressbook/editOrganisation[/:key[/:hash[/:format]]] |
|---|---|
| Erforderliche Parameter | hash |
| Optionale Parameter | name (POST) website (POST) description (POST) labelids (POST) billingStreet (POST) billingPobox (POST) billingCity (POST) billingState (POST) billingPostcode (POST) billingCountry (POST) deliveryStreet (POST) deliveryPobox (POST) deliveryCity (POST) deliveryState (POST) deliveryPostcode (POST) deliveryCountry (POST) format |
| Rückgabewerte | hash |
| Querschnittverbindungen | getLabels() – Diese Funktion enthält labelids. getOrganisations() – Enthält alle vorhandenen Organisationhashes |
| Hinweise | Alle Parameter, die nicht in der Route enthalten sind, werden per POST versendet. |
Parameter
| Bezeichnung | Beschreibung | Wertebereich | Standardwert |
|---|---|---|---|
| name | Organisationsbezeichnung | string | – |
| website | Internetadresse | string | – |
| description | Beschreibung | string | – |
| labelids | Zuordnung von Labels zu der Organisation | array | – |
| billingStreet | Rechnung – Adresse | string | – |
| billingPobox | Rechnung – Postfach | string | – |
| billingCity | Rechnung – Stadt | string | – |
| billingState | Rechnung – Bundesland | string | – |
| billingPostcode | Rechnung – Postleitzahl | string | – |
| billingCountry | Rechnung – Land | string | – |
| deliveryStreet | Versand – Adresse | string | – |
| deliveryPobox | Versand – Postfach | string | – |
| deliveryCity | Versand – Stadt | string | – |
| deliveryState | Versand – Bundesland | string | – |
| deliveryPostcode | Versand – Postleitzahl | string | – |
| deliveryCountry | Versand – Land | string | – |
| format | Legt fest in welchem Format das Ergebnis zurückgeliefert werden soll. | json|xml | json |
Rückgabewerte
| Bezeichnung | Beschreibung | Wertebereich |
|---|---|---|
| hash | Id der Organisation | (a-z0-9){32} |
Meldungen
| Nachricht | Beschreibung |
|---|---|
| no permission | Der Schlüssel hat keinen Zugriff auf diese Funktion. |
| internal error | Ein interner Fehler ist aufgetreten. |
| param missing | Ein erforderlicher Parameter wurde nicht übergeben. |
| param invalid | Der Wert eines übergebenen Parameters ist nicht gültig. |
| result empty | Die Bearbeitung der Anfrage war erfolgreich, aber das Ergebnis ist leer. |
| cost error | Der aktuelle Kreditumfang reicht nicht aus, um die Anfrage zu bearbeiten. |
| 0k. | Die Bearbeitung der Anfrage war erfolgreich. |
Beispielcode
$root = 'https://suite.xovi.net/api/';
$arrayParams = array(
'service' => 'addressbook',
'method' => 'addOrganisation',
'key' => 'myPersonalKey',
);
$pathString = implode('/', $arrayParams);
$requestURL = $root.$pathString;
$arrayParams = array(
'name' => 'MyOrganisation',
);
$paramsString = http_build_query($arrayParams);
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);
//setup POST
curl_setopt($ch, CURLOPT_POST, count($arrayParams));
curl_setopt($ch, CURLOPT_POSTFIELDS, $paramsString);
// 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"
}
]
}
XML
<?xml version="1.0"?>
<result>
<apiErrorCode>0</apiErrorCode>
<apiErrorMessage>0k.</apiErrorMessage>
<apiResult>
<organisations>
<organisation>
<hash>3957d580698c3345c9a962e077c44961</hash>
</organisation>
</organisations>
</apiResult>
</result>
