PHP wrapper for the billomat.net Data API
Used to retrive or change data from billomat.net ., (*1)
Description: This is your billomat ID which you use to login in your right Domain, (*2)
Description: This is the billomat API Key. Here you can find how to activate your API Key under the Headline Authentication. Here you can find it http://www.billomat.com/en/api/basics/, (*3)
Description: Output data in JSON-Object, false otherwise for XML-Object. Also you can use NULL to output data in HTML., (*4)
Param: boolen Default: FALSE, (*5)
Converts the dataobject if "TRUE" to Array. Use "NULL" for get HTML header., (*6)
Notice: not yet ready for usage, (*7)
Description: If true the request is done by socket, otherwise by curl., (*8)
Now take a look how we retrive Data from the "billomat API" we choose for this example to get all our Clients, (*9)
require_once 'billowrap.php'; $bmId = 'YourBillomatID'; // this is your billomatID you use to login $bmApiKey = 'YourApiKey'; // the API Key you will got it from billomat settings check the explanation http://www.billomat.com/en/api/basics/ $dataType = true; // Set to true, to output JSON Object, false otherwise for XML Object $convertData = false; // Convert the JSON or XML data to Array, false otherwise for not converting the object $billoWrap = new billoWrap($bmId, $bmApiKey, $dataType, $convertData);
Datatype will be which you set in the param 'dataType' (look the description of variable $dataType):, (*10)
$id = 12345; // the id for special Client you want to show // Output all data from Client output will be which you deside in $dataType $singleData = $billoWrap->getSingleClient($id); print_r($singleData); // Output all data from Client $allData = $billoWrap->getAllClients(); print_r($allData);
// string for datatransfer you are using JSON or XML which you predefined on dataType for reques type data $data = '{ "client" : { "first_name" : "Max", "last_name" : "Mustermann" } }'; $billoWrap->addClient($data);
// special client id integer $clientID = 1234; // send data which you want to edit same es add for dataType $data = '{ "client" : { "first_name" : "Mustermann", "last_name" : "Max" } }'; $billoWrap->editClient($clientID, $data);
$clientID = 1234; // just say which client id you want to delete and it is done $billoWrap->delClient($clientID);