I am testing out some scenarios in my lab with Universal Automation. My testing with starting via API call does not seem to be working right, despite following the documented information.
I’ve got a script, which takes 2 mandatory inputs. Problem is that even though I’ve specified these parameters, the script stops to wait for input and shows no indication of parameters when looking at the job page.
Here is a sample of what I’ve been testing to make the call. Script has 2 mandatory parameters, which is what I’m attempting to pass.
got some change in progress at least, except now i get a 401 unauthorized error. This is odd since the same token i had no problem starting the script with the above method in the original post. I can use that token to perform a get on the script path too.
I’ve also tried creating a new token with full Administrator role and got the same result. Any thoughts?
That’s very strange. After looking at the source, both of those are calling the same service in the same way. What happens if you use the query string but the ID rather than the path?
Looks like that did the trick, changing to the number that corresponds to the script has allowed it to start.
While this will work, I would advise that doing it with the script.ps1 name would be good too, because I noticed the script ID changes if you cleanup old scripts no longer in use.
Right. That’s why I suggested it to begin with but it’s unclear to me why it doesn’t work in your environment while it does in mine. It could be some other route conflicting with it. You may be able to crank up the PSU log level and see what the authorization is attempting.
I guess the other thing you could do is use the HTTP GET to retrieve the script by name and then use the ID to invoke it. Still a bit of a mystery why this happens for you and not me.