This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Calling Scripts via Application Server RESTful API using Common_StartScripts permission not working

Hi,

We are trying to call a custom script via the Application Server RESTful API. 

We have made sure that the user who does this has an application role assigned which has the permission group Common_StartScripts. 
This application role also has the permissions groups Common_TriggerEvents and Common_StartCustomizerMethods, and the user can successfully call both events and methods directly via the API. 

When we call the custom script the following error is shown: 

(part of the returned json)

"number": 810323,
      "message": "You are not authorized to run this method.”

 

We believe the error could be due to the reason that the custom scripts within its code calls the FillOrder method. This is perhaps an issue as this method can only be executed via job server. Perhaps via the API when this script is called it presents this error before even running it? 
Currently we can call the custom script via a process chain which is tied to an Event, and  this event is then called via the API.

Is the above assumption correct or are we missing something?

Any help its greatly appreciated as usual.

Kind regards,

Ash

Parents
  • Question: Do you need to create an already approved and assigned request or do you want to create just a normal one?

    If it should be just a normal request you should create a normal PersonWantsOrg object, assign all properties and save it. Than you have an order like in the web-portal.

    The FillOrder method is required to create a PwO e.g. in state "Assigned". Its designed for an initial load of the IT Shop so, that user do not need to order all their existing products.

    The FillOrder method is also meant to be executed by the JobService. If you start the script directly over the API, the system user used to authenticate needs to  be marked with IsServiceAccount=1.

Reply
  • Question: Do you need to create an already approved and assigned request or do you want to create just a normal one?

    If it should be just a normal request you should create a normal PersonWantsOrg object, assign all properties and save it. Than you have an order like in the web-portal.

    The FillOrder method is required to create a PwO e.g. in state "Assigned". Its designed for an initial load of the IT Shop so, that user do not need to order all their existing products.

    The FillOrder method is also meant to be executed by the JobService. If you start the script directly over the API, the system user used to authenticate needs to  be marked with IsServiceAccount=1.

Children
No Data