Kaseya Community

How to obtain AgentProcID

  • Hi. I'm dabbling with automation using the REST API.

    To make calls I need the AgentProcID. This isn't something that is exposed in the VSA frontend (that i'm aware of). Thus far my database colleague has been getting it using some black art. 

    I was wondering if:
    A: there's a simple place where I can obtain the id?

    or

    B: Could i put some code in the procedure itself that could read it's own procid as a variable that I could capture and pass on to myself?

    Thanks in advance.

    Michael D

  • Try exporting the Agent Procedure you want to run/schedule and open the XML file with a text editor, the Agent Procedure Id should be in there.

  • You should be able to use a SQL query to pull the ID from the ScripIdTab table.
  • Thanks for the ideas so far. Is there truly no way of automating the process of obtaining the procid? Surely there's a hack that can be used in the procedure itself to get it's own properties?

  • Wait...you're using the REST API and can't find the AgentProcedureId???

    You use the API for that. GET /automation/agentprocs

    Are you just not familiar with the ODATA style filtering?:

    GET /automation/agentprocs?$filter=AgentProcedureName eq 'PROC_NAME'

    Whether it is in something like Postman one time to hard code it somewhere or a more interactive interface. You're already setup to interact with the API and even the correct endpoint if you are scheduling.