Sending requests

All requests are made by sending an HTTP POST request to the URI for an
API method, for example,

The base URI for the OMA differs, depending on the OpenSRS email

The rest of the URI is the method name. For example, to call the get_user
method on Cluster A, you would send the following HTTP POST request: ADD LINK

Request format

Each OMA request consists of a single JSON object. That object must have a
credentials object, which contains a user string and either a password or a
session_token. The password is the user's password. Alternatively a session_token is a limited-lifetime token that can be generated by using the authenticate or the generate_token method.



In the examples provided in this guide, the name that you see in the user field indicates the minimum permission level required to submit the method, for example, [email protected] or [email protected].

The credentials object may contain a client key with a string value. This value is used for internal logging.

The request may also contain other key-value pairs, depending on the method being called.

	"user": "<user name>", 
  "password": "<user password>", 
  "token": "<session token>", 
  "client": "<client id string>"

Example request

			"user": "[email protected]", 
      "password": "sw0rdf1sh",
			"client": "My OMA Client v1.0"

Response format

All responses consist of a single JSON object that contains a success boolean value. If the value is false, the response object also contains an error number and text to help you determine what caused the error. Regardless of the value of success, the response may also contain some additional data. For requests that query or change multiple objects, the response may contain success and error fields for each object.

Example error response

	"success": false,
	"error_number": 1,
	"error": "Invalid credentials supplied in request"

Example success response

    "success": true,