Using Connect Enterprise Web Services |
|||
| Basics > Create groups | |||
To add users to groups, you need to call principal-update as your application's Administrator user.
principal-update:
https://example.com/api/xml?action=principal-update
&first-name=jazzwayjazz&last-name=doe&login=jazz@doe.com
&password=nothing&type=user&has-children=0
https://example.com/api/xml?action=principal-list&filter-type=user
principal-id:
<principal principal-id="5611980" account-id="624520" type="user"
has-children="false" is-primary="false" is-hidden="false">
<name>Joy Black</name>
<login>joy@acme.com</login>
<email>joy@acme.com</email>
</principal>
principal-list again to get the group's principal-id:
https://example.com/api/xml?action=principal-list&filter-type=group
group-membership-update with is-member=true to add the user to the group:
https://example.com/api/xml?action=group-membership-update
&group-id=4930296&principal-id=2006258745&is-member=true
principal-id is the user's principal-id.group-id is the group's principal-id.is-member must be true. principal-list with a group-id, filter-is-member, and a filter that identifies the principal:
https://example.com/api/xml?action=principal-list&group-id=624523
&filter-is-member=true&filter-like-name=bob
principal element in the response. A successful response looks like this:
<principal-list>
<principal principal-id="624660" account-id="624520" type="user"
has-children="false" is-primary="false" is-hidden="false">
<name>Bill Jones</name>
<login>bjones@acme.com</login>
<email>bjones@acme.com</email>
<is-member>true</is-member>
</principal>
</principal-list>
If the user is not a group member, the principal-list element is empty:
<?xml version="1.0" encoding="utf-8" ?>
<results>
<status code="ok" />
<principal-list />
</results>
principal-id, call principal-list with filters:
https://example.com/api/xml?action=principal-list&filter-type=group
&filter-name=developers
With filter-type and filter-name, principal-list should return a unique match.
rincipal-id:
<principal principal-id="2007105030" account-id="624520"
type="group" has-children="true" is-primary="false"
is-hidden="false">
<name>developers</name>
<login>developers</login>
<is-member>false</is-member>
</principal>
rincipal-id as a group-id and ilter-is-member=true:https://example.com/api/xml?action=principal-list&group-id=2007105030&filter-is-member=true
principal elements:
<principal principal-id="5698354" account-id="624520" type="group"
has-children="true" is-primary="false" is-hidden="false">
<name>Bob Jones</name>
<login>bobjones@acme.com</login>
<is-member>true</is-member>
</principal>
principal-list with the user's principal-id and filter-is-member=true:
https://example.com/api/xml?action=principal-list
&principal-id=2006258745&filter-is-member=true
principal elements:
<principal principal-id="5698354" account-id="624520" type="group"
has-children="true" is-primary="false" is-hidden="false">
<name>Bob Jones</name>
<login>bobjones@acme.com</login>
<is-member>true</is-member>
</principal>
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/breeze/6/xml_api/03_perm7.htm