Adding a widget to a community.
Added by IBM contributorIBM | Edited by Claudia R Elbourn on July 7, 2015
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

To add a new widget to a Community, do a POST to a Widget Feed URL.
Tags: commapi

POSTing to a Widget Feed URL creates the widget specified in the widget entry of the request's body.

Table 1. Request/Response Parameters

Request URL
Request Body
Response Body
Possible Errors
<link> entry of a Community's service document with rel="http://www.ibm.com/xmlns/prod/sn/widgets"
Widget Entry - see Community Widgets Feed for entry details
Widget Entry of added widget
  • multiple instances not supported (403)
  • previous widget id doesn't exist (403)
  • prereq service not enabled (403)
  • widget definition not found (403)
  • Community id not found: (500)

Note adding the Media Gallery widget via this API is not supported.

Related Pages

Parent with ATOM entry documentation: Working with community widgets

Input
Method URI Description
POST /communities/service/atom/community/widgets <link> entry of a Community's service document with rel="http://www.ibm.com/xmlns/prod/sn/widgets"
Content Type: application/atom+xml
Sample Request:
<?xml version="1.0" encoding="UTF-8"?>
<entry xmlns:snx="http://www.ibm.com/xmlns/prod/sn" xmlns="http://www.w3.org/2005/Atom">>

<title type="text">Library</title>
<category term="widget" scheme="http://www.ibm.com/xmlns/prod/sn/type">
</category>



<snx:widgetDefId>Library</snx:widgetDefId>

<snx:widgetCategory>
</snx:widgetCategory>
<snx:hidden>false</snx:hidden>


</entry>
Name Type Optional Description
communityUuid
string No The UUID of the community you wish to add the widget to.
widgetDefId
string Yes ID of specific widget required. If left blank, all widgets will be added. See "Community widgets feed" document for details on widget entry values.
Output
Content Type: application/atom+xml
Code Description
403
multiple instances not supported
403
previous widget id doesn't exist
403
prereq service not enabled
403
widget definition not found
500
Community id not found