Please I'm new to Alfresco and I tried to create a group using curl on my command line terminal. Here's the code:
curl -uadmin:rockstar -X PUT { "newGroup" : ["authorityType" : "GROUP", "shortName" : "COMPUTER_SCIENCE_400LVL", "fullName" : "COMPUTER_SCIENCE_400_LEVEL", "displayName" : "COMPUTER_SCIENCE_400LVL", "url" : "api/groups/COMPUTER_SCIENCE_400LVL", "zones" : ["APP.DEFAULT", "AUTH.ALF"] "http://localhost:8080/alfresco/service/api/groups"
But I got this error:
curl: (3) [globbing] unmatched brace in column 1
curl: (6) Could not resolve host: newGroup
curl: (6) Could not resolve host:
curl: (3) [globbing] bad range in column 2
curl: (6) Could not resolve host:
curl: (6) Could not resolve host: GROUP,
curl: (6) Could not resolve host: shortName
curl: (6) Could not resolve host:
curl: (6) Could not resolve host: COMPUTER_SCIENCE_400LVL,
curl: (6) Could not resolve host: fullName
curl: (6) Could not resolve host:
curl: (6) Could not resolve host: COMPUTER_SCIENCE_400_LEVEL,
curl: (6) Could not resolve host: displayName
curl: (6) Could not resolve host:
curl: (6) Could not resolve host: COMPUTER_SCIENCE_400LVL,
curl: (6) Could not resolve host: url
curl: (6) Could not resolve host:
curl: (6) Could not resolve host: api
curl: (6) Could not resolve host: zones
curl: (6) Could not resolve host:
curl: (3) [globbing] bad range in column 2
curl: (3) [globbing] unmatched close brace/bracket in column 9
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Web Script Status 405 - Method Not Allowed</title>
<link rel="stylesheet" href="/alfresco/css/webscripts.css" type="text/css" />
</head>
<body>
<div>
<table>
<tr>
<td><img src="/alfresco/images/logo/AlfrescoLogo32.png" alt="Alfresco" /></td>
<td><span class="title">Web Script Status 405 - Method Not Allowed</span></td>
</tr>
</table>
<br/>
<table>
<tr><td>The Web Script <a href="%2Falfresco%2Fservice%2Fapi%2Fgroups">/alfresco/service/api/groups</a> has responded with a status of 405 - Method Not Allowed.</td></tr>
</table>
<br/>
<table>
<tr><td><b>405 Description:</b></td><td> The method specified in the Request-Line is not allowed for the resource identified by the Request-URI.</td></tr>
<tr><td> </td></tr>
<tr><td><b>Message:</b></td><td>03110002 Script url /api/groups does not support the method PUT</td></tr>
<tr><td><b>Server</b>:</td><td>Community v5.2.0 (re21f2be5-b22) schema 10,057</td></tr>
<tr><td><b>Time</b>:</td><td>Apr 11, 2018 10:50:37 AM</td></tr>
<tr><td></td><td> </td></tr>
</table>
</div>
</body>
</html>
Please tell me what i'm missing. Thanks in advance.
Solved! Go to Solution.
You would have to put -d in front of your JSON Data and put the data in single quotes. I usually declare the content type -H 'Content-Type: application/json' so
curl -uadmin:rockstar -H 'Content-Type: application/json' -X PUT -d '{ "newGroup" :.......}' ....
should do it
You would have to put -d in front of your JSON Data and put the data in single quotes. I usually declare the content type -H 'Content-Type: application/json' so
curl -uadmin:rockstar -H 'Content-Type: application/json' -X PUT -d '{ "newGroup" :.......}' ....
should do it
Sorry for the late reply, Thanks. This really helped!
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.