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
  • Hi again Markus, (Im sure you're already sick of me :P )

    Instead of using the script we are now creating a request directly via the API by creating a record within the PersonWantsOrg table.

    We try a Post request to the PersonWantsOrg table with the following example body:
    {
    "values": {
    "UID_Org": " 5c490797-b3ae-47c5-b2da-f1bc0e9ab675",
    "UID_PersonInserted":"8e93db71-7dc8-4f7f-bb2e-66c1951e85a3",
    "UID_PersonOrdered": "8e93db71-7dc8-4f7f-bb2e-66c1951e85a3",
    "OrderReason":"Test request via api"
    }
    }

    but receive the following error:

    "responseStatus": {
    "message": "This employee Syed, Ashhad (ASHHADS) is not authorized to make requests at this point."
    }

    "number": 2133173



    I had a quick look through the program functions but I can't seem to find any obvious named ones that would allow a user to create a record in the database via the frontend (rest api).

    Any help is as always greatly appreciated.

    Ash

Reply
  • Hi again Markus, (Im sure you're already sick of me :P )

    Instead of using the script we are now creating a request directly via the API by creating a record within the PersonWantsOrg table.

    We try a Post request to the PersonWantsOrg table with the following example body:
    {
    "values": {
    "UID_Org": " 5c490797-b3ae-47c5-b2da-f1bc0e9ab675",
    "UID_PersonInserted":"8e93db71-7dc8-4f7f-bb2e-66c1951e85a3",
    "UID_PersonOrdered": "8e93db71-7dc8-4f7f-bb2e-66c1951e85a3",
    "OrderReason":"Test request via api"
    }
    }

    but receive the following error:

    "responseStatus": {
    "message": "This employee Syed, Ashhad (ASHHADS) is not authorized to make requests at this point."
    }

    "number": 2133173



    I had a quick look through the program functions but I can't seem to find any obvious named ones that would allow a user to create a record in the database via the frontend (rest api).

    Any help is as always greatly appreciated.

    Ash

Children
No Data