cancel
Showing results for 
Search instead for 
Did you mean: 

What is the base url for the Alfresco REST API?

bettyblocks
Champ in-the-making
Champ in-the-making

Im making the Alfresco REST API, i can find the endpoints etc like:/org/alfresco/repository.
But i cant find the base url(host) anywhere?, am i just searching wrong or did i miss something? 


Thanks for reading.

3 REPLIES 3

afaust
Legendary Innovator
Legendary Innovator

You need to specify which ReST API you want to use. There is the "legacy" or internal ReST API that Alfresco primarily uses to support Share, and which should not be relied upon for 3rd-party integrations. The base URL for this would be 

<yourProtocol>://<yourHost>:<exposedPort>/alfresco/service/... (HTTP BASIC)
<yourProtocol>://<yourHost>:<exposedPort>/alfresco/s/... (alias for service)
<yourProtocol>://<yourHost>:<exposedPort>/alfresco/wcservice/... (SSO as configured in Alfresco)
<yourProtocol>://<yourHost>:<exposedPort>/alfresco/wcs/... (alias for wcservice)

Of course yourProtocol, yourHost and yourPort depends on your specific infrastructure / setup. Even the /alfresco part may be changed, but in my experience rarely isn't. If you don't know how you can access your Alfresco system, you should talk with your Alfresco / system administrator.

The ReST v1 API - which is the recommended API to use since Alfresco 5.2 - can be accessed under

<yourProtocol>://<yourHost>:<yourPort>/alfresco/api/-default-/public/<service>/versions/<apiVersion>/<operation>

For the v1 ReST API, the API version is of course "1".

What you remarked as having found the endpoints /org/alfresco/repository/... refers to the source files of the web scripts, which implement the "legacy" / internal ReST API.

bettyblocks
Champ in-the-making
Champ in-the-making

Thanks for the answer, 


Is there some kind of example(demo) that i can use for this,

<yourProtocol>://<yourHost>:<exposedPort>

Because im making the api as a template, so clients can just instal the api and connect it to their account.

And if i want to make a request, how does my path look? for example: i want to Get all Comments

I have the base url

<yourProtocol>://<yourHost>:<yourPort>/alfresco/api/-default-/public/<service>/versions/<apiVersion>/<operation>

and then i can just past this behind it?
/alfresco/service/api/node/{store_type}/{store_id}/{id}/comments?reverse={reverse?}

afaust
Legendary Innovator
Legendary Innovator

Examples for building the base of an URL... you mean like http://localhost/ (port 80 is implied) or http://localhost:8080/ or https://my.cool.server.de/ (port 443 is implied)? I did not think such things needed an example. It should be clear that you cannot simply put a hard-coded value for this in any template, as the exact values will differ from Alfresco system to Alfresco system, most prominently in the host part.

The /alfresco/service/api/node/{store_type}/{store_id}/{id}/comments?reverse={reverse?} path you listed is part of the "legacy" / internal ReST API (it matches with the /alfresco/service/ endpoint I listed). The ReST v1 API for comments is described in this blog post.

It goes without saying that the base URL for the ReST v1 API cannot be combined with a path specific to the "legacy" / internal ReST API....