Using Postman with JSS API

Contributor II


I'm wanting to really take advantage of what the API offers (as an example, adding one smart group of Shared iPads to all classes in the JSS in one go) and am wondering how I can use Postman to help with this? Is anyone using Postman with the current Jamf Pro API and is able to advise in this regard?


New Contributor III

You're going to be using the classic API endpoint as the UAPI endpoint doesn't have all the functionality that you would need at this time.

When you first open Postman, you may want to create an Environment and put your credentials (or your service account credentials if you have one for API apps) in there (username, password, jamf pro url).

Next maybe create a new Collection to help organize your API apps (such as a collection for iPads, Computers, etc.. however you want to organize).

Next, Create a new Request and save it to the appropriate collection for organization.

Toward the top right, select the appropriate environment from the dropdown box next to the eye icon.

You can change GET to the appropriate HTTP request (most likely POST or PATCH for what you described, but if you look at the API docs it will tell you what method to use).

For the URL, assuming you entered your jamf pro url in the environment as "server", the URL would be something like:

    {{server}}/JSSResource/<rest of the API url>

Just below where the request URL box is, go to the Authorization tab. From Type, select Basic Auth.

For username, type in {{user}} (this is referencing your Environment that you created above. If you named it "username", use {{username}} here instead).

For Password, select "Show Password" and type in {{password}} (again, assuming you created your environment and named your password variable "password").

If this is a POST or PUT request, you will likely have to put stuff in the Params tab.

That is the most basic explanation of how to use it for your purpose. While it works, I, being a Computer Science buff, would create a Python application and use Postman as a means of testing the output of different endpoints.

Good luck

Contributor II

Thanks for your reply, @nahrens. I'll make a start on setting the Postman environment up to test some things based on that guidance.

Do actions processed through Postman actually affect anything or is it simply a test environment that simulates action being done?

New Contributor III

@Ecco_Luke Yes Postman actually does affect your Jamf Pro environment. GET requests are used to get information while other requests (primarily POST, PUT, and DELETE) will update, create, or delete stuff from your Jamf Pro environment. Always a good idea to read the documentation thoroughly before running something. I always tested API calls on my Mac or iPad before actually using an app on other people's systems in case my calls were flawed. Good luck.

New Contributor III

@nahrens Thanks for the post! I am just getting started and tried to send a Get command as my first API call and didn't see the authentication panel. But after reading your post I found it and the command went successfully.

Contributor III

another tip: if you get random account errors, check the permissions for your api account. the whole time i thought it was an actual issue authenticating, when it was just that my api account didnt have the ability to modify groups