Squiz Javascript API - use and installation

(Lewis) #1

The documentation says that it can be used “to enable the execution of core-level Squiz Matrix functions using JavaScript, allowing users to create, modify and retrieve content”.

I’ve got the API working using the Javascript code samples you’ve provided elsewhere in the documentation and successfully created a standard page but how do I add content (as something like “Hello, world!” to it using the API? I’ve seen mentioned elsewhere in the forum that you have to update the Content Container shadow asset but again, how do you do that using the JS API?

Also, how do I install the Content API package using just the cli in Red Hat on the Squiz virtual machine that’s downloadable from the Squiz website? Sorry … I’m not all that familiar with Linux. I’m guessing there’s a repository that I can use to download it using wget or something?

Really keen to get this working because it opens up the CMS to mobile users and provides more resilience.

(Bart Banda) #2

Hey Lewis,
If you are using the JS API and want to update content on a WYSIWYG container of a Standard Page, you first need to get the asset ID of that container and then use the setAttribute function to set the content attribute of the container.

The Content API package can be downloaded from the Marketplace: https://marketplace.squiz.net/extensions/content-api

Note that it is currently only a read-only API (content delivery api), so it won’t let you write data to Matrix (although we are working on evolving that this year).

(Lewis) #3

Thanks @Bart ,
Look forward to the development of the Content API. Do you have a timeline for its development? I’m keen to use it to open up the CMS to mobile users.

(Bart Banda) #4

The Content API is already available, see above link. The new Content Management API is due sometime later this year, looking at mid-year for initial release at this stage.