Obsolete Pages{{Obsolete}}
The official documentation is at: http://docs.alfresco.com
This page represents on-going design of the 3.1 Repository Public RESTful API for use by any client. As each service is implemented and formally described it becomes self-documenting allowing for the generation of the published reference documentation (which will also be available from an installed Alfresco Repository).
The 3.1 RESTful API interface includes all functionality available in the 3.0 REST API interface
Alfresco REST Design Guidelines
The scope of WCM Services Layer is heavily driven by the requirements of the preview release of Alfresco Web Studio.
Represents a collection of web projects
List all web projects in JSON format
Parameters:
GET /alfresco/service/api/wcm/webprojects
=> WCMProject[]
GET /alfresco/service/api/wcm/webprojects?userName=fred
=> WCMProject[]
Sample JSON data
{
data:[
{
'url' : '\/alfresco\/service\/api\/wcm\/webprojects\/buffy',
'webprojectref' : 'buffy',
'name' : 'buffy',
'title' : 'Buffy',
'description' : 'Site dedicated to buffy the vampire slayer',
'nodeRef' : 'workspace:\/\/SpacesStore\/dd7fc426-2367-4478-93fe-94444b37dfca',
'isTemplate' : false
} ,
{
'webprojectref' : 'smash',
'name' : 'smash',
'title' : 'smash',
'description' : 'smash',
'url' : '\/alfresco\/service\/api\/wcm\/webproject\/smash'
'nodeRef' : 'workspace:\/\/SpacesStore\/dd7fc426-2367-4478-93fe-94444b37dfcc',
'isTemplate' : false
}
]
}
Create a new web project
POST /alfresco/service/api/wcm/webprojects
=> WCMProject
Get a a single web project in JSON format
GET /alfresco/service/api/wcm/webprojects/{WebProjectRef}
Update a web project
PUT /alfresco/service/api/wcm/webprojects/{WebProjectRef}
=> WCMProject
Delete a web project
DELETE /alfresco/service/api/wcm/webprojects/{projectref}
list all users who have a role in the the specified wcm web project
GET /alfresco/service/api/wcm/webprojects/{projectref}/memberships
=> WCMUser[]
add/invite an existing user to a web project with the specified role.
Sample JSON data
[
{
'role' : 'ContentManager',
'person':
{
'userName' : 'admin',
'firstName' : 'Administrator',
'lastName' : '',
'url' : '\/alfresco\/service\/api\/people\/admin'
},
'url' : '\/alfresco\/service\/api\/wcm\/webproject\/smash\/membership\/admin'
}
]
POST /alfresco/service/api/wcm/webprojects/{projectref}/memberships
=> WCMUser/Role
Update a user's role - Not implemented - future
PUT /alfresco/service/api/wcm/webprojects/{projectref}/memberships/{userid}
=> WCMUser
Remove a user from a web project - deletes any resources they may have including unsubmitted items in their sandboxes.
DELETE /alfresco/service/api/wcm/webprojects/{projectref}/membership/{userid}
=> WCMUser
List all sandboxes for the specified wcm web project reference (projectref) :
REQUEST:
GET /alfresco/service/api/wcm/webprojects/{projectref}/sandboxes
RESULTS (JSON):
{
'data':[
{
'name' : 'fred's sandbox',
'sandboxref' : 'fred',
'url' : '\/alfresco\/service\/api\/wcm\/webprojects\/{projectref}\/sandboxes\/fred'
}
,
{
'name' : 'stage',
'sandboxref' : 'stage',
'url' : '\/alfresco\/service\/api\/wcm\/webprojects\/{projectref}\/sandboxes\/stage'
}]
}
An optional parameters 'userName' will restrict the list of the returned sandboxes
to those available to the specific user.
REQUEST:
GET /alfresco/service/api/wcm/webprojects/{projectref}/sandboxes?userName=fred
RESULTS (JSON):
{
'data':[
{
'name' : 'fred's sandbox',
'sandboxref' : 'fred',
'url' : '\/alfresco\/service\/api\/wcm\/webprojects\/{projectref}\/sandboxes\/fred'
}
]
}
When the user does not exist an empty JSON data set is returned:
{
'data':[]
}
Get the details about a specific sandbox.
REQUEST:
GET /alfresco/service/api/wcm/webprojects/{projectref}/sandboxes/{sandboxref}
RESULTS (JSON):
{
'data':
{
'name' : 'fred's sandbox',
'sandboxref' : 'fred',
'url' : '\/alfresco\/service\/api\/wcm\/webprojects\/{projectref}\/sandboxes\/fred'
}
}
Note that the JSON response is not an array of sandbox details.
Create a new sandbox, if the sandbox already exists does nothing.
POST /alfresco/service/api/wcm/webprojects/{projectref}/sandboxes
Submits the content currently in the sandbox
POST /alfresco/service/api/wcm/webprojects/{projectref}/sandboxes/{sandboxref}/submitter
headers: 'Content-Type':'application/json'
'payload'AYLOAD
Example Payload (JSON)
{
'label':'Submit Label',
'comment':'Submit Comment',
'all': 'true/false'
}
POST /alfresco/service/api/wcm/webprojects/{projectref}/sandboxes/{sandboxref}/submitter
Delete the specified sandbox, any contents are deleted.
Will need to be the owner or a content manager to use this method.
DELETE /alfresco/service/api/wcm/webprojects/{projectref}/sandboxes/{sandboxref}
Return a list of modified items within the sandbox.
New folders with content in them will only return the name of the folder and not
any of the content contained in the new folder; 'collapsed' as per existing WCM behaviour.
GET /alfresco/service/api/wcm/webprojects/{projectref}/sandboxes/{sandboxref}/modified
'path' :
Get the updated item details which are contained within this sandbox.
The result set is paged in order to handle potentially large result sets.
GET /alfresco/service/api/wcm/webprojects/{projectref}/sandboxes/{sandboxref}/assets?size={pagesize}&pos={pageposition}
Information about the specific asset
GET /alfresco/service/api/wcm/webprojects/{projectref}/sandboxes/{sandboxref}/assets/{assetref}
Add asset to sandbox.
POST /alfresco/service/api/wcm/webprojects/{projectref}/sandboxes/{sandboxref}/assets
POST /alfresco/service/api/wcm/webprojects/{projectref}/sandboxes/{sandboxref}/assets
The Dictionary services provides read-only access to the elements of the Alfresco content model, including types and aspects and their properties and associations.
TODO. The model needs to be extended to allow public and private model definitions. This should allow applications to interrogate the model to discover model elements (types and aspects) that are considered public i.e. creatable by end users as opposed to internal model definitions that are used by the core repository services and to support application features.
A map of classes, associations or properties indexed by their name.
Example JSON:
{
'cm:content' :
{
... output class/association/property details here ...
},
'cm:versionable' :
{
... output class/association/property details here ...
}
}
The Class data represents an Alfresco content model type or aspect and contains the following data:
Example JSON:
{
'name' : 'custom:myobject',
'isAspect' : false,
'title' : 'The Title',
'description' : 'The Description',
'parent' :
{
'name' : 'cm:object',
'title' : 'Object',
'url' : '/api/classes/cm_object'
},
'defaultValues' :
{
'custom:percentComplete' :
{
'name' : 'custom:percentComplete',
'defaultValue' : '10',
'url' : '/api/classes/custom_myobject/properties/custom_percentComplete'
},
'custom:duration' :
{
'name' : 'custom:duration',
'defaultValue' : '120',
'url' : '/api/classes/custom_myobject/properties/custom_duration'
}
},
'defalutAspects' :
{
'cm:versionable' :
{
'name' : 'cm:versionable',
'title' : 'Versionable',
'url' : '/api/classes/cm_versionable'
}
},
'properties' :
{
'cm:name' :
{
'name' : 'cm:name',
'title' : 'Name',
'url' : '/api/classes/custom_myobject/properties/cm_name'
},
....
}
'associations' :
{
'cm:translation' :
{
'name' : 'cm:translation',
'title' : 'Translation',
'url' : '/api/classes/custom_myobject/associations/cm_translation'
},
....
},
url: '/api/classes/custom_myobject'
}
The Property data contains information about an Alfresco types property and contains the following data:
Example JSON:
{
'name' : 'cm:name',
'title' : 'Name',
'description' : 'The name of the node',
'defaultValue' : '',
'dataType' : 'd:text',
'multiValued' : 'true',
'mandatory': 'true',
'enforced' : 'true',
'protected' : 'false',
'indexed' : 'true',
'indexedAtomically' : 'true',
'constraints' :
[
{
'name' : 'REGEX',
'params':
{
'pattern' : '....'
}
},
...
],
'url' : '/api/classes/cm_object/properties/cm_name'
}
The Association data represents an Alfresco either a child or general association between content types and contains the following data:
{
'name' : 'cm:translation',
'isChildAssociation' : true,
'title' : 'Translation',
'description' : 'A translated version of the node',
'protected' : false,
'source':
{
'type' : '<url for type>',
'role' : 'original',
'mandatory': true,
'many': true
},
'target':
{
'type' : '<url for type>',
'role' : 'translation',
'mandatory': true,
'many': true,
}.
'requiredChildName' : '',
'duplicateChildNameAllowed' : false,
'url' : '/api/classes/cm_content/childassociations/cm_transation'
}
Get a list of all the available classes (types and aspects) in the dictionary. This list can optionally be filtered by model namespace prefix and/or name. The list can also be filtered to return either only types or aspects.
Parameters:
GET /api/classes
?cf={classFilter?}&nsp={namespacePrefix?}&n={name?}
Get the details of a class (a type or aspect)
Note: class-name should include prefix, although use '_' instead of ':'. For example, use 'cm_content' instead of 'cm:content'
GET /api/classes/{class-name}
Gets a list of a classes sub-classes. This list can optionally be filtered by model namespace prefix and/or name. The list can also be filtered to return either only types or aspects. The recursive parameter indicates whether the results contain just the immediate children or all children.
Parameters:
GET /api/classes/{class-name}/sub-classes
?r={recursive?}&cf={classFilter?}&nsp={namespacePrefix?}&n={name?}
Get a list of the property definitions for a class.
Parameters:
GET /api/classes/{class-name}/properties
?nsp={namespacePrefix?}&n={name?}
Get a property definition.
GET /api/classes/{class-name}/propeties/{prop-name}
Get a list of the association definitions for a class.
Parameters:
GET /api/classes/{class-name}/associations
?af={associationFilter?}&nsp={namespacePrefix?}&n={name?}
Get an association definition.
GET /api/classes/{class-name}/associations/{assoc-name}
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.