mpjjonker
mpjjonker

Reputation: 947

Adding Community Members to a community activity using the REST API gives 403

We want to add community members (as author) to a community activity. We see that both on prem and in Connections Cloud, that we get a 403 error.

I have reproduced this using the SBT playground (https://greenhouse.lotus.com/sbt/SBTPlayground.nsf/Explorer.xsp#) This is the XML that we post:

<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app"  xmlns:snx="http://www.ibm.com/xmlns/prod/sn">
<id>test1234</id>
<contributor>
<name>Test User/name>
<snx:userid>TestID</snx:userid>
<snx:role>member</snx:role>
<snx:userState>active</snx:userState>
</contributor>
<title>Test User</title>
<updated>2016-03-04T09:25:17Z</updated>
<summary type="text">Member profile for Test User</summary>
<category scheme="http://www.ibm.com/xmlns/prod/sn/type" term="person">        </category>
<snx:role component="http://www.ibm.com/xmlns/prod/sn/activities">member</snx:role>
</entry>

To the Endpoint for activities: https://apps.na.collabserv.com/activities/service/atom2/acl?activityUuid=a750558c-d555-474d-8fcf-c3577276e9af

When we work "on-prem" we don't get error when we add community owners to the activity. Only when we (try to) add community members this 403 error occurs.

When we perform the action through the UI, there are no issues

Upvotes: 1

Views: 268

Answers (3)

Fouad Aarrass
Fouad Aarrass

Reputation: 36

We finaly have managed to add community members (not owners) to community_activity programmatically in IBM Connections. When creating a community activity, Ibm Connections adds groups (as role) to community activities. If you want to add a specific member to your activity as an editor/reader, then you have to tell IBM Connections what role you want to give the other members from the group.

Upvotes: 2

Manish Kataria
Manish Kataria

Reputation: 78

Sorry I missed the activity part, can you try below and share the exact error you get if any.

API : /activities/service/atom2/acl?activityUuid=

<?xml version="1.0" encoding="utf-8"?>
<entry xmlns="http://www.w3.org/2005/Atom"
  xmlns:snx="http://www.ibm.com/xmlns/prod/sn">
  <contributor>
   <email>[email protected]</email>
  </contributor>
  <category scheme="http://www.ibm.com/xmlns/prod/sn/type" term="person" />
  <snx:role component="http://www.ibm.com/xmlns/prod/sn/activities">member</snx:role>
</entry>

Upvotes: 0

Manish Kataria
Manish Kataria

Reputation: 78

Can you try with below api and I am also attaching sample body you should be posting.

API : https://apps.na.collabserv.com/communities/service/atom/community/members?communityUuid=

Body

<entry xmlns="http://www.w3.org/2005/Atom" xmlns:app="http://www.w3.org/2007/app" xmlns:opensearch="http://a9.com/-/spec/opensearch/1.1/" xmlns:snx="http://www.ibm.com/xmlns/prod/sn">
<contributor>
  <email>[email protected]</email>
  <snx:userid xmlns:snx="http://www.ibm.com/xmlns/prod/sn">202432348</snx:userid>
  <snx:userState xmlns:snx="http://www.ibm.com/xmlns/prod/sn">active</snx:userState>
  <snx:isExternal xmlns:snx="http://www.ibm.com/xmlns/prod/sn">false</snx:isExternal>
  <name>Manish Kataria</name>
</contributor>

<snx:role xmlns:snx="http://www.ibm.com/xmlns/prod/sn" component="http://www.ibm.com/xmlns/prod/sn/communities">owner</snx:role>
<category term="person" scheme="http://www.ibm.com/xmlns/prod/sn/type"></category>
<category term="business-owner" scheme="http://www.ibm.com/xmlns/prod/sn/type"></category>
<snx:orgId xmlns:snx="http://www.ibm.com/xmlns/prod/sn">186</snx:orgId></entry>

Make sure content type is application/atom+xml

Upvotes: 1

Related Questions