Hi,
USG6000 Series & NGFW Module API can use HTTP GET method to obtain resource data on the API server. The URL field in the GET packet includes the path to the expected information and filter parameters. Filter parameters are optional. If no filter parameter is specified, all information is obtained. If the values of filter parameters contain ampersand mark, you shouuld use backslash character and ampersand mark(the format is \&) instead. Filter parameters vary with resources. For more information, see 4 Application of API.
General Parameters of GET Requests
The GET method supports three general parameters: vsys, pagesize, and pageindex, which are described as follows:
l Vsys specifies the virtual system where the data to be obtained resides.
l Pagesize specifies the maximum number of data records in a reply. The GET request of the USG6000 Series & NGFW Module API return data in pages. The maximum number of data records in a returned message is the maximum number of data records in a page. The maximum and default value is 100.
l Pageindx specifies the starting page number, which defaults to 1. If the total number of matched data records is 350, pagesize is 100, and pageindex is 2, the API server return the records No. 101 through No. 200 to the client. If the set pageindex and pagesize values exceed the total number of records allowed on the API server, the API server returns only the records on the last page to the client.
GET Request Example
The GET method does not carry data, which means that the Content-Length field in the header must be 0. Otherwise, the API server returns the 400 Bad Request error message.
The format of the GET request is as follows:
GET /system/information/ HTTP/1.1\r\n
Content-Type: application/x-www-form-urlencoded\r\n
Host: 192.168.101.10\r\n
Connection: Keep-Alive\r\n
Content-Length: 0\r\n
Cache-Control: no-cache,no-store\r\n
Cookie: SESSIONID=AQAAAIeDSFfJlKYa503duQ==&API\r\n
Token: a0jSVFvDAVkFMODatcwwNQ==\r\n
SN: 1\r\n
\r\n
The reply to data requests resembles:
HTTP/1.1 200 OK\r\n
Date: WED, 4 Feb 2015 16:27:23\r\n
Cache-Control: no-cache,no-store\r\n
Connection: Keep-Alive\r\n
Content-Length: 218\r\n
Content-Type: text/plain; charset=utf8\r\n
Cookie: SESSIONID=AQAAAIeDSFfJlKYa503duQ==&API\r\n
Token: a0jSVFvDAVkFMODatcwwNQ==\r\n
SN: 1\r\n
API-Version: 1.0\r\n
\r\n
<systeminfo><system-version>VRP (R) software, Version 5.30</system-version><clock><date-and-time>2015-02-04 08:27</date-and-time><time-zone>UTC add 00:00:00</time-zone></clock><sysname>USG6300</sysname></systeminfo>