I am trying to filter by user assigned. I am using the incidents operation; getIncidents from the API. I found this in the forum which helped a lot with querying via a time window:
https://thwack.solarwinds.com/product-forums/solarwinds-service-desk-swsd/f/forum/2638/api---incidents-based-on-created-date-parameters
I see a lot of query parameters being used but not documented nor mentioned here: https://apidoc.samanage.com/.
Does anyone have a source? Or is it possible to filter by assigned?
Thank you.
There's an API written in JavaScript on GitHub. https://github.com/eetay/samanage-api-js/blob/master/samanage-api.jsLooks like the only query parameters are date created, department, page, items per page, title, sort by, sort order? I see other options to query and filter by hash?
I am wanting to filter by assigned user. Is that possible?
They aren't documented currently. The best way to discover them is to build the filter using the website, and then inspect the URL afterwards to discover the parameters.
Oh wow, how do you do that? What tool do you suggest? Chrome debugger?
When you look at the URL, everything after the "?" and between the "&" symbols are parameters. Using the URL below as an example:
<a href="https://example.samanage.com/incidents?report_id=9277429&assigned_to%5B%5D=3501855&assigned_to%5B%5D=4938181&assigned_to%5B%5D=5037545&assigned_to%5B%5D=6772059&assigned_to%5B%5D=7383942&sort_by=number&sort_order=DESC&state_is_not%5B%5D=256618&state_is_not%5B%5D=256619">https://example.samanage.com/incidents?report_id=9277429&assigned_to%5B%5D=3501855&assigned_to%5B%5D=4938181&assigned_to%5B%5D=5037545&assigned_to%5B%5D=6772059&assigned_to%5B%5D=7383942&sort_by=number&sort_order=DESC&state_is_not%5B%5D=256618&state_is_not%5B%5D=256619</a>
You can see that assigned_to[]= and state_is_not[]= are the filter parameters. The %5B%5D stand for []
Okay, this sounds like you're stabbing in the dark, is that how this is discovered?
It's not the best situation, but yeah that's how people discover them. It's been a common ask for improved API documentation so hopefully this is something that they can improve in the future.
If you get stuck on any in particular, people in the forum are usually quick to help so let us know!
Thanks a lot. I appreciate your help.
So I tried this out and that does not seem to work. I played with the URL for a bit. I took out the square brackets and instead of using the assignee ID, I used the group ID. I checked if the assignee is placed in any group, and they are not. This URL gives me what I want but why the group ID and not the ID #999999? Very odd.
https://api.samanage.com/incidents.json?created=[Select+Date+Range]&created_custom_gte=[2022-04-23T08:28:00.6807143Z]&created_custom_lte=[2022-05-05T08:28:00.6807143Z]&assigned_to=100000&page=1&per_page=1000