tacticalrmm
tacticalrmm copied to clipboard
Return IDs of Newly Provisioned Clients, Users, Roles, Scripts in response to the POST
Currently, when executing a request to create new "objects" in TacticalRMM, the only thing returned is a success message of "X was added". It would be useful for API calls and scripting/integration purposes if the ID of the new object was returned in the response body. For example, to make multitenancy or client setup easier, one might want to create a client, a role, a user, a deployment, an API key etc through a series of API executions, each using an ID returned from a prior script to tie them all togehter.
+1 for this. After looking at the source, this should actually be pretty easy to add. However, I'm worried this might break the current GUI if it expects just the success message. I hadn't dug any further but was thinking that a new variable could be added to these API calls to return the new success message (let's say "returnid=1"). If that variable is omitted, simply assume it's 0 and return the old success message. This would just be a stop-gap until the entire GUI could be transitioned to the new return message.
It would also be good to return this as JSON so it could be easily parsed or expanded later.
+1 I would like the created object to be returned as json (like in the get request) because I'm syncing comments in our ERP to Tactical and it would make life easier.