Matrix Version:
Hi,
I’m not sure where to start with this, if someone could give me a pointer that would be great.
How do you work with the JS API within squiz matrix?
- I created a JS API asset, how do I access it? (eg: which URL endpoint do I send the Ajax requests to? Can I have an example?)
http://<hostname>/?a=999999
- Where do I source the JS API library from? I assume I need some URL to load that into the page before using it to instantiate the objects. Or is it loaded automagically?
Documentation https://matrix.squiz.net/manuals/web-services/examples/basic-javascript-api-implementation says:
<script type="text/javascript" src="http://SYSTEM_ROOT_URL/_web_services/javascript-api.js">
but of course those keywords (if they are keywords at all) aren’t being substituted.
So far what I have within a container looks like this:
<script type="text/javascript" src="/_web_services/javascript-api.js"></script>
<script type="text/javascript" src="/?a=354779"></script>
<script>
var options = new Array();
options['key'] = '8972111019';
var js_api = new Squiz_Matrix_API(options);
</script>
Loading the JS File asset works, but javascript-api.js fails … and well I can’t test the JS API asset.
Thanks