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.

Retrieving, updating, and deleting an entry using REST API

The following operations are available on the resource:

GET

The GET operation is used to get an entry from the form. The details of the GET operation are tabulated below:

Get single entry

DescriptionGet an entry from a particular form.
URL qualifier

/entry/{formName}/{entryId}

formName - The form for which an entry is to be read. 
entryId - The entry ID.

MethodGET
Headers
HeaderValue
Authorizationtoken
(optional) X-AR-Client-TypeClient Type ID
(optional) X-AR-RPC-QueueRPC queue to which the client calls are routed
(optional) X-AR-Timeout

Timeout (in seconds) for REST request

Default value —120 seconds

Parameters

Name

Description

fieldsSelects what parts of the JSON document to return (for example, ?fields=entryId1,entryId2).
expandExpands the related entries (associations).

For more information, see Common parameters.

ReturnsAn entry object.
All possible error codes

If the request is not successful, one of the following error codes is returned:

400 - Request body is incorrect

403 - Forbidden

404 - Form does not exist

500 - Internal Server Error

For more information, see HTTP status codes.

NotesThe entry object will contain field values for all data fields to which the user has permission.

    Request URL

    GET http://localhost:8008/api/arsys/v1/entry/SimpleForm/000000000000002
    

    Request header

    Authorization: AR-JWT eyJhbGciOiJIUzI1NiJ9.
    eyJleHAiOjE0MTc2NTM1ODgsInN1YiI6IkFsbGVuIiwibmJmIjoxNDE3NjQ5ODY4LCJpc3MiOi
    JXLUNTRUlFUk9FLTI5LmFkcHJvZC5ibWMuY29tIiwianRpI
    joiSURHQUFCRFVDMllHSUFONkJGUTJBQUFFUEZBNVFXIiwiX2NhY2hlSWQiOjQ3LCJpYXQiOjE0MTc2NDk5ODh9.
    V4LGLcEdwD8V_I4rzoWYYSZmEMA82LBB_lEfz4Xnz9Y

    Response Body

    HTTP/1.1 200 OK
    Date: Wed, 03 Dec 2014 22:53:46 GMT
    Content-Type: application/json
    Server: Jetty(8.1.15.v20140411)
    {
      "values":{
        "Request ID":"000000000000103",
        "Submitter":"Allen",
        "Create Date":"2014-12-03T22:53:37.000+0000",
        "Assigned To":null,
        "Last Modified By":"chris",
        "Modified Date":"2014-12-03T22:53:37.000+0000",
        "Status":"New",
        "Short Description":"testing 123",
        "Status History":{
          "New":{
            "user":"chris",
            "timestamp":"2014-12-03T22:53:37.000+0000"
          }
        }
      },
      "_links":{
        "self":[
          {
            "href":"http://localhost:8008/api/arsys/v1/entry/SimpleForm/000000000000103"
          }
        ]
      }
    }

    The following is a sample code snippet for the GET operation.

    package com.example;
    
    import java.nio.charset.StandardCharsets;
    
    import org.apache.http.HttpEntity;
    import org.apache.http.client.methods.CloseableHttpResponse;
    import org.apache.http.client.methods.HttpGet;
    import org.apache.http.impl.client.CloseableHttpClient;
    import org.apache.http.impl.client.HttpClients;
    import org.apache.http.util.EntityUtils;
    
    public class Get {
    
        public static void main(String[] args) throws Exception {
            String token = args[0];
    
            // start HTTP GET to get an entry
            CloseableHttpClient httpClient = HttpClients.createDefault();
            HttpGet httpGet = new HttpGet(
                    "http://localhost:8008/api/arsys/v1/entry/SimpleForm/000000000000002");
    
            // add the token to the header
            httpGet.addHeader("Authorization", "AR-JWT " + token);
    
            // make the call and print the status
            try (CloseableHttpResponse response = httpClient.execute(httpGet)) {
                HttpEntity entity = response.getEntity();
                String jsonEntry = EntityUtils.toString(entity, StandardCharsets.UTF_8);
                System.out.println(jsonEntry);
            }
        }
    
    }

    PUT

    The PUT operation allows you to modify an entry on the form. The PUT operation also allows you to modify an attachment for a particular entry or from list of entries. The details of the PUT operation are tabulated below:

    Update an entry

    This operation updates a single entry on the form.

    DescriptionThis operation updates an entry on a form.
    URL qualifier

    /entry/{formName}/{entryId}

    formName - The form for which an entry is to be updated. 
    entryId - The entry ID.

    MethodPUT
    Headers
    HeaderValue
    Authorizationtoken
    Content-Typeapplication/json
    (optional) If-Unmodified-SinceHTTP Date
    (optional) X-AR-Client-TypeClient Type ID
    (optional) X-AR-RPC-QueueRPC queue to which the client calls are routed
    (optional) X-AR-Timeout

    Timeout (in seconds) for REST request

    Default value —120 seconds

    Request BodyAn entry object in a JSON format
    Returns

    HTTP status code 204 indicates a successful update.

    If the client sends If-Unmodified-Since and the entry is modified since that time, then the entry is not updated and status code 412 is returned.

    Errors

    If the request is not successful, one of the following error codes are returned

    400 - Request body is incorrect

    403 - Forbidden

    404 - Form does not exist

    500 - Internal Server Error

    For more information, see HTTP status codes.

      The following example returns an updated entry in a Simple form.

      Request URL

      PUT http://localhost:8008/api/arsys/v1/entry/SimpleForm/000000000000002
      

      Request headers

      Authorization: AR-JWT eyJhbGciOiJIUzI1NiJ9.
      eyJleHAiOjE0MTc2NTM1ODgsInN1YiI6IkFsbGVuIiwibmJmIjoxNDE3NjQ5ODY4LCJpc3MiOi
      JXLUNTRUlFUk9FLTI5LmFkcHJvZC5ibWMuY29tIiwianRpI
      joiSURHQUFCRFVDMllHSUFONkJGUTJBQUFFUEZBNVFXIiwiX2NhY2hlSWQiOjQ3LCJpYXQiOjE0MTc2NDk5ODh9.
      V4LGLcEdwD8V_I4rzoWYYSZmEMA82LBB_lEfz4Xnz9Y
      
      Content-Length: 59
      Content-Type: application/json

      Request Body

      {
        "values":{
          "Submitter":"Allen",
          "Short Description":"testing 123"
        }
      }

      The following is a sample code snippet for the PUT operation.

      package com.example;
      
      import org.apache.http.StatusLine;
      import org.apache.http.client.methods.CloseableHttpResponse;
      import org.apache.http.client.methods.HttpPut;
      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 Put {
      
          public static void main(String[] args) throws Exception {
              String token = args[0];
      
              // start HTTP PUT to modify an entry
              CloseableHttpClient httpClient = HttpClients.createDefault();
              HttpPut httpPut = new HttpPut(
                      "http://localhost:8008/api/arsys/v1/entry/SimpleForm/000000000000002");
      
              // build the JSON entry
              String json = "{ \"values\" : { ";
              json += "\"Short Description\" : \"updated via REST\"";
              json += " } }";
              httpPut.setEntity(new StringEntity(json, ContentType.APPLICATION_JSON));
              httpPut.addHeader("Authorization", "AR-JWT " + token);
      
              // make the call and print the status
              try (CloseableHttpResponse response = httpClient.execute(httpPut)) {
                  StatusLine status = response.getStatusLine();
                  System.out.println(status);
              }
          }
      
      }

      Update an entry with attachments

      Description This operation updates an entry with an attachment.
      URL qualifier

      /entry/{formName}/{entryId}

      formName - The form for which an entry is to be updated. 
      entryId - The entry ID.

      MethodPUT
      Headers
      HeaderValue
      Authorizationtoken
      Content-Typemultipart/form-data
      (optional) If-Unmodified-SinceHTTP Date
      (optional) X-AR-Client-TypeClient Type ID
      (optional) X-AR-RPC-QueueRPC queue to which the client calls are routed
      (optional) X-AR-Timeout

      Timeout (in seconds) for REST request

      Default value —120 seconds

      Request Body

      A multipart/form-data entity. Each part of a multipart entity has a name, a Content-Type and the value.

      There is one part named as entry with Content-Type as application/json and the value is a JSON entry. There are 0 or more parts with names like attach-{fieldName} with any Content-Type and any value. The name is a prefix indicating that it is an attachment binary data, the part after the hyphen is the name of the attachment field. This updates an entry with attachment data.

      Returns

      HTTP status code 204 indicates a successful update.

      If the client sends If-Unmodified-Since and the entry is modified since that time, then the entry is not updated and status code 412 is returned.

      Errors

      If the request is not successful, one of the following error codes are returned

      400 - Request body is incorrect

      403 - Forbidden

      404 - Form does not exist

      500 - Internal Server Error

      For more information, see HTTP status codes.

      DELETE

      The DELETE operation allows you to delete an entry from a particular form. The details of the DELETE operation are tabulated below:

      DescriptionDelete an entry from a particular form.
      URL qualifier

      /entry/{formName}/{entryId}

      formName - The form for which entry is to be deleted.
      entryId - The entry ID.

      MethodDELETE
      Headers
      HeaderValue
      Authorizationtoken
      (optional) X-AR-Client-Type Client Type ID
      (optional) X-AR-RPC-QueueRPC queue to which the client calls are routed
      (optional) X-AR-Timeout

      Timeout (in seconds) for REST request

      Default value —120 seconds

      ReturnsNo request body, but HTTP status 204 indicates successful deletion.
      All possible error codes

      If the request is not successful, one of the following error codes are returned

      403 - Forbidden

      404 - Form does not exist

      500 - Internal Server Error

      For more information, see HTTP status codes.

      NotesYou can also use the option FORCE to force delete all the list of entries, for example, ?options=FORCE

        The following example allows you to delete an entry from the form.

        Request URL

        DELETE http://localhost:8008/api/arsys/v1/entry/SimpleForm/000000000000002
        

        Request header

        Authorization: AR-JWT eyJhbGciOiJIUzI1NiJ9.
        eyJleHAiOjE0MTc2NTM1ODgsInN1YiI6IkFsbGVuIiwibmJmIjoxNDE3NjQ5ODY4LCJpc3MiOi
        JXLUNTRUlFUk9FLTI5LmFkcHJvZC5ibWMuY29tIiwianRpI
        joiSURHQUFCRFVDMllHSUFONkJGUTJBQUFFUEZBNVFXIiwiX2NhY2hlSWQiOjQ3LCJpYXQiOjE0MTc2NDk5ODh9.
        V4LGLcEdwD8V_I4rzoWYYSZmEMA82LBB_lEfz4Xnz9Y

        Response Body

        HTTP/1.1 204 No Content
        Date: Wed, 03 Dec 2014 22:38:14 GMT
        Server: Jetty(8.1.15.v20140411)

        The following is a sample code snippet for the DELETE operation.

        package com.example;
        
        import org.apache.http.StatusLine;
        import org.apache.http.client.methods.CloseableHttpResponse;
        import org.apache.http.client.methods.HttpDelete;
        import org.apache.http.impl.client.CloseableHttpClient;
        import org.apache.http.impl.client.HttpClients;
        
        public class Delete {
        
            public static void main(String[] args) throws Exception {
                String token = args[0];
        
                // start HTTP DELETE to delete an entry
                CloseableHttpClient httpClient = HttpClients.createDefault();
                HttpDelete httpDelete = new HttpDelete(
                        "http://localhost:8008/api/arsys/v1/entry/SimpleForm/000000000000002");
        
                // add the token to the header
                httpDelete.addHeader("Authorization", "AR-JWT " + token);
        
                // make the call and print the status
                try (CloseableHttpResponse response = httpClient.execute(httpDelete)) {
                    StatusLine status = response.getStatusLine();
                    System.out.println(status);
                }
        	}
        }

        Related topics

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

        Comments

        1. Vara Kondiboina

          Hi, Can we do a PUT by search ?

          Example:

          Search incident Number INC002312425768 and update it. Please not Incident number is not a request ID field.

          URL: https://servername:8443/api/arsys/v1/entry/HPD:IncidentInterface/?q=%27Incident%20Number%27%20%3D%20%22INC000012425768%22

          Mar 31, 2020 02:41
          1. Anagha Deshpande

            Hello Vara,

            We are working on your query. We will respond soon.

            Regards,

            Anagha

            Mar 31, 2020 03:58
            1. Anagha Deshpande

              Hello Vara,

              You cannot use Put by search.

              Regards,

              Anagha

              Apr 01, 2020 03:17
        2. Anil Karicheti

          Can i delete multiple entries with single REST call ? In above example for delete its only mentioned for one request id. Could you please give more details on how to delete multiple entries with single request.

          May 11, 2020 07:58