Accessing the API with Postman

 

This tutorial assumes you have an app created, registered, and approved for our API. You also need a TechPulse account with a minimum role of Report Admin

 

Get Postman: https://www.getpostman.com/

 

Launch Postman (You can skip signing in and just use the App on your local machine)

 

Create a basic request:

Null

 

Now name your request something and create a “collection” to put it in. Null

 

An API can be thought of as a collection of routes or endpoints that return data to your code/tool based on parameters you send to it.

 

For this example we are going to use our Analytics API and the endpoint we will use is:

Null

 

 

You can find all of the available endpoints here in our docs: https://developers.hp.com/hp-proactive-management/api/hp-techpulse-analytics-api

 

You can even expand the endpoint there to see how to use it:

Null

 

 

Next lets go back to Postman.

Change the HTTP Request Type to POST

 

 

Now enter the following string into the url field:

https://daas.api.hp.com/analytics/v1/reports/hwinv/details/type/grid

 

This string is the domain of the US API, daas.api.hp.com, combined with the address of the endpoint we talked about earlier, /analytics/v1/reports/hwinv/details/type/grid. The https:// means we are using the encrypted https protocol so all communications are completely encrypted.

Null

Now press “send” and lets see what happens:

 

![create a basic reqquest](https://developers.hp.com/sites/default/files/hppmNull

 

Nothing is working because the API doesn’t know who we are.

 

We need to add details that will allow us to authenticate with the API.

 

Click Authorization

Null

Then oauth2 Null

 

Get new access token Null

 

 

Now we need to fill out all these details Null

 

The important fields that may not match what you see here are:

Callback URL
Client ID
Client Secret

You will need to populate these from what you have in developers.hp.com:

I suggest using a callback url of http://127.0.0.1:5000/

 

To get the clientid and secret go to developers.hp.com -> my apps -> click on your approved app to see its details

Null

 

Now copy and paste the rest of the parameters you need from here:

Token Name                   code
Grant Type                   Authorization Code
Callback URL                 {Insert what you have from developers.hp.com}
Auth URL                     https://daas.api.hp.com/oauth/v1/authorize
Access Token URL             https://daas.api.hp.com/oauth/v1/token
Client ID                    {Insert what you have from developers.hp.com}
Client Secret                {Insert what you have from developers.hp.com}
Scope                        Read
State                        RANDOMSTRING
Client Authentication        Send as Basic Auth header

 

Now click on Request Token

Null

 

Sign in with the same account you use for hpdaas.com

Null

 

Once successfully authed you will see this screen. Then click Use Token:

Null

 

Now reclick send and let’s see what we get:

Null

And That is all! You have successfully called our API!