How to create site via REST API

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-08-2015 05:11 AM
Hello guys,
I am trying to create a site via REST API and I am not able to create it because of 401 Unauthorized - error.loggedOut.
Is here somebody who can tell me how to create site?
Here is my way:
1. Log in to get a ticket
2.Create site
Is this the correct procedure how to create site in share?
Thanks
-Roman
I am trying to create a site via REST API and I am not able to create it because of 401 Unauthorized - error.loggedOut.
Is here somebody who can tell me how to create site?
Here is my way:
1. Log in to get a ticket
POST /alfresco/service/api/login HTTP/1.1Host: localhost:8080Content-Type: application/jsonAccept: application/jsonCache-Control: no-cachePostman-Token: f6d43cb0-7788-9d22-f17e-635ea8d49e6e{"username":"admin","password":"enboxadmin"}
RESULT{ "data": { "ticket": "TICKET_253acd23d357b2405c446bf4ce662d0cc568a480" }}
2.Create site
POST /share/service/modules/create-site?alf_ticket=TICKET_253acd23d357b2405c446bf4ce662d0cc568a480 HTTP/1.1Host: localhost:8080Content-Type: application/jsonAccept: application/jsonCache-Control: no-cachePostman-Token: 77ab4770-730c-cacf-de98-6d1b80d74466{ "sitePreset": "site-dashboard", "shortName": "Sandbox", "title": "Sandbox site", "description": "This is a sample site.", "visibility": "PRIVATE" }
RESULT{ "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": "8.9.2015 5:06:04"}
Is this the correct procedure how to create site in share?
Thanks
-Roman
Labels:
- Labels:
-
Archive
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-16-2015 08:36 AM
You need to POST to /alfresco/s/api/sites (see http://docs.alfresco.com/5.0/references/RESTful-SiteSitesPost.html for more details).
George.
George.
