cancel
Showing results for 
Search instead for 
Did you mean: 

api to create a site inaccessible

andywong
Champ in-the-making
Champ in-the-making
Hi all:
  I was used the following api to create a web site:
  POST /alfresco/service/api/sites

  It can successfully create a site and I can view the site list in share platform. But when I click the site name. It take me a 500 error page.
This is the error detail message:

   A server error has occured.
   There are a number of reasons why this could have happened:
    You have attempted to access a page that does not exist - check the URL in the address bar.
    You have attempted to access a page that is not accessable to you, such as a private Site dashboard.
    A valid page has been requested but the server was unable to render it due to an internal error - contact your administrator.

But when I use share platform create a site. It work well.
I think the site link was not generated. But I don't know how to fix it. Anyone can help me?
Thanks very much.
2 REPLIES 2

rjohnson
Star Contributor
Star Contributor
I have done this, but its not as straightforward as it feels it should be. From memory if you just use the simple api service then whilst it creates a site it does not create all the "stuff" that Share needs to show it.

Using the reporsitory browser, navigate to your api created site and in another browser window navigate to a "share" created site. I suspect that your site will be missing quite a few folders and files.

You definitely can create sites using the API, I have done it via CMIS (using PHP) and I have my own "create sites" option on my own dashlet which is javascript (this is essentially a variation on the "My Sites" dashlet for which you have the source code on your server by definition).

Bob Johnson

mrksjs
Champ on-the-rise
Champ on-the-rise
There is a really good post from Martin Bergljung about this:

http://ecmstuff.blogspot.ch/2012/03/creating-alfresco-share-sites-with.html