cancel
Showing results for 
Search instead for 
Did you mean: 

Alfresco 5.0.d site creation - error.loggedOut

jamalissimo
Champ in-the-making
Champ in-the-making
Hi guys,

I am working on Alfresco shared site creation. I want to use REST API, but I keep stumbling on various problems. The first and main issue is which interface to use??? I am reading forums and googling for 2 days and I found like 4 interfaces and none of them works properly:

<ul>/wcservice/api/sites - doesn't work at all</ul>
<ul>/s/api/sites - doesn't work at all</ul>
<ul>/alfresco/service/api - works, but only creates site and nothing else</ul>
<ul>/share/service/modules/create-site - should be the one to use</ul>

So I started to discover secrets of shared site creation. First mystery was to find what the json body looks like. I found this, but I am not sure if it is correct:



{
    "sitePreset": "site-dashboard",
    "shortName": "Sandbox",
    "title": "Sandbox site",
    "description": "This is a Sandbox site.",
    "visibility": "PRIVATE",
    "isVisible" : "false",
    "id" : "SANDBOX"
}


This kind of worked, but I received error json with message error.loggedOut.
Ok, no problem, I will just log in here /alfresco/service/api/login, ok I have the ticket ,,, and what??? Where should I put the ticket? It is very unclear and nowhere to be found. Someone says put it to json like this:


{
    "sitePreset": "site-dashboard",
    "shortName": "Sandbox",
    "title": "Sandbox site",
    "description": "This is a Sandbox site.",
    "visibility": "PRIVATE",
    "ticket":"TICKET_b80585cc24547951d13c9c5df16fe0957d4a11df"
}


It does not work! Then some says "put it as parameter alf_ticket, ticket or alfTicket" like this:

<ul>/share/service/modules/create-site?ticket=TICKET_b80585cc24547951d13c9c5df16fe0957d4a11df</ul>
or
<ul>/share/service/modules/create-site?alf_ticket=TICKET_b80585cc24547951d13c9c5df16fe0957d4a11df</ul>
or
<ul>/share/service/modules/create-site?alfTicket=TICKET_b80585cc24547951d13c9c5df16fe0957d4a11df</ul>

This does not work either and I keep getting this error json:


{
  "status": {
    "code": 401,
    "name": "Unauthorized",
    "description": "The request requires HTTP authentication."
  },
  "message": "error.loggedOut",
  "exception": "",
  "callstack": [],
  "server": "Spring WebScripts - v5.0.0 (Release) schema 1 000",
  "time": "3.9.2015 10:42:27"
}


Could someone please tell me how to create shared site or point me somewhere atleast?

Thanks
Roman
1 REPLY 1

jamalissimo
Champ in-the-making
Champ in-the-making
From my point of view it looks like an authorization problem. I can successfully log in and get the ticket. I also can verify the ticket but when I use it as alf_ticket, then I get 401 unauthorized.

This is the http request I use:


POST /share/service/modules/create-site?alf_ticket=TICKET_a5f07642716f12cdee2e4904b6ad6deb2ac8aa16 HTTP/1.1
Host: mydomain.com
Content-Type: application/json
Accept: application/json
Cache-Control: no-cache
Postman-Token: 244bd45c-04fa-73f0-7f53-63c6db867397

{
    "sitePreset": "site-dashboard",
    "shortName": "Sandbox",
    "title": "Sandbox prettyname",
    "description": "Sandbox",
    "visibility": "PRIVATE"
  }


Can somebody give me some advice please?

Thanks
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.