How to send attachment by API Rest with Postman in Remedy

Version 2
    Share This:

    Hi community.

     

    The way to send attachments (to incidents in this case) using the Jetty API Rest architecture in Remedy is not clear in most articles, so I share the method that worked for me using Postman. However, you may find it useful to replicate it in development environments for productive integrations.

     

     

    Pre requirements

     

    • Have Jetty service configured, functional and accessible in the environment
    • Have Postman installed and functional with scope to the environment in question
    • Know the process to obtain the authentication token

     

     

    Once counting on these elements, we can start with the steps for the exercise:

     

     

    Step 1

    Create a POST entry to the address:

    https://servername:port/api/arsys/v1/entry/HPD:WorkLog

     

    Step 2

    Set the headings:

    Authorization: AR-JWT {{token}}

    Content-Type: application / json

     

    Post1.png

     

     

     

    Step 3

    Set the body

    Type: form-data

    An entry (with any name) and the next body as a value

     

    {

      "values": {

           "Incident Number":"INCIDENTNUMBER",

           "z1D Action":"CREATE",

           "Work Log Type":"General Information",

           "View Access":"Internal",

           "Secure Work Log":"No",

           "Detailed Description":"Add your description",

           "z2AF Work Log01":"chattext.txt"

          }

     

    }

     

     

    Entry value.png

     

    Where the ticket number and the name of the file to attach is important

    Contenty-type: application / json

     

     

    Add another entry with the name: attach-z2AF Work Log01

    Here we select file and load the desired file (whose name must match the one indicated in the body of the entry in step 3)

    Content-type: application / octet-stream

     

    Fileload.png

     

     

    Step 4

    Ready, we send our call.

    We will receive the confirmation in the response header with a URL

     

    SendPOST.png

     

     

    We have our file attached in the ticket:

     

    Adjuntadofinal.png

     

     

    Last Edition:

     

    I have the parameters to attach files to Work orders.

     

    URL: https://server:port/api/arsys/v1/entry/WOI:WorkInfo

     

    Apply step 2 and 3 with same parameters except the body, use this as entry value:

     

    {

      "values": {

        "Work Order ID":"WORKORDERID",

         "WorkOrder_EntryID":"WORKORDERID",

         "z1D_UserAction":"Create Entry",

         "Communication Source": "Other",

         "Work Log Type":"General Information",

         "View Access":"Public",

         "Secure Work Log":"No",

         "Description":"MY DESCRIPTION",

         "Detailed Description":"MY LARGE DESCRIPTION",

        "z2AF Work Log01":"myfile.txt"

    }

    }

     

    Take note that it need the two work order id parameters in order to send our file to the ticket.

     

    Finally we add the file entry with the name:

    attach-z2AF Work Log01

    and select the file (must match the name and extension of the previous entry body).

    Content-type: application / octet-stream

     

    Send the POST and that is all, we will have our file attached to the work order ticket.

     

     

    Thanks.