REST operations on AR System forms
The REST API uses a resource to perform HTTP operations. A resource is an object with a type, associated data, relationships to other resources, and a set of methods that operate on it. The following are resources on which the actions are performed:
- An entry on a form
- A field on a form
An entry on a form
|Performs HTTP requests on just the form and allows you to create or search all entries on the form.
|Performs HTTP requests on an entry on a form and allows you to get, modify, and delete that particular entry.
|A field on a form
Performs HTTP requests on a field of a form and allows you to fetch field metadata.
The following table displayed common parameters for REST operations:
|Equivalent API call
|Get an entry
|Returns the details of an entry on a form.
|Get multiple entries
|Returns the details of all the entries on a form.
|Get List Entries With Fields
|Retrieving an attachment using REST API
|Returns an attachment for a particular entry or for the list of entries.
|Retrieving an association using REST API
|Returns the list of associated entries for a particular entry.
|Get a field metadata information
|Returns information about field metadata for requested field.
|Get multiple fields metadata information
|Returns information about multiple fields metadata.
|Get list of fields
|Creating an entry using REST API
|Creates new entry on the form.
|Merging an entry using REST API
|Merges an existing entry into a form.
|Updates a single entry on a form.
|Delete an entry
|Deletes an entry on a form.
Common parameters for entry APIs
The following table explains the list of parameters commonly used in the REST operations:
Returns parts of the entry object (fields and association links).
You can use values() with a comma-separated list of field names inside the parentheses to return only those field values.
You can use assoc to get links to all related entries.
You can also use assoc() with a comma-separated list of association names inside the parenthesis to get links following those associations.
Sends a search qualification.
Use a URL-encoded value for the search qualification.
Specifies the number (non-negative integer) of entries to offset the results by. Used for paginating results.
Offsets the result by 50 entries
|Specifies the number (non-negative integer) of entries to limit the results by. Used for paginating results.
Gets no more than 10 entries
Expands the related entry (associations). You can use assoc() for every association that you want to expand or retrieve the related entries.
Retrieves data related an entry with respect to association1 and association2.
Sorts results on a search by field name and direction. Multiple field names can be used, separated by commas.
The direction is indicated by appending .asc for ascending and .desc for descending after the field name.
Sorts first by Status in ascending order and then by Create Date in descending order.
Use in delete entry calls.
HTTP status codes
When responding to requests, the REST API uses some of the HTTP status codes. The following table gives a summary of the different status codes that are returned. Each operation specifies the response code you receive on successful calls or errors.
|This code is the default response for a successful API call. If the documentation does not specify a HTTP status code that is returned on a successful call, it is assumed to be 200.
|This code is used when you create new resources. REST includes the Location header in the response body, which denotes where the new resource is found.
|This code is similar to 200, but with no response body. This code is commonly used for DELETE operations.
|This code is used if the request body is not correct. For example, a JSON document is sent but it is not the correct format or the client sends a date value in the wrong format.
|This code is used if the user is not authenticated.
|This code is used when the call is authenticated, but the user does not have access to the resource. For example, an entry operation on a form to which the user does not have permission.
|This code is used when a resource does not exist.
|Internal Server Error
|This code is the default response for any error that occurs when an API call is being processed.
JSON representation of an error
The HTTP status codes are the response that classify the failure of the request. The HTTP status code is provided in the response header, whereas, the additional information for the error is provided in the response body. The following code sample represents the format of the message you receive when you encounter an error:
"messageText": "Form does not exist on the server",
|Type of message returned. For example, OK, ERROR, WARNING, FATAL, BAD STATUS.
|The actual text of the error message.
|The text that augments the error message.
|The AR error number associated with the error message.