This documentation supports the 19.02 version of Remedy Action Request System.

To view the latest version, select the version from the Product version menu.

General principles for using the REST API

The API follows the REST architectural style, so resources, HTTP verbs, and status codes are used. JSON is used for request and response bodies. The endpoints provided by the API are specified using the Swagger specification language.

The following principles are common to the endpoints provided by the Remedy AR System REST API.

Endpoint verbs

Where possible, endpoints use the following verbs consistently:

VerbPurpose
GETRetrieve a single resource, or collection of resources.
POSTCreate a new resource.

PUT

Update a resource, specifying the required target state of all fields. Any fields omitted are reset to default values or deleted, as appropriate for the endpoint.
DELETEDelete a resource.

Input encoding

When constructing the URL for an endpoint that contains a dynamic portion (either in the path or in the query string), ensure that you correctly encode the characters that are not permitted in a URL. For example, the following URL:

http://server name:port/api/arsys/v1/entry/User/formName?q=('Request ID'="entryID") 

is interpreted as follows:

http://server name:port/api/arsys/v1/entry/User/formName?q=%28%27Request%20ID%27%3D%22entryID%22%29 

For encoding reference, see  HTML URL Encoding Reference .

Similarly, if you are editing JSON request bodies manually, you must escape any reserved characters in your strings.

JSON format

JSON is used for both request and response bodies. If you are editing JSON request bodies manually, you must escape any reserved characters in your strings.

URL in response

Several POST endpoints create a new resource, which you can retrieve later using the REST API. In these cases, the response to the POST request contains a "uri" field, containing the URL of the newly created resource.

For example:

package com.example;
 
import org.apache.http.Header;
import org.apache.http.client.methods.CloseableHttpResponse;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.impl.client.CloseableHttpClient;
import org.apache.http.impl.client.HttpClients;
 
public class Post {
 
    public static void main(String[] args) throws Exception {
        String token = args[0];
 
        // start HTTP POST to create an entry with fields parameter
        CloseableHttpClient httpClient = HttpClients.createDefault();
        HttpPost httpPost = new HttpPost("http://localhost:8008/api/arsys/v1/entry/SimpleForm?fields=values(field1, field2)");
 
        // build the JSON entry
        String json = "{ \"values\" : { ";
        json += "\"Submitter\" : \"Allen\", ";
        json += "\"Short Description\" : \"testing 123\"";
        json += " } }";
        httpPost.setEntity(new StringEntity(json, ContentType.APPLICATION_JSON));
        httpPost.addHeader("Authorization", "AR-JWT " + token);
 
        // make the call and print the Location
        try (CloseableHttpResponse response = httpClient.execute(httpPost)) {
            Header locationHeader = response.getFirstHeader("Location");
            System.out.println(locationHeader.getValue());
            HttpEntity entity = response.getEntity();
        // Read the contents of an entity and return it as a String.
            String content = EntityUtils.toString(entity);
            System.out.println(content);
        }
    }
 
}

Pagination

Several endpoints have the potential to return large amounts of data in their responses. These endpoints follow a standard approach for returning paginated results. For example, a search for all Hosts in the system could find more than the default page limit of 100 results. In this case the endpoint returns the first 100 results, and additional fields that provide links to the next page:

