The list of Alfresco services

    Alfresco is an integrated Enterprise Content Management system. Alfresco combines server and database. The interaction between client and server is by way of REST-services.

    REST is an architectural style of web-services based on existing well known standards  (such as HTTP, URI, XML) which are controlled by W3C consortium.

    The list of useful Alfresco REST- services, with detailed description

    To create defined type folder using  full path to parent folder

        url: "/../alfresco/service/api/site/folder/" + siteName + 
    "/documentLibrary/" + parentFolderPath
        method: "POST"
        json: {
            name: name
            type: folderType
        }

    siteName – website name created in Alfresco;
    parentFolderPath – path to parent folder;
    name -folder name;
    type – folder type.

    Example:

        url: "/../alfresco/service/api/site/folder/example/
    documentLibrary/books"
        method: "POST"
        json: {
            name: "Pushkin"
            type: "cm:folder"
        }

    After making the request “Pushkin” folder is created. This folder is situated in “books” folder of documents library on the “example” website.

    To create folder by nodeRef

    nodeRef  is an object id in Alfresco. Each object has its own nodeRef. This request creates new object inside given object of folder type.

        xml = '<?xml version="1.0" encoding="utf-8"?>' +
            '<entry xmlns="http://www.w3.org/2005/Atom" 
    xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/" 
    xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/">' +
            '<title>' + folderName + '</title>' +
            '<summary>' + folderName + '</summary>' +
            '<cmisra:object>' +
            '<cmis:properties>' +
            '<cmis:propertyId 
    propertyDefinitionId="cmis:objectTypeId">' +
            '<cmis:value>' + folderType + '</cmis:value>' +
            '</cmis:propertyId>' +
            '</cmis:properties>' +
            '</cmisra:object>' +
            '</entry>';
        url: "/../alfresco/service/api/node/workspace/SpacesStore/" + 
    nodeRef + "/children"
        method: "POST"
        headers: {
            "Content-Type": "application/atom+xml;type=entry"
        }
        xml: xml

    folderName – folder name;
    folderType –  folder type;
    nodeRef – folder id in Alfresco.

    Example:

        nodeRef = b544cd67-e839-4c60-a616-9605fa2affb7;
        xml = '<?xml version="1.0" encoding="utf-8"?>' +
            '<entry xmlns="http://www.w3.org/2005/Atom" 
    xmlns:cmisra="http://docs.oasis-open.org/ns/cmis/restatom/200908/" 
    xmlns:cmis="http://docs.oasis-open.org/ns/cmis/core/200908/">' +
            '<title>Example of creating a folder</title>' +
            '<summary>Example of creating a folder</summary>' +
            '<cmisra:object>' +
            '<cmis:properties>' +
            '<cmis:propertyId 
    propertyDefinitionId="cmis:objectTypeId">' +
            '<cmis:value>cm:folder</cmis:value>' +
            '</cmis:propertyId>' +
            '</cmis:properties>' +
            '</cmisra:object>' +
            '</entry>';
        url: "/../alfresco/service/api/node/workspace/SpacesStore/" + 
    nodeRef + "/children"
        method: "POST"
        headers: {
            "Content-Type": "application/atom+xml;type=entry"
        }
        xml: xml

    The folder named “Example of creating a folder” will be created inside directory.

    To get information about website

        url: "/../alfresco/service/api/sites/" + siteName
        method: "GET"

    siteName – website name created in Alfresco.
    Returns data in json format.

    Example:

        url: "/../alfresco/service/api/sites/example"
        method: "GET"

    Website data (in json format) will be returned. If such website doesn’t exist then the error 404 “Not found” will be returned with that json reporting about it.

    Select query with possibility to carry a query as parameter

        url: "/../alfresco/s/cmis/query?q="
        method: "GET"

    Example:

        url: "/../alfresco/s/cmis/query?q=SELECT * FROM cmis:folder 
    WHERE cmis:name='books'"
        method: "GET"

    After query execution the information about folder named “books” will be returned.

    To delete folder or document by nodeRef

        url: "/../alfresco/service/api/node/workspace/SpacesStore/" + 
    nodeRef + "/descendants?continueOnFailure=true"
        method: "DELETE"

    nodeRef – document/folder id in Alfresco.

    To get object data by nodeRef

        url: "/../alfresco/service/api/node/workspace/SpacesStore/" + 
    nodeRef
        method: "GET"

    Returns data in xml format.

    To get the data of object children by nodeRef

        url: "/../alfresco/service/api/node/workspace/SpacesStore/" + 
    nodeRef + "/children"
        method: "GET"

    Returns data in xml format.

    To update data in the object  by nodeRef

        url: "/../alfresco/service/api/node/workspace/SpacesStore/" + 
    nodeRef + "/formprocessor"
        method: "POST"
        json: jsonData

    Example:

        url: "/../alfresco/service/api/node/workspace/SpacesStore/
    4bf1/formprocessor"
        json: {
            prop_cm_name: "New name"
            prop_cm_title: "New title"
        }

    Change old name and title of the object with nodeRef equals 4bf1 to new name and title.

    If needed one can refill the list of updated fields by means of adding they to json in the form: prop_field name.

    Example:

        json: {
            prop_minPrice: 1 250
            prop_maxPrice: 50 250
        }

    Login

        url: "/../alfresco/service/api/login" 
        method: "POST"
        json: {
            "username": username 
            "password": password
        }

    Returns the ticket (authorisation identifier) in case of successful authorisation. The ticket lifetime is one hour. If such approach is taken then this ticket should be added in each request otherwise basic http authorisation will be requested.

    Example:

        url: "/../alfresco/s/cmis/query?q=SELECT * 
    FROM cmis:folder&alf_ticket=" + ticket
        url: "/../alfresco/service/api/sites/example?alf_ticket="
    + ticket

    Ticket validation checking

        url: "/../alfresco/service/api/login/ticket/" + ticket
        method: "GET"

    ticket – received at authorisation. If ticket is out of date then the error will be returned and basic http authorisation will be requested. If ticket is valid then current ticket will be returned.

    Logout

        url: "/../alfresco/service/api/login/ticket/" + ticket
        method: "DELETE"

    Useful links: