API Access to Incidents using Requested By to Filter

Looking to use the API to get a user's most recent incidents. Using the web interface, I can see that you can filter by user using requested_by. When doing this it uses a numeric ID, that thus far I've been unable to figure out how to get. It isn't the user id or the group id for the user. Any idea on how I can get this ID or another way to filter?

Thanks

Parents Reply Children
  • Howdy  ,

    You can get your user's IDs by starting with a GET Users query. Check the documentation here:
    https://apidoc.samanage.com/#tag/User/operation/getUsers

    Additionally/alternatively, you can see a user's ID in the URL when viewing their profile in the platform. For example: 
    app.solarwinds.com/.../8049635

    Another cool trick to learn more about the API is to add .json or .xml to the end of the URL for any record. Like an Incident or User, adding that to the end of the URL will display the app data in the respective language.

    Hope this helps!

  • Hi  

    I know how to get the user's ID. The issue is that the incident filter as best I can tell does not use the same ID. For example, I can see that one of my users ID is 8532955 using the /users/8532955 URL trick you indicate. Then if I go to an incident for that same user as the requestor, I'll see the following in the .json:

    "requester": {
    "id": 9220244,
    "account_id": 85721,
    "user_id": 8532955,

    The user_id matches there but whenever I try to filter the incidents using something like ?user_id=8532955 it doesn't work. If I build the filter with the GUI it will put in the filter requested_by=9220244, thus the question, where is this id coming from.