Share This:

What is Postman?

 

Postman is a software development tool. It enables people to test calls to APIs. Postman users enter data. The data is sent to a special web server address. Typically, information is returned, which Postman presents to the user.

 

 

Installing Postman

 

You can download the app from their official website: Download Postman

 

 

Setting up Postman

 

You might see the screen below, it will show you a Launchpad page when you first run the app.

 

Click on Create a request.

 

 

When you see this screen you are ready to start using Postman.

 

 

 

 

Basic Login Test

 

In the first test, we will attempt for testing whether the Jetty server is working properly.

If this test is successful it will verify that we can log in to the AR Server with a REST API call and generate an authentication token.

 

Steps:

 

• Set the Request URL as: http//<server>:<port>/api/jwt/login

 

• Select the operation as POST.

 

 

 

• Click "Params" and enter the following two parameters:

> username
> password

 

User-added image

 

 

• Click "Headers" and enter the following:

> Content-Type = application/x-www-form-urlencoded

 

User-added image

 

 

•  Click Send

User-added image

 

• You should see a string returned in the "Body" section. This is the security token and it being generated means our first test is successful!

    > Copy the token value for later use.

 

User-added image

 

Creating an Incident Ticket

 

Now that we have an authentication token generated, we can perform tasks on the AR Server.

 

Let's test one of the most common tasks, creating a helpdesk ticket.

 

Steps:

 

• Set the Request URL as: http//<server>:<port>/api/arsys/v1/entry/HPD:IncidentInterface_Create

 

• Make sure the operation is still set as POST.

 

 

• Click Headers and enter the following:

> Content-Type = application/json
> Authorization = <paste the authentication token value from previous step>

 

User-added image

 

• Click Body

> Select raw
> From the list, select JSON
> Enter the JSON input for creating an entry:

{
  "values": {
    "First_Name": "Allen",
    "Last_Name": "Allbrook",
    "Description": "REST API: Incident Creation",
    "Impact": "1-Extensive/Widespread",
    "Urgency": "1-Critical",
    "Status": "Assigned",
    "Reported Source": "Direct Input",
    "Service_Type": "User Service Restoration",
    "z1D_Action": "CREATE"
 }
}

 

User-added image

 

• Click Send to send the request.

 

• In the "Body" section if you get a value of "1" returned then the new ticket was created successfully.

Creating an Incident Ticket & Get the Incident Number Back

 

After creating the ticket in the last step, it would have been nice if we got the incident number of the new ticket.

 

To do this we can perform the following steps:

 

• Set the Request URL is still set as: http//<server>:<port>/api/arsys/v1/entry/HPD:IncidentInterface_Create

 

• Make sure the operation is still set as POST.

 

• Click "Params" and enter the following parameter:

> fields = values(Incident Number)

 

Note: You can get back any field information this way.
For example, "values(Urgency, Organization, First_Name)" will return the Urgency, Organization name & First_Name of the user who created the incident.

 

 

• Click Headers and enter the following:

> Content-Type = application/json
> Authorization = <paste the authentication token value from previous step>

User-added image

 

• Click Body

> Select raw
> From the list, select JSON
> Enter the JSON input for creating an entry:

{
  "values": {
    "First_Name": "Allen",
    "Last_Name": "Allbrook",
    "Description": "REST API: Incident Creation",
    "Impact": "1-Extensive/Widespread",
    "Urgency": "1-Critical",
    "Status": "Assigned",
    "Reported Source": "Direct Input",
    "Service_Type": "User Service Restoration",
    "z1D_Action": "CREATE"
 }
}

 

User-added image

 

• Click Send to send the request.

 

• New Incident is created and the Incident Number is found in the response Body.

User-added image

 

 

 

Retrieving an Incident Ticket using Incident Number

 

Now let's take a look at how we can get details about an incident which we created before. We will use the ticket with Incident Number INC000000000517 that was created in the last step.

 

To do this we can perform the following steps:

 

• Set the Request URL as http://clm-pun-tybldc:8008/api/arsys/v1/entry/HPD:IncidentInterface

 

• Click "Params" and enter the following parameter:

    > q = 'Incident Number'="INC000000000517"

 

• Click Send to send the request.

 

 

• Body section should have all the details about this incident