You must first enable the API feature under Configuration > General to access this functionality. Once enabled, you can login as host superuser to access the Configuration > API menu to generate your API keys.
You will also need some basic understanding of how the API service uses XML/JSON and the HTTP protocol to transmit data.
The API service uses Internet HTTP protocol to transmit data like ordinary Web pages. However, it will only accept POST method calls similar to form submissions by a Web page. If a GET request is received (such as navigating directly to the URL of the API
service from the Web browser), the API service will return a useful HTML page that you can use, in turn, to send a simple POST request for quick tries (any request made here will affect your environment's data).
Because it uses the same HTTP protocol as your Web site, it follows that the same timeout and server limitations apply to the API service as they do to your Web site. You may want to consider changing the default request timeout for your API call if you expect to initiate a long running request.
For security purposes, it is recommended to use the API service on a HTTPS (SSL) URL address to encrypt your transmissions.
XML and JSON are simply encoding formats used to transmit the data. Both formats are interchangeable. By default, the REST API will communicate using XML. To communicate using JSON, you need to pass the "Content-type: application/json" in your HTTP request header. Throughout this documentation, we'll simply refer the data in XML, but you can expect the equivalent notation is available in JSON.
The API service expects to receive a HTTP posted data in properly formatted XML or JSON for each method call. Any XML/JSON reserved characters must be properly encoded. A typical request will consist of the following nodes:
After submitting a request, you can expect to receive a typical HTTP status code response (200 OK, 403 Forbidden, etc.) as you would expect in normal Web requests. The common HTTP status codes are noted below. For a complete list, please consult the W3.org web site. The first verification is to ensure you are receiving the 200 OK status to ensure you are at least successfully communicating with the API service over the network.
If the operation succeeded, you can expect to receive the response data in XML format. A typical XML response will consist of the following nodes below.
The following table lists the possible service response codes returned in the XML/JSON. It is important to verify the response for the 2000 Success code to ensure there are no errors.
Powered by Revindex Wiki