API Provides access to the features of Alfresco Content Services.
PHP 5.4.0 and later
To install the bindings via Composer, add the following to composer.json
:
{
"repositories": [
{
"type": "git",
"url": "https://github.com/rhuanbarreto/alfresco-api-php-client.git"
}
],
"require": {
"/": "*@dev"
}
}
Then run composer install
Download the files and include autoload.php
:
require_once('/path/to/AlfrescoAPI/autoload.php');
To run the unit tests:
composer install
./vendor/bin/phpunit
Please follow the installation procedure and then run the following for using the CORE API:
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: basicAuth
Alfresco\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
Alfresco\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');
Alfresco\Configuration::getDefaultConfiguration()->setHost('http://[YOUR_ALFRESCO_HOSTNAME]:[YOUR_ALFRESCO_PORT]/alfresco/api/-default-/public/alfresco/versions/1');
$api_instance = new Alfresco\Api\ActivitiesApi();
$person_id = "person_id_example"; // string | The identifier of a person.
$skip_count = 0; // int | The number of entities that exist in the collection before those included in this list. If not supplied then the default value is 0.
$max_items = 100; // int | The maximum number of items to return in the list. If not supplied then the default value is 100.
$who = "who_example"; // string | A filter to include the user's activities only `me`, other user's activities only `others`'
$site_id = "site_id_example"; // string | Include only activity feed entries relating to this site.
$fields = array("fields_example"); // string[] | A list of field names. You can use this parameter to restrict the fields returned within a response if, for example, you want to save on overall bandwidth. The list applies to a returned individual entity or entries within a collection. If the API method also supports the **include** parameter, then the fields specified in the **include** parameter are returned in addition to those specified in the **fields** parameter.
try {
$result = $api_instance->listActivitiesForPerson($person_id, $skip_count, $max_items, $who, $site_id, $fields);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling ActivitiesApi->listActivitiesForPerson: ', $e->getMessage(), PHP_EOL;
}
?>
Please follow the installation procedure and then run the following for using the Search API:
<?php
require_once(__DIR__ . '/vendor/autoload.php');
// Configure HTTP basic authorization: basicAuth
Alfresco\Configuration::getDefaultConfiguration()->setUsername('YOUR_USERNAME');
Alfresco\Configuration::getDefaultConfiguration()->setPassword('YOUR_PASSWORD');
Alfresco\Configuration::getDefaultConfiguration()->setHost('http://[YOUR_ALFRESCO_HOSTNAME]:[YOUR_ALFRESCO_PORT]/alfresco/api/-default-/public/search/versions/1');
$api_instance = new Alfresco\Api\SearchApi();
$query_body = new \Alfresco\Model\SearchRequest(); // \Alfresco\Model\SearchRequest | Generic query API
$query_body->setQuery(["query" => "foo"]);
try {
$result = $api_instance->search($query_body);
print_r($result);
} catch (Exception $e) {
echo 'Exception when calling SearchApi->search: ', $e->getMessage(), PHP_EOL;
}
?>
All CORE API URIs are relative to https://localhost/alfresco/api/-default-/public/alfresco/versions/1
All Search API URIs are relative to https://localhost/alfresco/api/-default-/public/search/versions/1
Class | Method | HTTP request | Description |
---|---|---|---|
ActivitiesApi | listActivitiesForPerson | GET /people/{personId}/activities | List activities |
AuditApi | deleteAuditEntriesForAuditApp | DELETE /audit-applications/{auditApplicationId}/audit-entries | Permanently delete audit entries for an audit application |
AuditApi | deleteAuditEntry | DELETE /audit-applications/{auditApplicationId}/audit-entries/{auditEntryId} | Permanently delete an audit entry |
AuditApi | getAuditApp | GET /audit-applications/{auditApplicationId} | Get audit application info |
AuditApi | getAuditEntry | GET /audit-applications/{auditApplicationId}/audit-entries/{auditEntryId} | Get audit entry |
AuditApi | listAuditApps | GET /audit-applications | List audit applications |
AuditApi | listAuditEntriesForAuditApp | GET /audit-applications/{auditApplicationId}/audit-entries | List audit entries for an audit application |
AuditApi | listAuditEntriesForNode | GET /nodes/{nodeId}/audit-entries | List audit entries for a node |
AuditApi | updateAuditApp | PUT /audit-applications/{auditApplicationId} | Update audit application info |
CommentsApi | createComment | POST /nodes/{nodeId}/comments | Create a comment |
CommentsApi | deleteComment | DELETE /nodes/{nodeId}/comments/{commentId} | Delete a comment |
CommentsApi | listComments | GET /nodes/{nodeId}/comments | List comments |
CommentsApi | updateComment | PUT /nodes/{nodeId}/comments/{commentId} | Update a comment |
DownloadsApi | cancelDownload | DELETE /downloads/{downloadId} | Cancel a download |
DownloadsApi | createDownload | POST /downloads | Create a new download |
DownloadsApi | getDownload | GET /downloads/{downloadId} | Get a download |
FavoritesApi | createFavorite | POST /people/{personId}/favorites | Create a favorite |
FavoritesApi | createSiteFavorite | POST /people/{personId}/favorite-sites | Create a site favorite |
FavoritesApi | deleteFavorite | DELETE /people/{personId}/favorites/{favoriteId} | Delete a favorite |
FavoritesApi | deleteSiteFavorite | DELETE /people/{personId}/favorite-sites/{siteId} | Delete a site favorite |
FavoritesApi | getFavorite | GET /people/{personId}/favorites/{favoriteId} | Get a favorite |
FavoritesApi | getFavoriteSite | GET /people/{personId}/favorite-sites/{siteId} | Get a favorite site |
FavoritesApi | listFavoriteSitesForPerson | GET /people/{personId}/favorite-sites | List favorite sites |
FavoritesApi | listFavorites | GET /people/{personId}/favorites | List favorites |
GroupsApi | createGroup | POST /groups | Create a group |
GroupsApi | createGroupMembership | POST /groups/{groupId}/members | Create a group membership |
GroupsApi | deleteGroup | DELETE /groups/{groupId} | Delete a group |
GroupsApi | deleteGroupMembership | DELETE /groups/{groupId}/members/{groupMemberId} | Delete a group membership |
GroupsApi | getGroup | GET /groups/{groupId} | Get group details |
GroupsApi | listGroupMemberships | GET /groups/{groupId}/members | List memberships of a group |
GroupsApi | listGroupMembershipsForPerson | GET /people/{personId}/groups | List group memberships |
GroupsApi | listGroups | GET /groups | List groups |
GroupsApi | updateGroup | PUT /groups/{groupId} | Update group details |
NetworksApi | getNetwork | GET /networks/{networkId} | Get a network |
NetworksApi | getNetworkForPerson | GET /people/{personId}/networks/{networkId} | Get network information |
NetworksApi | listNetworksForPerson | GET /people/{personId}/networks | List network membership |
NodesApi | copyNode | POST /nodes/{nodeId}/copy | Copy a node |
NodesApi | createAssocation | POST /nodes/{nodeId}/targets | Create node association |
NodesApi | createNode | POST /nodes/{nodeId}/children | Create a node |
NodesApi | createSecondaryChildAssocation | POST /nodes/{nodeId}/secondary-children | Create secondary child |
NodesApi | deleteAssocation | DELETE /nodes/{nodeId}/targets/{targetId} | Delete node association(s) |
NodesApi | deleteNode | DELETE /nodes/{nodeId} | Delete a node |
NodesApi | deleteSecondaryChildAssocation | DELETE /nodes/{nodeId}/secondary-children/{childId} | Delete secondary child or children |
NodesApi | getNode | GET /nodes/{nodeId} | Get a node |
NodesApi | getNodeContent | GET /nodes/{nodeId}/content | Get node content |
NodesApi | listNodeChildren | GET /nodes/{nodeId}/children | List node children |
NodesApi | listParents | GET /nodes/{nodeId}/parents | List parents |
NodesApi | listSecondaryChildren | GET /nodes/{nodeId}/secondary-children | List secondary children |
NodesApi | listSourceAssociations | GET /nodes/{nodeId}/sources | List source associations |
NodesApi | listTargetAssociations | GET /nodes/{nodeId}/targets | List target associations |
NodesApi | lockNode | POST /nodes/{nodeId}/lock | Lock a node |
NodesApi | moveNode | POST /nodes/{nodeId}/move | Move a node |
NodesApi | unlockNode | POST /nodes/{nodeId}/unlock | Unlock a node |
NodesApi | updateNode | PUT /nodes/{nodeId} | Update a node |
NodesApi | updateNodeContent | PUT /nodes/{nodeId}/content | Update node content |
PeopleApi | createPerson | POST /people | Create person |
PeopleApi | deleteAvatarImage | DELETE /people/{personId}/avatar | Delete avatar image |
PeopleApi | getAvatarImage | GET /people/{personId}/avatar | Get avatar image |
PeopleApi | getPerson | GET /people/{personId} | Get a person |
PeopleApi | listPeople | GET /people | List people |
PeopleApi | requestPasswordReset | POST /people/{personId}/request-password-reset | Request password reset |
PeopleApi | resetPassword | POST /people/{personId}/reset-password | Reset password |
PeopleApi | updateAvatarImage | PUT /people/{personId}/avatar | Update avatar image |
PeopleApi | updatePerson | PUT /people/{personId} | Update person |
PreferencesApi | getPreference | GET /people/{personId}/preferences/{preferenceName} | Get a preference |
PreferencesApi | listPreferences | GET /people/{personId}/preferences | List preferences |
QueriesApi | findNodes | GET /queries/nodes | Find nodes |
QueriesApi | findPeople | GET /queries/people | Find people |
QueriesApi | findSites | GET /queries/sites | Find sites |
RatingsApi | createRating | POST /nodes/{nodeId}/ratings | Create a rating |
RatingsApi | deleteRating | DELETE /nodes/{nodeId}/ratings/{ratingId} | Delete a rating |
RatingsApi | getRating | GET /nodes/{nodeId}/ratings/{ratingId} | Get a rating |
RatingsApi | listRatings | GET /nodes/{nodeId}/ratings | List ratings |
RenditionsApi | createRendition | POST /nodes/{nodeId}/renditions | Create rendition |
RenditionsApi | getRendition | GET /nodes/{nodeId}/renditions/{renditionId} | Get rendition information |
RenditionsApi | getRenditionContent | GET /nodes/{nodeId}/renditions/{renditionId}/content | Get rendition content |
RenditionsApi | listRenditions | GET /nodes/{nodeId}/renditions | List renditions |
SearchApi | search | POST /search | Searches Alfresco |
SharedlinksApi | createSharedLink | POST /shared-links | Create a shared link to a file |
SharedlinksApi | deleteSharedLink | DELETE /shared-links/{sharedId} | Deletes a shared link |
SharedlinksApi | emailSharedLink | POST /shared-links/{sharedId}/email | Email shared link |
SharedlinksApi | getSharedLink | GET /shared-links/{sharedId} | Get a shared link |
SharedlinksApi | getSharedLinkContent | GET /shared-links/{sharedId}/content | Get shared link content |
SharedlinksApi | getSharedLinkRendition | GET /shared-links/{sharedId}/renditions/{renditionId} | Get shared link rendition information |
SharedlinksApi | getSharedLinkRenditionContent | GET /shared-links/{sharedId}/renditions/{renditionId}/content | Get shared link rendition content |
SharedlinksApi | listSharedLinkRenditions | GET /shared-links/{sharedId}/renditions | List renditions for a shared link |
SharedlinksApi | listSharedLinks | GET /shared-links | List shared links |
SitesApi | createSite | POST /sites | Create a site |
SitesApi | createSiteMembership | POST /sites/{siteId}/members | Create a site membership |
SitesApi | createSiteMembershipRequestForPerson | POST /people/{personId}/site-membership-requests | Create a site membership request |
SitesApi | deleteSite | DELETE /sites/{siteId} | Delete a site |
SitesApi | deleteSiteMembership | DELETE /sites/{siteId}/members/{personId} | Delete a site membership |
SitesApi | deleteSiteMembershipForPerson | DELETE /people/{personId}/sites/{siteId} | Delete a site membership |
SitesApi | deleteSiteMembershipRequestForPerson | DELETE /people/{personId}/site-membership-requests/{siteId} | Delete a site membership request |
SitesApi | getSite | GET /sites/{siteId} | Get a site |
SitesApi | getSiteContainer | GET /sites/{siteId}/containers/{containerId} | Get a site container |
SitesApi | getSiteMembership | GET /sites/{siteId}/members/{personId} | Get a site membership |
SitesApi | getSiteMembershipForPerson | GET /people/{personId}/sites/{siteId} | Get a site membership |
SitesApi | getSiteMembershipRequestForPerson | GET /people/{personId}/site-membership-requests/{siteId} | Get a site membership request |
SitesApi | listSiteContainers | GET /sites/{siteId}/containers | List site containers |
SitesApi | listSiteMembershipRequestsForPerson | GET /people/{personId}/site-membership-requests | List site membership requests |
SitesApi | listSiteMemberships | GET /sites/{siteId}/members | List site memberships |
SitesApi | listSiteMembershipsForPerson | GET /people/{personId}/sites | List site memberships |
SitesApi | listSites | GET /sites | List sites |
SitesApi | updateSite | PUT /sites/{siteId} | Update a site |
SitesApi | updateSiteMembership | PUT /sites/{siteId}/members/{personId} | Update a site membership |
SitesApi | updateSiteMembershipRequestForPerson | PUT /people/{personId}/site-membership-requests/{siteId} | Update a site membership request |
TagsApi | createTagForNode | POST /nodes/{nodeId}/tags | Create a tag for a node |
TagsApi | deleteTagFromNode | DELETE /nodes/{nodeId}/tags/{tagId} | Delete a tag from a node |
TagsApi | getTag | GET /tags/{tagId} | Get a tag |
TagsApi | listTags | GET /tags | List tags |
TagsApi | listTagsForNode | GET /nodes/{nodeId}/tags | List tags for a node |
TagsApi | updateTag | PUT /tags/{tagId} | Update a tag |
TrashcanApi | deleteDeletedNode | DELETE /deleted-nodes/{nodeId} | Permanently delete a deleted node |
TrashcanApi | getArchivedNodeRendition | GET /deleted-nodes/{nodeId}/renditions/{renditionId} | Get rendition information for a deleted node |
TrashcanApi | getArchivedNodeRenditionContent | GET /deleted-nodes/{nodeId}/renditions/{renditionId}/content | Get rendition content of a deleted node |
TrashcanApi | getDeletedNode | GET /deleted-nodes/{nodeId} | Get a deleted node |
TrashcanApi | getDeletedNodeContent | GET /deleted-nodes/{nodeId}/content | Get deleted node content |
TrashcanApi | listDeletedNodeRenditions | GET /deleted-nodes/{nodeId}/renditions | List renditions for a deleted node |
TrashcanApi | listDeletedNodes | GET /deleted-nodes | List deleted nodes |
TrashcanApi | restoreDeletedNode | POST /deleted-nodes/{nodeId}/restore | Restore a deleted node |
VersionsApi | deleteVersion | DELETE /nodes/{nodeId}/versions/{versionId} | Delete a version |
VersionsApi | getVersion | GET /nodes/{nodeId}/versions/{versionId} | Get version information |
VersionsApi | getVersionContent | GET /nodes/{nodeId}/versions/{versionId}/content | Get version content |
VersionsApi | listVersionHistory | GET /nodes/{nodeId}/versions | List version history |
VersionsApi | revertVersion | POST /nodes/{nodeId}/versions/{versionId}/revert | Revert a version |
- Activity
- ActivityEntry
- ActivityPaging
- ActivityPagingList
- Association
- AssociationBody
- AssociationEntry
- AssociationInfo
- AuditApp
- AuditAppEntry
- AuditAppPaging
- AuditAppPagingList
- AuditBodyUpdate
- AuditEntry
- AuditEntryEntry
- AuditEntryPaging
- AuditEntryPagingList
- ChildAssociation
- ChildAssociationBody
- ChildAssociationEntry
- ChildAssociationInfo
- ClientBody
- Comment
- CommentBody
- CommentEntry
- CommentPaging
- CommentPagingList
- Company
- ContentInfo
- DeletedNode
- DeletedNodeEntry
- DeletedNodesPaging
- DeletedNodesPagingList
- Download
- DownloadBodyCreate
- DownloadEntry
- Error
- ErrorError
- Favorite
- FavoriteBodyCreate
- FavoriteEntry
- FavoritePaging
- FavoritePagingList
- FavoriteSite
- FavoriteSiteBodyCreate
- FavoriteSiteEntry
- GenericBucket
- GenericBucketBucketInfo
- GenericFacetResponse
- GenericMetric
- Group
- GroupBodyCreate
- GroupBodyUpdate
- GroupEntry
- GroupMember
- GroupMemberEntry
- GroupMemberPaging
- GroupMemberPagingList
- GroupMembershipBodyCreate
- GroupPaging
- GroupPagingList
- NetworkQuota
- Node
- NodeAssociation
- NodeAssociationEntry
- NodeAssociationPaging
- NodeAssociationPagingList
- NodeBodyCopy
- NodeBodyCreate
- NodeBodyCreateAssociation
- NodeBodyLock
- NodeBodyMove
- NodeBodyUpdate
- NodeChildAssociation
- NodeChildAssociationEntry
- NodeChildAssociationPaging
- NodeChildAssociationPagingList
- NodeEntry
- NodePaging
- NodePagingList
- Pagination
- PasswordResetBody
- PathElement
- PathInfo
- PermissionElement
- PermissionsBodyUpdate
- PermissionsInfo
- Person
- PersonBodyCreate
- PersonBodyUpdate
- PersonEntry
- PersonNetwork
- PersonNetworkEntry
- PersonNetworkPaging
- PersonNetworkPagingList
- PersonPaging
- PersonPagingList
- Preference
- PreferenceEntry
- PreferencePaging
- PreferencePagingList
- Rating
- RatingAggregate
- RatingBody
- RatingEntry
- RatingPaging
- RatingPagingList
- Rendition
- RenditionBodyCreate
- RenditionEntry
- RenditionPaging
- RenditionPagingList
- RequestDefaults
- RequestFacetField
- RequestFacetFields
- RequestFacetIntervals
- RequestFacetIntervalsIntervals
- RequestFacetQueries
- RequestFacetQueriesInner
- RequestFacetSet
- RequestFields
- RequestFilterQueries
- RequestFilterQueriesInner
- RequestHighlight
- RequestHighlightFields
- RequestInclude
- RequestLimits
- RequestLocalization
- RequestPagination
- RequestPivot
- RequestQuery
- RequestRange
- RequestScope
- RequestSortDefinition
- RequestSortDefinitionInner
- RequestSpellcheck
- RequestStats
- RequestTemplates
- RequestTemplatesInner
- ResponseConsistency
- ResultBuckets
- ResultBucketsBuckets
- ResultNode
- ResultSetContext
- ResultSetContextFacetQueries
- ResultSetContextSpellcheck
- ResultSetPaging
- ResultSetPagingList
- ResultSetRowEntry
- RevertBody
- SearchEntry
- SearchEntryHighlight
- SearchRequest
- SharedLink
- SharedLinkBodyCreate
- SharedLinkBodyEmail
- SharedLinkEntry
- SharedLinkPaging
- SharedLinkPagingList
- Site
- SiteBodyCreate
- SiteBodyUpdate
- SiteContainer
- SiteContainerEntry
- SiteContainerPaging
- SiteContainerPagingList
- SiteEntry
- SiteMember
- SiteMemberEntry
- SiteMemberPaging
- SiteMemberPagingList
- SiteMembershipBodyCreate
- SiteMembershipBodyUpdate
- SiteMembershipRequest
- SiteMembershipRequestBodyCreate
- SiteMembershipRequestBodyUpdate
- SiteMembershipRequestEntry
- SiteMembershipRequestPaging
- SiteMembershipRequestPagingList
- SitePaging
- SitePagingList
- SiteRole
- SiteRoleEntry
- SiteRolePaging
- SiteRolePagingList
- Tag
- TagBody
- TagEntry
- TagPaging
- TagPagingList
- UserInfo
- Version
- VersionEntry
- VersionPaging
- VersionPagingList
- Type: HTTP basic authentication
Rhuan Barreto - [email protected]