In this article we will see how to request HTTP API resources and use it in Cally Square project.
Below you can see an example of script written in Perl language, but you can use your favourite language.
The script can be used as reference for your needs and remember to set properly the result of the cURL command:
print "SET VARIABLE <CHANNEL_VARIABLE> \"<VARIABLE>\"\n";
Use script in Cally Square project
The script must be used as Command in AGI block:
And the variable set in the example.agi script will be available in Cally Square project.
As alternative of AGI Cally Square block, you can use System block assigning the result of the script as channel variable.