Web Services module

So a real simple way to add a page called 'test_page' is:

    http://YOURWEBSITE/jsapi.js?key=YOURKEY&type=createAsset&id=PARENTID&type_code=page&asset_name=test_page

[quote]So a real simple way to add a page called 'test_page' is:

    http://YOURWEBSITE/jsapi.js?key=YOURKEY&type=createAsset&id=PARENTID&type_code=page&asset_name=test_page
[/quote]

Yeah, this is possible. Although the elegant solution is to just run the functions that are provided as they provide error checking and submit through ajax.

Also, the method might be changed to POST in the future to prevent GET requests in the way you have shown.

Oops, thought we were still talking about the Web Services APIs (as in the original post), which do use a similar format to the import script :ph34r:

hey matq, regarding the web services package (SSV), it comes with an API consisted of 8 sub APIs provide a means to manipulate Matrix via SOAP and Javascript, here is the functions list


CreateAsset

CloneAsset

GetAllStatuses

GetAsset

GetAssetFromURL

GetAssetTypeAttribute

GetAttributeValuesByName

GetAssetAvailableKeywords

GetAssetAvailableStatuses

GetAssetWebPaths

GetAssetURLs

SetAttributeValue

SetTag

TrashAsset

ApplyDesign

RemoveDesign

GetDesignFromURL

ApplyAssetPaintLayout

RemoveAssetPaintLayout

Download

Upload

GetFileInformation

CreateAssetLink

DeleteAssetLink

GetAllChildLinks

GetChildren

GetDependantChildren

GetDependantParents

GetLinks

GetLinkByAsset

GetParents

MoveLink

UpdateLink

SetMetadataSchema

GetMetadataFieldsOfSchema

GetMetadataFieldValues

RegenerateMetadataSchema

RegenerateMetadataAsset

GetMetadataValueByIDs

SetAssetMetadata

SetMetadataFieldDefaultValue

GetSchemasOnAsset

HasAccess

GetPermission

GetRole

SetPermission

SetRole

BasicSearch

AdvancedSearch

ReIndex

StartWorkflow

SafeEditAsset

CancelWorkflow

CompleteWorkflow

SetWorkflowSchema

ApproveAssetInWorkflow



You can either use a SOAP client from any languages to connect or simply call it with javascript while you are on the frontend of the system (it only support a single domain now). If you want more details, let me know =)

[quote]
hey matq, regarding the web services package (SSV)

[/quote]



The Javascript API asset is part of the Web Services Package, but it is GPL. :slight_smile:

Yeah, i know the API asset you contributed is GPL =), but the Web Services package - SSV version, consisted of a SOAP Server, SOAP APIs, and a Javascript API on top of the SOAP APIs as well.

Hey this is great.


I've actually built my own API to do most of this stuff lately (which I used to build a custom editing interface) but its great to see something like that make it into the mainstream release. Definitely something that will be very useful.



Is there any documentation about these methods and some examples?

[quote]
Yeah, i know the API asset you contributed is GPL =), but the Web Services package - SSV version, consisted of a SOAP Server, SOAP APIs, and a Javascript API on top of the SOAP APIs as well.

[/quote]



Sorry, I wasn't trying to correct you. I knew that you know, since you work at Squiz. I just wanted to clear that up for everyone else. :slight_smile:

The documentation for the web services package should be available soon. I will try to find an example and post it up some times this week.

[quote]
Is there any documentation about these methods and some examples?

[/quote]



Keep watching for the launch of the MySource Matrix Community where I will write up a nice tutorial that will feature each and every function of the JS API.

[quote]
Sorry, I wasn't trying to correct you. I knew that you know, since you work at Squiz. I just wanted to clear that up for everyone else. :slight_smile:

[/quote]



Ah that's cool, =), you know that i know that you know that i know … =P.

[quote]
Is there any documentation about these methods and some examples?

[/quote]



Another thing that I know you were interested in in the past, and is now in the JS API is a getLinkId() function. You can pass in the id or URL of a parent and child and it will return the link id between those two. :slight_smile: