show-update-delete-office
Method shows/edits/removes office
- GET - view office information/settings
- POST - edit office settings
- DELETE - remove office
Parameters
No additional parameters
Getting office information
Returns selected office's data (office 1234567 in the example).
Example
Request
GET https://ws.idibu.com/ws/rest/v1/offices/1234567?hash=YOUR_HASH
Response
<?xml version="1.0" encoding="utf8"?>
<idibu generator="idibu" version="1.0">
<response>
<id>1234567</id>
<name>Test office</name>
<contacts>
<address>xxxxx</address>
<address-line1>yyyyy</address-line1>
<address-line2>zzzzz</address-line2>
<address-line3/>
<country>United Kingdom</country>
<postcode>12345</postcode>
<email>test@test.com</email>
<phone>123 456 789</phone>
<fax/>
<www>www.idibu.com</www>
<company-name>Test Company</company-name>
<need-authorization>No</need-authorization>
</contacts>
</response>
<status>success</status>
</idibu>
Updating office information
To update office information, pass an xml in the data parameter. Any field or block can be omitted - pass only the fields which need updating (office 1234567 in the example).
Example
Posted data
POST https://ws.idibu.com/ws/rest/v1/offices/1234567?hash=YOUR_HASH
<?xml version="1.0" encoding="UTF-8"?>
<idibu>
<name>Test office</name>
<contacts>
<address>xxxxx</address>
<address-line1>yyyyy</address-line1>
<address-line2>zzzzz</address-line2>
<address-line3/>
<country>United Kingdom</country>
<postcode>12345</postcode>
<email>test@test.com</email>
<phone>123 456 789</phone>
<fax/>
<www>www.idibu.com</www>
<company-name>Test Company</company-name>
<need-authorization>No</need-authorization>
</contacts>
</idibu>
Response
<?xml version="1.0" encoding="UTF-8"?>
<idibu generator="idibu" version="1.0">
<response>
<message>Office updated</message>
</response>
<status>success</status>
</idibu>
Deleting an office
To delete an office, use a DELETE request (office 1234567 in the example)
Example
Request
DELETE https://ws.idibu.com/ws/rest/v1/offices/1234567?hash=YOUR_HASH
Response
<?xml version="1.0" encoding="utf8"?>
<idibu generator="idibu" version="1.0">
<response>
<message>Office deleted</message>
</response>
<status>success</status>
</idibu>