To add or remove a user from a Community, send a POST request
containing the necessary data to the portal URL.
The post must be of content-type “application/json” and use
the following syntax:
POST http://host/portal/server.pt/api/v1/user/current
{
"user": {
"joincommunityid": "COMMUNITY ID",
"leavecommunityid": "COMMUNITY ID"
}
}
For increased security, all JSON used in the API must
be comment filtered. The JSON data should be wrapped in /* */ for
any JSON, either in the API request or response. In addition, all
JSON output will be wrapped in a plain { } block so that it can't
be used directly in a script src tag.
This API currently only
supports the special keyword "current" for the user identifier, meaning
the current user. This API cannot be used to access users other than
the currently logged in user.
Variable |
Description |
COMMUNITY ID |
The ID of the Community to join or unsubscribe. |
The response will include one of the following HTTP
codes:
- 200 // successful
- 1000 // GENERAL - Unable to process request.
- 1010 // NOT_LOGGED_IN - The current user does not have access
to this API.
- 1020 // NOT_POST - This API only supports POSTs.
- 1030 // NO_POST_CONTENT - No POST content found.
- 1031 // NO_JSON_POST_CONTENT - JSON data not found in POST content.
- 2500 // NO_JSON_USER_OBJECT - User node not in JSON document.
- 2510 // NO_JOIN_COMMUNITY_ID - The API data did not include a
valid community ID to join.
- 2520 // NO_LEAVE_COMMUNITY_ID - The API data did not include a
valid community ID to leave.
- 2530 // INVALID_USER_ID - The User REST API found an invalid user
ID. The API currently only supports 'current' as a value.
- 2540 // JOIN_COMMUNITY_ERROR - Unable to join the specified community.
This community may no longer exist or be visible to this user.
- 2550 // LEAVE_COMMUNITY_ERROR - Unable to leave the specified
community. This community may no longer exist or be visible to this
user.
The response will be in JSON. The response body uses the following
syntax:
{
"user": {
"joincommunityid": "COMMUNITY ID",
"leavecommunityid": "COMMUNITY ID"
}
}
To view a complete implementation of this API, see the
Join Communities flyout included with the Oracle WebCenter Interaction
installation (in the image service under /plumtree/portal/private/joincommunities/).