PostMan & Domo APIs

PostMan & Domo APIs

Photo by Ilya Pavlov on Unsplash

Let’s talk about Domo APIs, and let’s give you a good example of how to start using PostMan to start making API calls with this tool. Maybe you will be wondering why you will need to learn how to use the API, but the best answer is because you will need to do something more efficient instead of spending a lot of time with manual testing.

First Step:

  • Go to the postman website, and download the app. (You can use this piece of software with windows & mac)

  • Also, I will recommend you to create an account with them.

Pay attention to details:

You will need to have a client ID, Secret ID, and the Scopes where you will like to dig to get into that specific data inside of Domo. To do that, you will need to do the following:

  • Click on the Developer Domo Website.

  • Log in to your account.

  • After you logged in, you will need to click on “My Account” and click “New Client”

  • Everything will look like this: https://screencast.com/t/EM89FKInVD.

By doing this, you will get assigned to your application a Client ID, & Secret ID to authenticate and authorize your API requests.

Also, you will need to keep in mind that a good name & a good description will help you to understand what are you trying to do. In other words, this name and description will be the best reference for future projects or to see what type of requests you made in the past.

One important thing is that you will need to decide to use the right application scope to make sure you make the right call with the right end-points. After that, you will need to click in create.

At this point, you have been completed the first step.

Second Step:

  • You will need to open your PostMan application and log in to your account. The reason why I recommend you to log in to your application is that you will be able to save all the API calls that you are making to make sure you will not re-type all the same information all over again.

  • The next step is creating a new collection. Please take a look at my screenshot to see what I’m talking about “https://screencast.com/t/N38iqqQfdmR."

  • An example of a Name of your new collection can be “Domo Test, Test, Domo, Etc.”

Third Step:

  • You will have a new window, and this one will look like this https://screencast.com/t/FajAp7mHzSg.

  • In your next step, you will need to use part of the Domo documentation to know what will be the best way to request the URL for the authorization token (api.domo.com/oauth/token?grant_type=client_..). In fewer words, you will need to add this link to the “Enter Request URL” filter.

  • Then, you will need to click on the tab called “Authorization” & Select the type of authorization that you have to make sure you can select from the Type drop-menu “Basic Auth.”

  • Next, you will have the username & password field ready to be set up. Your username is your Client ID & your password is your secret ID.

  • This is how it would look: https://screencast.com/t/N2882qfythTC.

  • If you click send, you will see in the Response space your authorization token.

  • https://screencast.com/t/8lVwxd77BxLA

    If for some reason, you don’t remember your client ID and secret ID, you will need to go back to the developer Domo site “https://developer.domo.com/manage-clients."

At this point, you already have access to your token, meaning that you will have access to get into your data without having any other restrictions. However, this token will last only 1 hour. If you need more time, you will need to request a new token. If you save the last call that you make, you will only need to click on “Send” to make sure you will have the new token.

Examples of API calls that you can make:

Let’s say that you would like to export your data. The first thing that you will need to know is the Domo Instance and the Link to that specific information. As en example of all of this is:

  • The HTTP method that you need is to have a GET and the following URL “https://api.domo.com/v1/datasets/df313f64-18a6-48a1-bbb5-5a98faa3ecf6/data?includeHeader=true&fileName=test.csv."

  • As you can see, the beginning of this URL is part of the Domo documentation, then you have the dataset id, then you will see the specification to have a header and a file name in the file that we are trying to export from Domo.

  • Inside of the Paraams Tab, you will need to make sure that your Query Params (Key & Value) are grabbing the right data with the right information that you requested.

  • In this case, you will need to double-check that your Key is “includeHeader & fileName” & the Value is “True & test.csv.”

  • Please go ahead and click on the following link: https://screencast.com/t/dhTtfYqzrl

  • The last thing that you will need to add is on the Headers tab. Here you will need to add two different key values (Authorization & Content-Type). Inside of these fields, you will need to add the following values (bearer token & text/CSV).

  • By doing this, you will need to understand that your token doesn’t need any encapsulation, you will need to give a little space in between the word bearer and the token.

    Also, you will need to make sure that you don’t share this token with anyone since is private information from your business account.

  • Now, you will need to click “send” & you will notice that you will have the information that you were asking through the API calls.

  • Please take a look at the following screenshot to see the end result of this API call. https://screencast.com/t/bMhqjZ2QPehk

    If you as an end-user, you would like to download the CSV file, you will need to click on Save Response, and you will need to choose in between these two “Save as example or Save to a file.” As you can see in here: https://screencast.com/t/XrXh724Sf82.

If you have questions, you will need to email me at . Please take a look at my website, repl, twitter, Github, Spanish Medium Account, and LinkedIn.

Please don’t forget to have a wonderful day and don’t forget to enjoy everything that you do — Coders_forlife.