Social API – Tag Patterns and other optimization thoughts

Generally, I find developers implementing scenarios, such as “As a User, I need to iterate over X Social API, so I can find the right content.”  The scenario implies that the social metadata is included, however many developers iterate over the entries in the feeds to discover the Tag metadata.  If you read the documentation parameters, you can find optimizations to include metadata in the feed request, such as:

includeTags

boolean Yes Specifies whether or not the tags that are displayed on the file welcome page are included in the returned Atom document. This parameter takes a Boolean value of either true or false. By default, the tags are not returned.

The URL Parameter that reduces the total number of requests needed. For instance, the request for a each of the 10 entries in a feed, and then the tags for those 10 entries appears to require 11 API calls with the includeTags=true it can be accomplished in one request.

You can also optimize the request by manipulating the page size – 1,10 or 25.

In some cases, you can further optimize with batch requests when creating content. Example, the Activities API enables batch deletes of Members or the OpenSocial ActivityStream API which enables batch creation of updates.

First Time Through… BSS and API Explorer Tip

My colleague Phil Riand, since moved on to Trilog Group, created a very dynamic API Explorer which can be synchronized with the Documentation.  It’s good stuff, and a nice reference.

A customer ran into a problem calling the BSS APIs against the IBM Connections Cloud (IBM SmartCloud for Social Business) C1 Test Environment.  The default environment is setup with Open Authorization, and you can configure your own environment.

Login to Greenhouse

Use the Environments Drop down

Select Custom

Select IBM SmartCloud for Social Business

Select Basic Authorization

Click C1

Click Save

Screen Shot 2014-10-23 at 7.10.45 PM

Now Click on BSS -> Authorization

Click Login (Login with your C1 credentials)

Screen Shot 2014-10-23 at 7.12.54 PM

Use the APIs….

API Explorer

For those developers who are looking for the right API…. The IBM SmartCloud for Social Business has it’s own view on the API Explorer.

Navigate to https://greenhouse.lotus.com/sbt/SBTPlayground.nsf/Explorer.xsp

From the Environments Menu, select SmartCloud. You’ll see the view changes, and BSS and Social appear.

View

BSS is the Business Support Services, and Social is for the Social APIs which you can access and use in the Cloud.

Expand BSS

Click on Authentication

In the main pane, Click on Change Password

Click Login (gets you logged into SmartCloud)

Click Execute (You’ll see how the API works)

API

 

 

Creating a New Wiki Page as a Child

A partner asked how he could create a new wiki page with a specific parent. 

API Details
URL: https://{hostname}:{port}/wikis/basic/api/wiki/{wiki-label}/feed
Method: POST
Content-Type: application/atom+xml

You may have to add the X-Update-Nonce header.  

You have to update the XML with the parentUuid – eg bd586bb6-d9b2-4527-b9a0-0f9b0d3c1e3f

When you complete the post, you’ll have a new page with a parent page.