JS API file path?


#1

Hi Guys,

 

      I was trying to create some assets using JS API (Standard Mode) by following this tutorial ...  https://manuals.matrix.squizsuite.net/web-services/chapters/basic-javascript-api-implementation

 

      I created the JS API asset in one of the nodes and then added a "Standard page" and copy and pasted the code from above URL ...

 

      I replaced the SYSTEM_ROOT_URL and API Key with my URL and key, 

 

      I am now getting 404 error on this URL http://SYSTEM_ROOT_URL/_web_services/javascript-api.js

 

      I have seen "Web Services" folder ... there is no such file (javascript-api.js) there ....

 

      Any help is very appreciated.

 

Cheers ...! 

 

 


#2

Never mind guys.... Able to fix that problem .... Now I am able to create the asset (Standard Page), but getting this error now ...

 

Uncaught TypeError: Cannot set property 'innerHTML' of null

 

printObject @ create-pages:853

success @ create-assets-api.js:98

ajaxRequest.onreadystatechange @ create-assets-api.js:144

 

Any ideas ..... !


#3

ok, I think the example (https://manuals.matrix.squizsuite.net/web-services/chapters/basic-javascript-api-implementation) is probably wrong ...

 

there is no element with id asset_area on the page .....that is why this code is failing 

 

var content = document.getElementById("asset_area");  content.innerHTML = '<pre>'+msg+'</pre>';


(Bart Banda) #4

Hey Paul,

Were you able to get it working? Have you tried using a Trigger and using the Create Asset Action instead?