What are you looking for when you refer to 'policy status'? Like if it completed or failed? What is the goal you're trying to achieve?
To my knowledge, it's only possible to pull history from a device, meaning you can see the policies that have run on an individual computer, but I don't think the API lets you see an entire policy's logs. It would be a nice option to add to the API, but I don't think it currently exists.
What are you looking for when you refer to 'policy status'? Like if it completed or failed? What is the goal you're trying to achieve?
I would like to see if it completed or failed for the assigned computers. Essentially, just see the policy status that can be viewed in the dashboard.
To my knowledge, it's only possible to pull history from a device, meaning you can see the policies that have run on an individual computer, but I don't think the API lets you see an entire policy's logs. It would be a nice option to add to the API, but I don't think it currently exists.
I could likely make it work from pulling the history from a device. Is that available with the Jamf Pro API? I see computerhistory with the Classic API, but I don't see that with the Pro API.
I could likely make it work from pulling the history from a device. Is that available with the Jamf Pro API? I see computerhistory with the Classic API, but I don't see that with the Pro API.
Yeah, unfortunately it's only available right now from the classic API. But is there a reason you can't use that? Both APIs are viable for the time being. Eventually I imagine Jamf will remove the classic API, but probably not until many of the items only available in Classic make their way into the new one.
Yeah, unfortunately it's only available right now from the classic API. But is there a reason you can't use that? Both APIs are viable for the time being. Eventually I imagine Jamf will remove the classic API, but probably not until many of the items only available in Classic make their way into the new one.
If I can get the classic API to work, I would have no problem using it. I am able to get a bearer token and use the pro API, but I get access denied each time I try a URL for the classic API. I have the required privileges using an API client and secret.
From what I can find, it seems the method of acquiring a token is the same for the classic and pro APIs, so I'm really not sure where the issue is.
Yeah, unfortunately it's only available right now from the classic API. But is there a reason you can't use that? Both APIs are viable for the time being. Eventually I imagine Jamf will remove the classic API, but probably not until many of the items only available in Classic make their way into the new one.
Please disregard my previous response, I had a typo in my URL. I am getting a reponse using the following URL: 'https://domain.jamfcloud.com/JSSResource/computerhistory/id/id' but the response doesn't have any actual information it just returns:
xml computer_history
--- ----------------
version="1.0" encoding="UTF-8" computer_history
Yeah, unfortunately it's only available right now from the classic API. But is there a reason you can't use that? Both APIs are viable for the time being. Eventually I imagine Jamf will remove the classic API, but probably not until many of the items only available in Classic make their way into the new one.
I got it working with changing around the output format. Thank you for the assistance.
Please disregard my previous response, I had a typo in my URL. I am getting a reponse using the following URL: 'https://domain.jamfcloud.com/JSSResource/computerhistory/id/id' but the response doesn't have any actual information it just returns:
xml computer_history
--- ----------------
version="1.0" encoding="UTF-8" computer_history
This looks like you're using PowerShell. The response comes back as an object and you would have to "dive" down into that nested object. It will not simply "echo" the entire object to shell.