The ref Member
In the event of an error that may occur for several reasons, the ref member may specify the reason
for the error. For example, if the client were to send an incorrect value for a JSON member, then
the server may be able to identify which member had the incorrect value.
NOTE:
There are errors in which a ref member is neither necessary nor useful, so it may not
appear for all errors.
Sample Request
POST /api/v1/hosts
HTTP/1.1
Content-Type: application/json
Host: storsys1:8080
Accept: application/json
{"name":abc}
Sample Response
HTTP/1.1 400 Bad Request
Date: Tue, Wed, 21 May 2013 22:15:52 GMT
Server: hp3par-wsapi
Content-Type: application/json
Connection: close
{"code":60,"desc":"JSON syntax error","ref":"name"}
HTTP Error Codes
In addition to the API-specific error information, the response to a client request that has failed will
include an HTTP error code. Each API error code is associated with an HTTP status code as shown
in
"Generic WSAPI code Member Status and Error Codes" (page
The following is an example of a bad client request, followed by the server response showing how
the API error code 5 is associated with HTTP status code 403 Forbidden:
Request
POST /api/v1/credentials HTTP/1.1
Content-Type: application/json
Host: storsys1:8080
Content-Length: 44
Expect: 100-continue
Accept: application/json
{"password":"not bob's password","user":"bob"}
Response
HTTP/1.1 403 Forbidden
Date: Tue, Wed, 31 Oct 2012 22:15:52 GMT
Server: hp3par-wsapi
Content-Type: application/json
Connection: close
{"code":5,"desc":"invalid user or password"}
Request Input and Optional Members
For some API operations, such as POST, the client passes a JSON object as the message body.
The JSON object includes required parameters, or members, for the operation and may include
optional members as well. Most operations have optional members.
17).
Request Input and Optional Members
25