Hello,
I am currently working on a project which requires calling an external System via REST API GET/POST calls. We currently have multiple SwitchScriptTool projects (using Visual Code) which utilize Axios HTTP request module. We are able to GET and POST within the Projects using Axios.
My question for the community:
How can we use the JS scripts produced by the Transpile function within a Switch Workflow (Script Element)? Has anyone successfully achieved this? If so, what modules were used?
Thanks in advance for any information provided.
Micah
REST API GET/POST calls within Switch workflow via "Script Element"
Re: REST API GET/POST calls within Switch workflow via "Script Element"
Hi,
so really I don't know what you mean, this?
https://www.enfocus.com/en/learn/switch#scripting
I use in very much Scripts axios for API-Calls
Michael
so really I don't know what you mean, this?
https://www.enfocus.com/en/learn/switch#scripting
I use in very much Scripts axios for API-Calls
Michael
Re: REST API GET/POST calls within Switch workflow via "Script Element"
In a script element you point to an .sscript file, not to a JS file. Either that file is in a script folder with a size of 0 bytes. Or it is a packed script file in which case it has a certain size and it is a standalone package. You can pack the script folder using the SwitchScriptTool (run the tool without options to see the help, or read the documentation or watch the videos in the Learn section of our site).
The recommended practice is: use script folders during the development and use packed scripts in production.
The recommended practice is: use script folders during the development and use packed scripts in production.