Add an activity member programmaticallyTo add a member to the access control list of an activity, send an Atom entry document containing the new member to the access control list feed. You can only add one member per post.
See Authenticating requests for information about how to authenticate the request.
Table 1. Atom API request details
Method Resource URI Input representation POST acl list feed Found in the href attribute of <link> element that has a rel="http://www.ibm.com/xmlns/prod/sn/member-list" attribute value for each activity member
To add a member to the member list of a community activity...
- Make sure that the community activity to which you want to add members supports the addition of members. The community activity must have a category element of type explicit_membership_community_activity. For example:
<category scheme="http://www.ibm.com/xmlns/prod/sn/type" term="explicit_membership_community_activity" label="Explicit Membership Community Activity"/>
If it has a category element of type community_activity, you cannot define the members; they are instead inherited from the community membership list.
- You can only add all or a subset of the members who belong to the community to which the activity belongs. If you add a person who is not a member of the owning community, an error is returned on the request. To find out who belongs to the owning community...
- Get the My Communities feed. See Search the My Communities view.
- From the My Communities feed, find the community to which this activity belongs. Within its entry, find the link element with the rel="http://www.ibm.com/xmlns/prod/sn/member-list" attribute. Make a note of the value of the associated href attribute.
- Send a GET request to the web address that you noted in the previous step.
The returned feed lists each member of the community as a separate entry.
- In the Atom documents that you create to define each member of the community activity, do not include anyone who is not listed in the member list feed of the community.
InputProvide a member Atom entry document. The content type of the Atom entry document must be application/atom+xml.
OutputAn Atom entry document containing the new member entry.
Returned HTTP headers
HTTP/1.1 201 Created
Indicates that the member was successfully added to the acl list. If an error occurs, this header contains one of the error codes.
Link to edit_url of the new member entry. You can use the web address specified here to subsequently retrieve and update the member entry.
- HTTP/1.1 400 Bad Request
- HTTP/1.1 403 Forbidden
Parent topicWork with activity members
Add a member programmatically
Member entry content
Getting the My Communities feed
Create community activities