Construction of the POST Data

The header for the POST data should have the following format. Replace the items in bold with user- and command-specific information.

POST / HTTP/1.0
Content-Type: text/xml
X-Username: OpenSRS Username
X-Signature: MD5 Signature
Content-Length: Length of XML Document

Following this header should be one blank line followed by the XML document that contains the OpenSRS command data. The header combined with the XML makes up the packet that is sent to OpenSRS to execute your command.

Response Messages

The response is returned in the form of an XML document. Responses contain data that may be simple strings or lists of information.

Common fields

There are a few common fields that all responses share, regardless of the action to which they are responding. The following fields comprise a standard response message. Some actions only use standard response messages.

Parameter name

Definition/Value

protocol

The protocol that is being used (XCP).

action

In the case of responses, this is always REPLY.

response_code

Response code (meaning is action-specific).

response_text

Response text (meaning is action-specific).

is_success

Indicates whether the command was successful. Returns 0 if not successful and 1 if the action was successful.

Optional fields

In addition, the structure may contain the following fields, depending on the specific action that was requested.

Parameter name

Definition/Value

attributes

A hash that contains any specific parameters or attributes to be sent along with the action request.