Pro Alfresco Appendix A
Transcript of Pro Alfresco Appendix A
❘ 1
PART VAppendices
� APPENDIX A: RESTful API Reference
� APPENDIX B: Surf Platform API Reference
� APPENDIX C: Repository FreeMarker Template API
� APPENDIX D: Repository JavaScript API Reference
� APPENDIX E: Surf Quick Reference
ARESTful API Reference
This appendix contains the full list of the publicly available Web scripts that compose theAlfresco RESTful API. The Web scripts are organized by package.
CALENDAR
This section describes the Calendar Web scripts within the /org/alfresco/calendar
package.
Retrieve Day EventsThe following Web script retrieves day events.
GET /alfresco/service/calendar/RetrieveDayEvents?d={requiredDate}&s={currentSpace}
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ extension: The format style
➤ html: The default response format
Retrieve Event DefaultsThe following Web script retrieves event defaults.
GET /alfresco/service/calendar/RetrieveEventDefaults?s={spaceRef}
4 ❘ APPENDIX A RESTFUL API REFERENCE
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ extension: The format style
➤ html: The default format response
Retrieve Event DetailsThe following Web script retrieves the details of an event.
GET /alfresco/service/calendar/RetrieveEventDetails?e={eventId}
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ extension: The format style
➤ html: The default format response
Retrieve Month EventsThe following Web script retrieves monthly events.
GET /alfresco/service/calendar/RetrieveMonthEvents?d={requiredDate}&s={currentSpace}
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ extension: The format style
➤ html: The default format response
Retrieve Week EventsThe following Web script retrieves weekly events.
GET /alfresco/service/calendar/RetrieveWeekEvents?d={requiredDate}&s={currentSpace}
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ extension: The format style
➤ html: The default format response
Calendar ❘ 5
Save Calendar EventThe following Web script saves calendar events.
GET /alfresco/service/calendar/SaveCalendarEvent?what={whatEvent}&where={whereEvent}&desc={descriptionEvent}&color={colorEvent}&fd={fromDate}&ft={fromTime}&td={toDate}&tt={toTime}&e={eventId}&d={toDelete}&s={spaceRef}
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ extension: The format style
➤ html: The default format response
Remove Calendar SubscriptionsThe following Web script removes calendar subscriptions.
POST /alfresco/service/calendar/calendarRemove
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ any: The format style
➤ html: The default format response
Calendar EventsThe following Web script provides calendar events.
GET /alfresco/service/calendar/getCalendarEvents
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ any: The format style
➤ html: The default format response
CalendarThe following Web script provides a list of available calendars from which you can subscribe orunsubscribe.
GET /alfresco/service/calendar/calendarInit
6 ❘ APPENDIX A RESTFUL API REFERENCE
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ any: The format style
➤ html: The default format response
Calendar SubscriptionsThe following Web script provides calendar subscriptions.
POST /alfresco/service/calendar/calendarSubscriptions
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ any: The format style
➤ html: The default format response
Calendar ColorThe following Web script provides the color of the subscribed calendar.
GET /alfresco/service/calendar/getColor
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ any: The format style
➤ html: The default format response
Set Calendar ColorThe following Web script sets the calendar color.
POST /alfresco/service/calendar/setColor
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ any: The format style
➤ html: The default format response
Repository Web Scripts ❘ 7
Event ListingThe following Web script provides a list of all upcoming events.
GET /alfresco/service/calendar/events/{nodeId}
The Web script description document specifies the following options:
➤ guest: The authentication access
➤ required: The transaction level
➤ extension: The format style
➤ json: The default format response
Calendar FeedThe following Web script provides the calendar iCalendar feed.
GET /alfresco/service/calendar/feed/{nodeId}
The Web script description document specifies the following options:
➤ guest: The authentication access
➤ required: The transaction level
➤ any: The format style
➤ html: The default format response
REPOSITORY WEB SCRIPTS
This section describes the repository Web scripts within the /org/alfresco/repository package.
AuthenticationThis section describes the authentication Web scripts.
LoginThe following Web script provides a login and establishes a ticket.
GET /alfresco/service/api/login?u={username}&pw={password?}
The following inputs are available:
➤ username: The cleartext user name (must be URL-encoded)
➤ password: The cleartext password (must be URL-encoded)
For example, the JSON for this Web script would be:
{"username" : "myuser","password" : "mypassword"
}
8 ❘ APPENDIX A RESTFUL API REFERENCE
It returns the new authentication ticket. The user name and password are provided as URL argumentsthat may be logged by proxies or the Alfresco server. Use the alternative POST method of login insteadof the GET method.
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ any: The format style
➤ xml: The default format response
Login (POST)The following Web script provides a login, establishes a ticket, and then returns the newauthentication ticket.
POST /alfresco/service/api/login
The following inputs are available:
➤ username: The cleartext user name
➤ password: The cleartext password
For example, the JSON for this Web script would be:
{"username" : "myuser","password" : "mypassword"
}
The Web script description document specifies the following options:
➤ none: The authentication access
➤ required: The transaction level
➤ any: The format style
➤ json: The default format response
LogoutAfter the user has logged out, the ticket is no longer valid, and subsequent attempts to use it will fail.
DELETE /alfresco/service/api/login/ticket/{ticket}
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ any: The format style
➤ xml: The default format response
Repository Web Scripts ❘ 9
Validate Login TicketThe following Web script validates the specified ticket.
GET /alfresco/service/api/login/ticket/{ticket}
The ticket may be invalid, or expired, or the user may have been locked out.
For security reasons, this Web script does not validate the ticket of another user.
➤ If the ticket is valid, it returns STATUS_SUCCESS (200).
➤ If the ticket is not valid, it returns STATUS_NOT_FOUND (404).
➤ If the ticket does not belong to the current user, it returns STATUS_NOT_FOUND (404).
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ any: The format style
➤ xml: The default format response
TouchThe following Web script is an SSO authentication touch point.
GET /alfresco/service/touch
It returns a 200 OK status.
The Web script description document specifies the following options:
➤ guest: The authentication access
➤ none: The transaction level
➤ argument: The format style
➤ Determined at runtime: The default format response
ActivitiesThis section describes the Activities Web scripts within the /org/alfresco/repository/activities
package.
This package contains the following child packages:
➤ /org/alfresco/repository/activities/feed
➤ /org/alfresco/repository/activities/feed/control
Activity Type TemplateThe following Web script gets the activity type template.
GET /alfresco/service/api/activities/template/{path}GET /alfresco/service/api/activities/template/{path}?format=text
10 ❘ APPENDIX A RESTFUL API REFERENCE
The Web script description document specifies the following options:
➤ admin: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ text: The default format response
Activity Template PathsThe following Web script gets a collection of the template paths.
GET /alfresco/service/api/activities/templatesGET /alfresco/service/api/activities/templates?format=jsonGET /alfresco/service/api/activities/templates/{path}GET /alfresco/service/api/activities/templates/{path}?format=json
The Web script description document specifies the following options:
➤ admin: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
Activities FeedThis section describes the Activity Feed Web scripts.
This package contains the following child packages:
➤ /org/alfresco/repository/activities/feed/sitefeed.get
➤ /org/alfresco/repository/activities/feed/userfeed-admin.get
➤ /org/alfresco/repository/activities/feed/userfeed.get
Activities Site FeedThe following Web script allows currently logged-in users to get feeds for specified sites (if a privatesite, then the user must be a member or an admin user).
GET /alfresco/service/api/activities/feed/site/{siteId}GET /alfresco/service/api/activities/feed/site/{siteId}?format=atomfeedGET /alfresco/service/api/activities/feed/site/{siteId}?format=jsonGET /alfresco/service/api/activities/feed/site/{siteId}?format=rss
The Web script description document specifies the following options:
➤ admin: The authentication access
➤ required: The transaction level
Repository Web Scripts ❘ 11
➤ argument: The format style
➤ text: The default format response
Activities Admin User FeedThe following Web script allows an admin user to get feeds for a specified user.
GET /alfresco/service/api/activities/feed/user/{userId}GET /alfresco/service/api/activities/feed/user/{userId}?format=atomfeedGET /alfresco/service/api/activities/feed/user/{userId}?format= jsonGET /alfresco/service/api/activities/feed/user/{userId}?s={siteId}GET /alfresco/service/api/activities/feed/user/{userId}?s={siteId}& format=atomfeedGET /alfresco/service/api/activities/feed/user/{userId}?s={siteId}& format=jsonGET /alfresco/service/api/activities/feed/user/{userId}?s={siteId}&exclUser={false?}&exclOthers={false?}GET /alfresco/service/api/activities/feed/user/{userId}?s={siteId?}&exclUser={false?}&exclOthers={false?}&format=atomfeedGET /alfresco/service/api/activities/feed/user/{userId}?
s={siteId?}&exclUser={false?}&exclOthers={false?}&format=json
The Web script description document specifies the following options:
➤ admin: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ atomfeed: The default format response
Activities User FeedThe following Web script allows a currently logged-in user to get their feed.
GET /alfresco/service/api/activities/feed/userGET /alfresco/service/api/activities/feed/user?format=atomfeedGET /alfresco/service/api/activities/feed/user?format=jsonGET /alfresco/service/api/activities/feed/user?s={siteId?}GET /alfresco/service/api/activities/feed/user?s={siteId?}&format=atomfeedGET /alfresco/service/api/activities/feed/user?s={siteId?}&format=jsonGET /alfresco/service/api/activities/feed/user ?s={siteId?}&exclUser={false?}&exclOthers={false?}GET /alfresco/service/api/activities/feed/user?s={siteId?}&exclUser={false?}&exclOthers={false?}&format=atomfeedGET /alfresco/service/api/activities/feed/user?s={siteId?}&exclUser={false?}&exclOthers={false?}&format=json
The Web script description document specifies the following options:
➤ admin: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
12 ❘ APPENDIX A RESTFUL API REFERENCE
Activities Feed ControlsThis section describes the Activity Feed Controls Web scripts.
This package contains the following child packages:
➤ /org/alfresco/repository/activities/feed/control
Activity User Feed Controls DELETEThe following Web script unsets the activity feed control (opt-out) for the currently logged-in user.
DELETE /alfresco/service/api/activities/feed/control?s={siteId}&a={appToolId}DELETE /alfresco/service/api/activities/feed/control?s={siteId}&a={appToolId}&format=json
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ any: The format style
➤ json: The default format response
Activity User Feed Controls POSTThe following Web script sets the activity feed control (opt-out) for the currently logged-in user.
POST /alfresco/service/api/activities/feed/controlPOST /alfresco/service/api/activities/feed/control?format=json
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ any: The format style
➤ json: The default format response
Activity User Feed Controls GETThe following Web script gets the activity feed controls (opt-outs) for the currently logged-in user.
GET /alfresco/service/api/activities/feed/controlsGET /alfresco/service/api/activities/feed/controls?format=json
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ any: The format style
➤ json: The default format response
Repository Web Scripts ❘ 13
BlogsThis section describes the Blogs Web scripts within the /org/alfresco/repository/blogs
package.
This package contains the following child packages:
➤ /org/alfresco/repository/blogs/blog
➤ /org/alfresco/repository/blogs/post
➤ /org/alfresco/repository/blogs/posts
BlogThis section describes the Web scripts within the /org/alfresco/repository/blogs/blog childpackage.
Blog GETThe following Web script gets the blog information.
GET /alfresco/service/api/blog/site/{site}/{container}/{path}GET /alfresco/service/api/blog/site/{site}/{container}GET /alfresco/service/api/blog/node/{store_type}/{store_id}/{id}
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
Blog PUTThe following Web script updates a blog.
PUT /alfresco/service/api/blog/site/{site}/{container}/{path}PUT /alfresco/service/api/blog/site/{site}/{container}PUT /alfresco/service/api/blog/node/{store_type}/{store_id}/{id}
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
Posting BlogsThis section describes the Web scripts within the/org/alfresco/repository/blogs/post childpackage.
14 ❘ APPENDIX A RESTFUL API REFERENCE
Blog Post PublishingThe following Web script performs external blog publishing functions on a blog post.
POST /alfresco/service/api/blog/post/site/{site}/{container}/{path}/publishingPOST /alfresco/service/api/blog/post/node/{store_type}/{store_id}/{id}/publishing
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
Delete Blog PostThe following Web script deletes a blog post.
DELETE /alfresco/service/api/blog/post/site/{site}/{container}/{path}DELETE /alfresco/service/api/blog/post/node/{store_type}/{store_id}/{id}
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
Get All BlogsThe following Web script gets all blogs.
GET /alfresco/service/api/blog/post/site/{site}/{container}/{path}GET /alfresco/service/api/blog/post/node/{store_type}/{store_id}/{id}
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
Update a Blog PostThe following Web script updates a blog post.
PUT /alfresco/service/api/blog/post/site/{site}/{container}/{path}PUT /alfresco/service/api/blog/post/node/{store_type}/{store_id}/{id}
The Web script description document specifies the following options:
➤ user: The authentication access
Repository Web Scripts ❘ 15
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
Blog PostsThis section describes the Web scripts within the /org/alfresco/repository/blogs/posts childpackage.
Blog Posts (Draft)The following Web script gets all posts for a blog.
GET /alfresco/service/api/blog/site/{site}/{container}/{path}/posts/mydraftsGET /alfresco/service/api/blog/site/{site}/{container}/posts/mydraftsGET /alfresco/service/api/blog/node/{store_type}/{store_id}/{id}/posts/mydrafts
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
Blog Posts (Published)The following Web script gets all posts for a blog.
GET /alfresco/service/api/blog/site/{site}/{container}/{path}/posts/mypublishedGET /alfresco/service/api/blog/site/{site}/{container}/posts/mypublishedGET /alfresco/service/api/blog/node/{store_type}/{store_id}/{id}/posts/mypublished
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
Blog PostsThe following Web script gets all posts for a blog.
GET /alfresco/service/api/blog/site/{site}/{container}/{path}/posts/new?numdays={numdays}GET /alfresco/service/api/blog/site/{site}/{container}/posts/new?numdays={numdays}GET /alfresco/service/api/blog/node/{store_type}/{store_id}/{id}/posts/new?numdays={numdays}
16 ❘ APPENDIX A RESTFUL API REFERENCE
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
Blog Posts per MonthThe following Web script gets all months for which there are blog posts, plus the number ofposts in each month.
GET /alfresco/service/api/blog/site/{site}/{container}/{path}/postspermonthGET /alfresco/service/api/blog/site/{site}/{container}/postspermonthGET /alfresco/service/api/blog/node/{store_type}/{store_id}/{id}/postspermonth
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
All Externally Published PostsThe following Web script gets all posts for a blog.
GET /alfresco/service/api/blog/site/{site}/{container}/{path}/posts/publishedextGET /alfresco/service/api/blog/site/{site}/{container}/posts/publishedextGET /alfresco/service/api/blog/node/{store_type}/{store_id}/{id}/posts/publishedext
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
Get Blog PostsThe following Web script gets all posts for a blog.
GET /alfresco/service/api/blog/site/{site}/{container}/{path}/postsGET /alfresco/service/api/blog/site/{site}/{container}/postsGET /alfresco/service/api/blog/node/{store_type}/{store_id}/{id}/posts
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
Repository Web Scripts ❘ 17
➤ argument: The format style
➤ json: The default format response
New Blog PostThe following Web script creates a new blog post.
POST /alfresco/service/api/blog/site/{site}/{container}/{path}/postsPOST /alfresco/service/api/blog/site/{site}/{container}/postsPOST /alfresco/service/api/blog/node/{store_type}/{store_id}/{id}/posts
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
CommentsThis section describes the Comments Web scripts within the /org/alfresco/repository/comments
package.
Delete a CommentThe following Web script deletes a comment.
DELETE /alfresco/service/api/comment/node/{store_type}/{store_id}/{id}
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
CommentThe following Web script gets the data for a comment.
GET /alfresco/service/api/comment/node/{store_type}/{store_id}/{id}
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
18 ❘ APPENDIX A RESTFUL API REFERENCE
Update a CommentThe following Web script updates a comment.
PUT /alfresco/service/api/comment/node/{store_type}/{store_id}/{id}
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
All CommentsThe following Web script gets all comments for a node.
GET /alfresco/service/api/node/{store_type}/{store_id}/{id}/comments
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
Add a CommentThe following Web script adds a new comment to a node.
POST /alfresco/service/api/node/{store_type}/{store_id}/{id}/comments
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
DictionaryThis section describes the Dictionary Web scripts within the /org/alfresco/repository/dictionary
package.
Get Association DefinitionsThe following Web script gets the collection of association definitions.
GET /alfresco/service/api/classes/{classname}/association/{assocname}
Repository Web Scripts ❘ 19
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
Get Association Definitions for a Given Class NameThe following Web script gets the collection of association definitions for a given class name.
GET /alfresco/service/api/classes/{classname}/associations?af={associationFilter?}&nsp={namespacePrefix?}&n={name?}
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
Get Child Association DefinitionsThe following Web script gets the collection of child association definitions.
GET /alfresco/service/api/classes/{classname}/childassociation/{assocname}
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
Get Child Association Definitions for a Given Class NameThe following Web script gets the collection of child association definitions for a given class name.
GET /alfresco/service/api/classes/{classname}/childassociations
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
20 ❘ APPENDIX A RESTFUL API REFERENCE
Get Class DefinitionsThe following Web script gets the collection of class definitions.
GET /alfresco/service/api/classes?cf={classFilter?}&nsp={namespacePrefix?}&n={name?}
The following parameters are available:
➤ classfilter
➤ namespaceprefix
➤ name
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
Get Class Definitions for a Given Class NameThe following Web script gets the collection of class definitions for a given class name.
GET /alfresco/service/api/classes/{className}
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
Get Property DefinitionsThe following Web script gets the collection of property definitions.
GET /alfresco/service/api/classes/{classname}/properties?nsp={namespacePrefix?}&n={name?}
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
Repository Web Scripts ❘ 21
Get Property Definitions for a Given Class Name and Property NameThe following Web script gets the collection of property definitions for a given class name andproperty name.
GET /alfresco/service/api/classes/{classname}/property/{propname}
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
Get Subclass DefinitionsThe following Web script gets the collection of subclass definitions.
GET /alfresco/service/api/classes/{classname}/subclasses?r={recursive?}&nsp={namespacePrefix?}&n={name?}
The following parameters are available:
➤ recursive
➤ classfilter
➤ namespaceprefix
➤ name
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
DiscussionsThis section describes the Discussion Web scripts within the /org/alfresco/repository/discussions
package.
This package contains the following child packages:
➤ /org/alfresco/repository/discussions/forum
➤ /org/alfresco/repository/discussions/posts
Discussion ForumThis section describes the Web scripts within the /org/alfresco/repository/discussions/forum
child package.
22 ❘ APPENDIX A RESTFUL API REFERENCE
Forum Hot PostsThe following Web script gets the new forum hot posts.
GET /alfresco/service/api/forum/site/{site}/{container}/{path}/posts/hotGET /alfresco/service/api/forum/site/{site}/{container}/posts/hotGET /alfresco/service/api/forum/node/{store_type}/{store_id}/{id}/posts/hot
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
Forum My PostsThe following Web script gets the forum posts created by the current user.
GET /alfresco/service/api/forum/site/{site}/{container}/{path}/posts/mypostsGET /alfresco/service/api/forum/site/{site}/{container}/posts/mypostsGET /alfresco/service/api/forum/node/{store_type}/{store_id}/{id}/posts/myposts
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
Forum New PostsThe following Web script gets the new forum posts since the specified number of days.
GET /alfresco/service/api/forum/site/{site}/{container}/{path}/posts/new?numdays={numdays}GET /alfresco/service/api/forum/site/{site}/{container}/posts/new?numdays={numdays}GET /alfresco/service/api/forum/node/{store_type}/{store_id}/{id}/posts/new?numdays={numdays}
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
Get Forum PostsThe following Web script gets the forum posts.
GET /alfresco/service/api/forum/site/{site}/{container}/{path}/postsGET /alfresco/service/api/forum/site/{site}/{container}/postsGET /alfresco/service/api/forum/node/{store_type}/{store_id}/{id}/posts
Repository Web Scripts ❘ 23
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
Add Forum PostsThe following Web script adds a post to a forum.
POST /alfresco/service/api/forum/site/{site}/{container}/{path}/postsPOST /alfresco/service/api/forum/site/{site}/{container}/postsPOST /alfresco/service/api/forum/node/{store_type}/{store_id}/{id}/posts
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
Discussion PostsThis section describes the Web scripts within the /org/alfresco/repository/discussions/posts
child package.
Get Forum Post RepliesThe following Web script gets the forum posts.
GET /alfresco/service/api/forum/post/site/{site}/{container}/{path}/repliesGET /alfresco/service/api/forum/post/node/{store_type}/{store_id}/{id}/replies
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
Add Forum Post RepliesThe following Web script adds a reply to a post.
POST /alfresco/service/api/forum/post/node/{store_type}/{store_id}/{id}/replies
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
24 ❘ APPENDIX A RESTFUL API REFERENCE
➤ argument: The format style
➤ json: The default format response
Delete TopicThe following Web script deletes a topic.
DELETE /alfresco/service/api/forum/post/site/{site}/{container}/{path}DELETE /alfresco/service/api/forum/post/node/{store_type}/{store_id}/{id}
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
Topic DetailsThe following Web script gets the details for a topic.
GET /alfresco/service/api/forum/post/site/{site}/{container}/{path}GET /alfresco/service/api/forum/post/node/{store_type}/{store_id}/{id}
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
Update TopicThe following Web script updates a topic.
PUT /alfresco/service/api/forum/post/site/{site}/{container}/{path}PUT /alfresco/service/api/forum/post/node/{store_type}/{store_id}/{id}
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
Repository Web Scripts ❘ 25
FormsThis section describes the Forms Web scripts within the /org/alfresco/repository/forms package.
PickerListThe following Web script provides a service to return metadata of child items in a parent space todisplay in the object finder.
GET /alfresco/service/api/forms/picker/{type}/{store_type}/{store_id}/{id}/children
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ any: The format style
➤ json: The default format response
PickerItemsThe following Web script provides a service to return metadata of multiple items to display in theobject finder.
POST /alfresco/service/api/forms/picker/items
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ any: The format style
➤ json: The default format response
GroupsThis section describes the Groups Web scripts within the /org/alfresco/repository/groups package.
Remove an Authority from a GroupThe following Web script removes an authority (USER or GROUP) from a group.
DELETE /alfresco/service/api/groups/{shortGroupName}/children/{fullAuthorityName}
A user will not be deleted by this method. You must have administrator privileges to alter a group.
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
26 ❘ APPENDIX A RESTFUL API REFERENCE
➤ argument: The format style
➤ json: The default format response
Get the List of Child Authorities for a GroupThe following Web script gets a list of the child authorities of a group.
GET /alfresco/service/api/groups/{shortName}/children?authorityType={authorityType?}
It contains both people and groups. The following parameter is available:
➤ authorityType: Used to specify return authorities of the given type. Valid values are GROUPand USER.
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
Add Group or User to a GroupThe following Web script adds a group or user to a group.
POST /alfresco/service/api/groups/{shortName}/children/{fullAuthorityName}
It creates a sub-group, if one does not already exist, with the fullAuthorityName.
You must have administrator privileges to modify groups. If the authority is for a group and does notexist, it is created.
If the new group is created, it returns Status_Created and the name of the group; if the group alreadyexists, it returns Status_OK.
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
Get the Details of a GroupThe following Web script gets the details of a group.
GET /alfresco/service/api/groups/{shortName}
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
Repository Web Scripts ❘ 27
➤ argument: The format style
➤ json: The default format response
Update the Details of a GroupThe following Web script updates the details of a group.
PUT /alfresco/service/api/groups/{shortName}
You must have administrator privileges to change the name of a group. The following parameteris available:
➤ displayName: The display name
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
Delete a GroupThe following Web script deletes a group and all its dependents.
DELETE /alfresco/service/api/groups/{shortName}
You must have administrator privileges to delete a group.
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
List GroupsThe following Web script searches for groups.
GET /alfresco/service/api/groups?shortNameFilter={shortNameFilter?}&zone={zone?}
The following parameters are available:
➤ shortNameFilter: Returns those groups with a partial match on shortName. You can usethe pattern matching character * to match zero or more characters, or ? to match onecharacter.
➤ zone: Returns groups that are in the specified zone; otherwise, it returns groups from allzones.
28 ❘ APPENDIX A RESTFUL API REFERENCE
The Web scripts returns an array of groups in JSON format.
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
Get the List of Child Authorities for a GroupThe following Web script gets a list of the parent authorities of a group.
GET /alfresco/service/api/groups/{shortName}/parents?level={level?}
The optional level attribute can be ‘‘ALL,’’ in which case all parents are returned.
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
Delete a Root GroupThe following Web script deletes a root group and all its dependents.
DELETE /alfresco/service/api/rootgroups/{shortName}
You must have administrator privileges to delete a group.
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
List all Root GroupsThe following Web script lists all root groups.
GET /alfresco/service/api/rootgroups?shortNameFilter={shortNameFilter?}&zone={zone?}
The following parameters are available:
➤ zone: If set to true, returns root groups from the specified zone. If not specified, returns groupsfrom all zones.
➤ shortNameFilter: Returns those root groups with a partial match on shortName.The shortname filter can contain the wild-card characters * and ?, but these must beURL-encoded for this script.
Repository Web Scripts ❘ 29
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
Add a Root GroupThe following Web script adds a root group.
POST /alfresco/service/api/rootgroups/{shortName}
You must have administrator privileges to add a root group. It returns STATUS_CREATED if a new groupis created. If the group already exists, it returns BAD_REQUEST.
The following parameter is available:
➤ displayName: The display name
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
IMAPThis section describes the IMAP Web scripts within the /org/alfresco/repository/imap package.
IMAP Server StatusThe following Web script returns the status of the IMAP server (enabled/disabled).
GET /alfresco/service/imap/servstatus
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ extension: The format style
➤ html: The default format response
IMAP Workflow HandlerThe following Web script starts different workflows.
GET /alfresco/service/imap/start-workflow?alfTicket={ticket}&nodeRefId={id}&workflowType={wt}&assignTo={at}&workflowDueDateDay={ddd}&workflowDueDateMonth={ddm}&workflowDueDateYear={ddy}&description={desc}
30 ❘ APPENDIX A RESTFUL API REFERENCE
It is used in the IMAP email body links. (The optional feature is the reply email with a report.)
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ extension: The format style
➤ html: The default format response
MetadataThis section describes the Metadata Web scripts within the /org/alfresco/repository/metadata
package.
Node Metadata Retrieval ServiceThe following Web script is for the Node Metadata Retrieval Service.
GET /alfresco/service/api/metadata
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ any: The format style
➤ json: The default format response
Node Metadata Storage ServiceThe following Web script is for the Node Metadata Storage Service.
POST /alfresco/service/api/metadata/node/{store_type}/{store_id}/{id}
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
PersonThis section describes the Person Web scripts within the /org/alfresco/repository/person package.
Update User PasswordThe following Web script updates the password of a current user.
POST /alfresco/service/api/person/changepassword/{userName}
It can only be executed for the current user or by an admin to update any user.
Repository Web Scripts ❘ 31
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
Get PeopleThe following Web script gets the collection of people stored in the repository.
GET /alfresco/service/api/people?filter={filterQuery?}
This can optionally be filtered according to some given filter query string.
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
Add PersonThe following Web script adds a new person based on the details provided.
POST /alfresco/service/api/people
The following parameters are available:
➤ username: The user name for the new user (mandatory).
➤ firstName: The given name (mandatory).
➤ lastName: The family name (mandatory).
➤ email: The email address (mandatory).
➤ password: The new user’s password (optional). If not specified, a value of password is used,which should be changed as soon as possible.
The Web script description document specifies the following options:
➤ admin: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
Delete PersonThe following Web script deletes a person.
DELETE /alfresco/service/api/people/{userName}
32 ❘ APPENDIX A RESTFUL API REFERENCE
The Web script description document specifies the following options:
➤ admin: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
Get PersonThe following Web script gets the details of a person.
GET /alfresco/service/api/people/{userName}
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
Update PersonThe following Web script updates the details of a person.
PUT /alfresco/service/api/people/{userName}
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
SitesThe following Web script gets a collection of the sites of which a person is an explicit member.
GET /alfresco/service/api/people/{userid}/sites?size={pagesize?}&pos={position?}
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
Repository Web Scripts ❘ 33
➤ argument: The format style
➤ json: The default format response
PreferenceThis section describes the Preference Web scripts within the /org/alfresco/repository/preference
package.
Delete PreferencesThe following Web script deletes a user’s preferences.
DELETE /alfresco/service/api/people/{userid}/preferences?pf={preferencefilter?}
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
Get PreferencesThe following Web script gets the preferences for a user.
GET /alfresco/service/api/people/{userid}/preferences?pf={preferencefilter?}
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
Set PreferencesThe following Web script sets a user’s preferences.
POST /alfresco/service/api/people/{userid}/preferences
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
34 ❘ APPENDIX A RESTFUL API REFERENCE
SearchThis section describes the Search Web scripts within the /org/alfresco/repository/search package.
Alfresco Keyword Search (OpenSearch Enabled)The following Web script executes a keyword search against the Alfresco repository (Company Homeand below).
GET /alfresco/service/api/search/keyword.html?q={searchTerms}&p={startPage?}&c={count?}&l={language?}GET /alfresco/service/search/keyword.html?q={searchTerms}&p={startPage?}&c={count?}&l={language?}GET /alfresco/service/api/search/keyword.atom?q={searchTerms}&p={startPage?}&c={count?}&l={language?}GET /alfresco/service/search/keyword.atom?q={searchTerms}&p={startPage?}&c={count?}&l={language?}GET /alfresco/service/api/search/keyword.rss?q={searchTerms}&p={startPage?}&c={count?}&l={language?}GET /alfresco/service/search/keyword.rss?q={searchTerms}&p={startPage?}&c={count?}&l={language?}GET /alfresco/service/api/search/keyword.portlet?q={searchTerms}&p={startPage?}&c={count?}&l={language?}
The Web script description document specifies the following options:
➤ guest: The authentication access
➤ required: The transaction level
➤ any: The format style
➤ html: The default format response
Keyword Search DescriptionThe following Web script gets an OpenSearch description document for an Alfresco repositorykeyword search.
GET /alfresco/service/api/search/keyword/description.xmlGET /alfresco/service/search/keyword/description.xml
The Web script description document specifies the following options:
➤ none: The authentication access
➤ none: The transaction level
➤ argument: The format style
➤ opensearchdescription: The default format response
Alfresco Person Search (OpenSearch Enabled)The following Web script executes the person search against the Alfresco repository.
GET /alfresco/service/api/search/person.html?q={searchTerms}&p={startPage?}&c={count?}&l={language?}GET /alfresco/service/search/person.html?q={searchTerms}&p={startPage?}
Repository Web Scripts ❘ 35
&c={count?}&l={language?}GET /alfresco/service/api/search/person.atom?q={searchTerms}&p={startPage?}&c={count?}&l={language?}GET /alfresco/service/search/person.atom?q={searchTerms}&p={startPage?}&c={count?}&l={language?}GET /alfresco/service/api/search/person.rss?q={searchTerms}&p={startPage?}&c={count?}&l={language?}GET /alfresco/service/search/person.rss?q={searchTerms}&p={startPage?}&c={count?}&l={language?}GET /alfresco/service/api/search/person.portlet?q={searchTerms}&p={startPage?}&c={count?}&l={language?}
The Web script description document specifies the following options:
➤ guest: The authentication access
➤ required: The transaction level
➤ any: The format style
➤ html: The default format response
Person Search DescriptionThe following Web script gets an OpenSearch description document for an Alfresco repositoryperson search.
GET /alfresco/service/api/search/person/description.xmlGET /alfresco/service/search/person/description.xml
The Web script description document specifies the following options:
➤ none: The authentication access
➤ none: The transaction level
➤ argument: The format style
➤ opensearchdescription: The default format response
Search EnginesThe following Web script lists the search engines registered with this Alfresco repository.
GET /alfresco/service/api/search/engines?type={type?}GET /alfresco/service/search/engines?type={type?}GET /alfresco/service/api/search/engines.atom?type={type?}GET /alfresco/service/search/engines.atom?type={type?}
The Web script description document specifies the following options:
➤ none: The authentication access
➤ none: The transaction level
➤ any: The format style
➤ html: The default format response
36 ❘ APPENDIX A RESTFUL API REFERENCE
Proxied (OpenSearch) SearchThe following Web script provides a search engine proxy for issuing a search against a remotesearch engine.
GET /alfresco/service/api/search/engine/{engine}/{format}GET /alfresco/service/search/engine/{engine}/{format}
➤ none: The authentication access
➤ none : The transaction level
➤ any: The format style
➤ Determined at runtime: The default format response
TaggingThis section describes the Tagging Web scripts within the /org/alfresco/repository/tagging
package.
Get Node TagsThe following Web script gets all the tags for a node.
GET /alfresco/service/api/node/{store_type}/{store_id}/{id}/tagsGET /alfresco/service/api/path/{store_type}/{store_id}/{id}/tags
It returns STATUS_OK (200).
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ any: The format style
➤ json: The default format response
Add TagThe following Web script adds one or more tags to the node.
POST /alfresco/service/api/node/{store_type}/{store_id}/{id}/tagsPOST /alfresco/service/api/path/{store_type}/{store_id}/{id}/tags
It takes an array of String (mandatory) as its input.
It returns the array of tags, with a return of STATUS_OK (200).
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ any: The format style
➤ json: The default format response
Repository Web Scripts ❘ 37
List All TagsThe following Web script gets the currently available tags for the specified store.
GET /alfresco/service/api/tags/{store_type}/{store_id}?tf={tag_filter?}
The following parameter is available:
➤ tag_filter: The tag filter limits the returned tags to those containing the filter (optional).
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
Get Nodes for TagThe following Web script gets the nodes that have a given tag.
GET /alfresco/service/api/tags/{store_type}/{store_id}/{tag}/nodes
The returned content is an array of the following:
➤ nodeRef
➤ url
The return status is STATUS_OK, 200.
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ any: The format style
➤ json: The default format response
Tagscope TagsThe following Web script gets all tags of the nearest available tagscope.
GET /alfresco/service/api/tagscopes/node/{store_type}/{store_id}/{id}/tagsGET /alfresco/service/api/tagscopes/site/{site}/tagsGET /alfresco/service/api/tagscopes/site/{site}/{container}/tags
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ json: The default format response
38 ❘ APPENDIX A RESTFUL API REFERENCE
ThumbnailThis section describes the Thumbnail Web scripts within the /org/alfresco/repository/thumbnail
package.
Delete ThumbnailThe following Web script deletes a thumbnail for a content resource.
DELETE /alfresco/service/api/node/{store_type}/{store_id}/{id}/content{property}/thumbnails/{thumbnailname}DELETE /alfresco/service/api/path/{store_type}/{store_id}/{id}/content{property}/thumbnails/{thumbnailname}
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ any: The format style
➤ json: The default format response
Get ThumbnailThe following Web script gets a named thumbnail for a content resource.
GET /alfresco/service/api/node/{store_type}/{store_id}/{id}/content{property}/thumbnails/{thumbnailname}?c={queueforcecreate?}&ph={placeholder?}GET /alfresco/service/api/path/{store_type}/{store_id}/{id}/content{property}/thumbnails/{thumbnailname}?c={queueforcecreate?}&ph={placeholder?}
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ argument: The format style
➤ Determined at runtime: The default format response
Update ThumbnailThe following Web script updates a thumbnail for a content resource.
PUT /alfresco/service/api/node/{store_type}/{store_id}/{id}/content{property}/thumbnails/{thumbnailname}PUT /alfresco/service/api/path/{store_type}/{store_id}/{id}/content{property}/thumbnails/{thumbnailname}
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
Repository Web Scripts ❘ 39
➤ any: The format style
➤ json: The default format response
Get Thumbnail DefinitionsThe following Web script gets the thumbnail definitions for a content resource.
GET /alfresco/service/api/node/{store_type}/{store_id}/{id}/content{property}/thumbnaildefinitionsGET /alfresco/service/api/path/{store_type}/{store_id}/{id}/content{property}/thumbnaildefinitions
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ any: The format style
➤ json: The default format response
Get ThumbnailsThe following Web script gets the thumbnails for a content resource.
GET /alfresco/service/api/node/{store_type}/{store_id}/{id}/content{property}/thumbnailsGET /alfresco/service/api/path/{store_type}/{store_id}/{id}/content{property}/thumbnails
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ any: The format style
➤ json: The default format response
Create New ThumbnailThe following Web script creates a new thumbnail for a content resource.
POST /alfresco/service/api/node/{store_type}/{store_id}/{id}/content{property}/thumbnails?as={async?}POST /alfresco/service/api/path/{store_type}/{store_id}/{id}/content{property}/thumbnails?as={async?}
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ any: The format style
➤ json: The default format response
40 ❘ APPENDIX A RESTFUL API REFERENCE
UploadThis section describes the Upload Web scripts within the /org/alfresco/repository/upload package.
File UploadThe following Web script uploads file content and metadata into the repository.
POST /alfresco/service/api/upload
The Web script uses the following HTML form data:
➤ filedata, (mandatory) HTML type file
➤ siteid
➤ containerid
➤ uploaddirectory
➤ updatenoderef
➤ filename
➤ description
➤ contenttype
➤ majorversion
➤ overwrite
➤ thumbnails
The returned content is:
➤ nodeRef
It returns a status: STATUS_OK (200).
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ any: The format style
➤ json: The default format response
Repository Web Scripts ❘ 41
VersionThis section describes the Version Web scripts within the /org/alfresco/repository/version
package.
Node Version InfoThe following Web script provides the node version information.
GET /alfresco/service/api/version
The Web script description document specifies the following options:
➤ user: The authentication access
➤ required: The transaction level
➤ any: The format style
➤ json: The default format response