This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.

Working with User Info / History in Bitly

Overview

The following operations allow you to work with User Info/History. Click an operation name to see details on how to use it.

For a sample proxy service that illustrates how to work with User Info/History, see Sample configuration.

OperationDescription

getOauthApp

Returns information about an OAuth app.

getTrackingDomainListReturns a list of tracking domains a user has configured.
getUserInfoReturns or update information about a user.
getUserLinkHistoryReturns entries from a user's link history in reverse chronological order.
getUserNetworkHistoryReturns entries from a user's network history in reverse chronogical order.

Operation details

This section provides further details on the operations related to User Info / History.

Get information about an OAuth app.

The getOauthApp operation returns information about an OAuth app. .

getOauthApp
<bitly.getOauthApp>
        <clientId>{$ctx:clientId}</clientId>
 </bitly.getOauthApp>
Properties
  • clientId: the client ID of the app.
Sample request

Following is a sample REST/JSON request that can be handled by the getOauthApp operation.

Sample Request for getOauthApp
{
"clientId":"23349588675765765675845"
}
Related Bitly documentation

http://dev.bitly.com/user_info.html#v3_oauth_app

Get a list of tracking domains a user has configured .

The getTrackingDomainList operation returns a list of tracking domains a user has configured. .

getTrackingDomainList
<bitly.getTrackingDomainList/>

Get or update information about a user

The getUserInfo operation returns or update information about a user .

getUserInfo
<bitly.getUserInfo>        
     <fullName>{$ctx:fullName}</fullName>
</bitly.getUserInfo>
Properties
  • fullName: (optional) set the users full name value. (only available for the authenticated user.) .

Sample request

Following is a sample REST/JSON request that can be handled by the getUserInfo operation.

Sample Request for getUserInfo
{
"fullName":"Wso2Bitly"
}
Related Bitly documentation

http://dev.bitly.com/user_info.html#v3_user_tracking_domain_list

Get entries from a user's link history in reverse chronological order.

The getUserLinkHistory operation returns entries from a user's link history in reverse chronological order. .

getUserLinkHistory
<bitly.getUserLinkHistory>
     <linkForGetHistory>{linkForGetHistory}</linkForGetHistory>
     <limitForGetLink>{limitForGetLink}</limitForGetLink>
     <isPrivateLinks>{isPrivateLinks}</isPrivateLinks>
     <userForGetHistory>{userForGetHistory}</userForGetHistory>
     <queryForGetHistory>{queryForGetHistory}</queryForGetHistory>
</bitly.getUserLinkHistory>
Properties
  • linkForGetHistory: optional- the Bitlink to return metadata for (when specified, overrides all other options).

  • limitForGetLink: optional -integer in the range 1 to 100 default: 50, specifying the max number of results to return.

  • isPrivateLinks: optional- on, off and both whether to include or exclude private history entries. (on = return only private history entries) default: both.

  • userForGetHistory: optional- the user for whom to retrieve history entries (if different from authenticated user).

  • queryForGetHistory: optional- ad hoc text search string.

Sample request

Following is a sample REST/JSON request that can be handled by the getLinkSave operation.

Sample Request for getLinkSave
{
"linkForGetHistory":"20",
"limitForGetLink":"20"

}
Related Bitly documentation

http://dev.bitly.com/user_info.html#v3_user_link_history

Get entries from a user's network history in reverse chronogical order.

The getUserNetworkHistory operation returns entries from a user's network history in reverse chronogical order. (A user's network history includes publicly saved links from Twitter and Facebook connections.) .

getUserNetworkHistory
<bitly.getUserNetworkHistory>        
           <isExpandClientId>{isExpandClientId}</isExpandClientId>
           <limitForGetNW>{limit}</limitForGetNW>
           <isExpandUser>{expandUser}</isExpandUser>
</bitly.getUserNetworkHistory>
Properties
  • isExpandClientId: optional- true or false whether to provide additional information about encoding application. default: false.

  • limitForGetNW: optional -integer in the range of 1 to 100 that specifies the number of records to return (default: 20).

  • isExpandUser: optional - true or false - include extra user info in response (login, avatar_url, display_name, profile_url, full_name).

Sample request

Following is a sample REST/JSON request that can be handled by the getUserNetworkHistory operation.

Sample Request for getUserNetworkHistory
{
"isExpandClientId":"384783654765746546574656485648",
"limitForGetNW":"20"
}
Related Bitly documentation

http://dev.bitly.com/user_info.html#v3_user_link_history

Sample configuration

Following is a sample proxy service that illustrates how to connect to Bitly with the init operation and use the getOauthApp operation. The sample request for this proxy can be found in getOauthApp sample request.

Sample Proxy
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="bitly"
       transports="https,http"
       statistics="disable"
       trace="disable"
       startOnLoad="true">
   <target>
       <inSequence onError="faultHandlerSeq">
         <property name="accessToken" expression="json-eval($.accessToken)"/>
         <property name="bitlyLink" expression="json-eval($.bitlyLink)" />
         <bitly.init>
            <accessToken>{$ctx:accessToken}</accessToken>
         </bitly.init>
         <bitly.getOauthApp>
          <clientId>{$ctx:clientId}</clientId>
         </bitly.getOauthApp>
         <respond/>
      </inSequence>
      <outSequence>
         <send/>
      </outSequence>
   </target>
   <description/>
</proxy>