http://<local hots>:<port number>/api/arsys/v1.0/entry/<form name>/?offset=0&limit=4
{  
"entries": [      
{          
"values": {              
"Request ID": "000000000000001",               
"Character Field": "Test",              
"Submitter": "Demo",               
"Drop-Down List Field": "Fruit",               
"Create Date": "2019-01-28T11:19:29.000+0000",              
"Radio Button Field__c": null,              
"Assigned To": null,               
"Last Modified By": "Demo",               
"Modified Date": "2019-01-28T11:20:16.000+0000",               
"Status": "Closed",               
"Short Description": "Demo",               
"Status History": {                   
"New": {                       
"user": "Demo",                       
"timestamp": "2019-01-28T11:19:29.000+0000"
                  },                  
"Closed": {                       
"user": "Demo",                      
"timestamp": "2019-01-28T11:19:50.000+0000"                   
}               
}           
},           
"_links": {               
"self": [                   
{                       
"href": "http://<Local host>:<port number>/api/arsys/v1.0/entry/<form name>/000000000000001"                   
}               
]          
}      
},      
{          
"values": {               
"Request ID": "000000000000002",              
"Character Field": "R1",              
"Submitter": "Demo",              
"Drop-Down List Field": "Veg",               
"Create Date": "2019-01-29T06:17:46.000+0000",              
"Radio Button Field__c": "March",               
"Assigned To": null,               
"Last Modified By": "Demo",               
"Modified Date": "2019-01-29T06:17:46.000+0000",               
"Status": "New",              
"Short Description": "Demo",
               "StatusHistory": {                   
"New": {                      
"user": "Demo",                       
"timestamp": "2019-01-29T06:17:46.000+0000"                   
}               
}           
},           
"_links": {    
           "self":
[                  
{                      
"href": "http://<Local host>:<Port number>/api/arsys/v1.0/entry/<Form name>/000000000000002"                   
}               
]           
}      
},       
{          
"values": {       
       "Request ID":000000000000003",               
"Character Field": "R2",              
"Submitter": "Demo",               
"Drop-Down List Field": "Egg",               
"Create Date": "2019-01-29T06:18:34.000+0000",               
"Radio Button Field__c": "March",              
"Assigned To": null,               
"Last Modified By": "Demo",               
"Modified Date": "2019-01-29T06:18:34.000+0000",               
"Status": "New",               
"Short Description": "Demo",              
"Status History": {                   
"New": {                       
"user": "Demo",                       
"timestamp": "2019-01-29T06:18:34.000+0000"                   
}               
}           
},         
  "_links": {               
"self": [                   
{                       
"href": "http://<Local host>:<port number>/api/arsys/v1.0/entry/<Form Name>/000000000000003"                   
}              
]           
}      
},      
{           
"values": {               
"Request ID": "000000000000004",              
"Character Field": "R4",              
"Submitter": "Demo",              
"Drop-Down List Field": "Milk",               
"Create Date": "2019-01-29T06:18:47.000+0000",               
"Radio Button Field__c": "March",              
"Assigned To": null,               
"Last Modified By": "Demo",               
"Modified Date": "2019-01-29T06:18:47.000+0000",               
"Status": "New",               
"Short Description": "SD4",               
"Status History": {                  
"New": {                      
"user": "Demo",                       
"timestamp": "2019-01-29T06:18:47.000+0000"                   
}               
}          
},          
 "_links": {              
"self": [                   
{                      
"href": "http://<Local host>:<Port number>/api/arsys/v1.0/entry/<form name>/000000000000004"                  
}               
]          
}      
}   
],   
"_links": {  
     "next": [           
{               
"href": "http://<Local host>:<Port number>/api/arsys/v1.0/entry/<Form Name>/?offset=4&limit=4"          
}       
],       
"self": [           
{               
"href": "http://<Local host>:<port number>/api/arsys/v1.0/entry/<form name>/?offset=0&limit=4"           
}       
]  
}
}

Here, the value of the "offset" field is the starting index of the first item in this page of results. The "limitfield defines the number of Instances to be retrieved. 

Error responses

Failed requests are indicated by returned 4xx (client error) or 5xx (server error) HTTP status codes. In some cases the response body might also contain an object that contains details of the error, with the following fields:

FieldMeaning
codeThe HTTP status code.
messageA description of what went wrong.

Do not rely on error responses containing a body. In particular, authentication or permission failures often have empty bodies to avoid information leakage to the caller. Here is an example request, resulting in the response 400 Bad Request

http://<local host>:8008/api/arsys/v1.0/fields/User/?field_type=A&field_ids=1
[ 
  {  
  "messageType": "ERROR",
  "messageText": "Unexpected use of query parameter", 
  "messageNumber": 8043,
  "messageAppendedText": "Either field_ids or field_type can be provided. Both set are not allowed." 
   }
]

Related topics

Integrating AR System forms with a third-party application by using REST API

End points in AR REST API

Was this page helpful? Yes No Submitting... Thank you

Comments