No matter what I try I am getting a 403 error when trying to make a custom script. I swear it worked once, the first time, but then never again. The status code is:
403 Forbidden. You have no access to this file or folder.
Even though I have opened everything up… guest user can access scripts and the database table the script is accessing.
To call a custom script you have to set is_user_script to true. User scripts and custom scripts are the same thing. We’re trying to convert over to say ‘custom scripts’ but as you can see this is not complete.
My bad, you meant to add this argument when calling the script. OK. so now, when I do that, I get an error: failed to create v8 context.
I assume this means it cannot launch the javascript interpreter, and I assume further this is because its not supported or configured correctly on the windows bitnami install?
You are right there is a problem calling custom scripts from the API docs. We will look into it ASAP. Another way to call a custom script is to go to your DSP test console called test_rest.html.
For URL enter /rest/system/script/yourscriptname?is_user_script=true.
Set method to POST.
Click Submit.
After trying via the API Docs the scripting engine was not available as you saw, and I had to restart Apache. Then it worked from test_rest.html until I tried it again from the API Docs and it got messed up again. Sorry about this we will figure it out soon.
Hi @greywire, I have submitted this problem with the WAMP install package as a bug to our engineers. It is Issue #55 on GitHub, where you may track it and subscribe for updates.
Hi @greywire, we are working to resolve this issue but are getting inconsistent results across versions and browsers. I cannot get this problem to occur in Windows 8.1, using Chrome or Firefox, and with Bitnami DSP packages 1.8.0-0 or 1.8.2-0.
Could you let me know which OS and browser versions you observed this in?
Found the cause of 403 error on my previous post. The permission for the Role of the application must be allowed for at least the POST request. Now the script is executing but we are not able to get any parameters from the event object inside the custom script. The event object does not contain the other parameters passed. Is runScript the correct api to use for a custom script?
I tested this "return JSON.stringify(event);"
and I also tested this “return event;”
without going deeper into the PHP code on how custom scripts are being handled - I assume that an event object will not be returned by the custom script.
However, if you just want to test that the parameter is being read by your custom script.
Following the samples in the scripts provided by DSP.
You should try this "return event.n1;"
The n1 value should return under script_result.