This is the initial version of the UGAL API and is still subject to changes.
Email support@ugal.com with any question or comment.
UGAL API - Sites
The sites API application is available to UGAL partners only.
All requests need to be authenticated with the partner username and password.
Reading a collection of sites
| URL | GET @ http://www.ugal.com/api/v1/sites.xml |
|---|---|
| Filters |
?status={trial|active|deleted} ?reference={partnerReference} ?account={parterAccountName} |
| Pagination | ?p={pageId} |
Returns a collection of sites (25 sites per page):
// Status: 200 OK
<sites>
<site>
<name>acme</name>
<account>Acme, inc</account>
<reference>AC026835</reference>
<status>trial</status>
<link>http://www.ugal.com/api/v1/sites/acme.xml</link>
</site>
<site>
<name>qwerty</name>
<account>Qwerty Logistics</account>
<reference>QW081121</reference>
<status>active</status>
<link>http://www.ugal.com/api/v1/sites/qwerty.xml</link>
</site>
<site>
<name>kumatsu</name>
<account>Kumatsu Motors</account>
<reference>KU067225</reference>
<status>active</status>
<link>http://www.ugal.com/api/v1/sites/kumatsu.xml</link>
</site>
{...}
</sites>
Reading a site
| URL | GET @ http://www.ugal.com/api/v1/sites/{siteName}.xml |
|---|
Returns a representation of the site:
// Status: 200 OK
<site>
<name>qwerty</name>
<status>active</status>
<plan>planC</plan>
<intranet>true</intranet>
<apitoken>9mgqwwxfbnyefymzpcjbgr7kawx7fbmm</apitoken>
<account>Qwerty Logistics</account>
<reference>QW081121</reference>
<users>
<user>
<name>Andrew Morrison</name>
<email>andrew@qwerty-logistics.com</email>
<password>****</password>
<type>owner</type>
<status>active</status>
</user>
<user>
<name>Roger Peterson</name>
<email>roger@qwerty-logistics.com</email>
<password>****</password>
<type>admin</type>
<status>active</status>
</user>
</users>
<domains>
<domain>qwerty-logistics.com</domain>
</domains>
<created-at>2010-05-24T00:00:00Z</created-at>
<updated-at>2010-08-06T13:52:39Z</updated-at>
<expires-at>2010-08-24T00:00:00Z</expires-at>
</site>
Updating a site
- The status, plan, intranet, account, plan and reference properties can be updated.
- Send data in the request body only for the properties to be updated.
| URL | PUT @ http://www.ugal.com/api/v1/sites/{siteName}.xml |
|---|---|
| Body | <site>
<status>{active|deleted}</status>
<plan>{planA|planB|planC}</plan>
<intranet>{true|false}</intranet>
<account>Qwerty Logistics</account>
<reference>QW081121</reference>
</site> |
Returns the updated representation of the site:
// Status: 200 OK
<site>
<name>{siteName}</name>
{...}
</site>
Creating a site
- The site properties defined in the request body below are all required.
- The site status is always set to trial when the site is created.
- The intranet property is always set to false when the site is created.
- The first user specified is created as the owner of the site. Other users are discarded.
| URL | POST @ http://www.ugal.com/api/v1/sites.xml |
|---|---|
| Body | <site>
<name>qwerty</name>
<plan>{planA|planB|planC}</plan>
<account>Qwerty Logistics</account>
<reference>QW081121</reference>
<users>
<user>
<name>Andrew Morrison</name>
<email>andrew@qwerty-logistics.com</email>
<password>sup3ers3cr3t</password>
</user>
</users>
</site> |
Returns a 201 status code, a Location header and the representation of the site:
// Status: 201 Created
// Location: http://www.ugal.com/api/v1/sites/qwerty.xml
<site>
<name>qwerty</name>
{...}
</site>
