Rediff Data & Pattern API Definitions - Version 1.0

Rediff API is a set of XML and Pattern APIs that you can use in your App. Rediff realizes that it is critical to provide a dependable interface between the App and Rediff’s social platform. To make the developer’s job easier, we provide templates for every XML request and response to and from the Rediff API server. The request templates allow you to interact with the Rediff API server. The response templates enable you to anticipate the format of the response from the Rediff API server.

note_icon_3.jpgWhen sending an request XML to the Rediff API server, you must enter your App's AuthKey and the AppKey. The remaining fields in the request XML can change based on the API you are calling.

Rediff APIs

Rediff groups together APIs based on functionality as:

  • Profile API This set of APIs return information from the user’s profile.
  • Friends API This set of APIs returns information about the user’s friends and enables you to invite friends to use an App.
  • Feed API This API allows the App to publish messages to the user’s page.

note_icon_3.jpgThe support for the Version 1.0 of the Rediff APIs will cease to exist after 31st December, 2010. If you are new to the Rediff API development platform, please view the updated and latest APIs Version 2.0 for building your apps.

Profile API

The Profile APIs enable you to retrieve user information such as the first name, last name, location, etc.

Data APIs

XML Request
Request URL http://www.rediffapi.com/data/profile
HTTP Method POST
Parameters xml
Request XML
<?xml version="1.0" encoding="UTF-8"?>
	<request>
		<authenticationset>
			<authkey>XXXXXXXXXXXXXXXXXXXXXX</authkey>
                        <appkey>ZZZZZZZZZZZZZZZZZZ</appkey>
                        <userid>YYYYYYYYYY</userid>
		</authenticationset>
		<requestinfo>
			<responsestyle>xml</responsestyle>
		</requestinfo>
		<content>
			<requestedaction>{all|firstname|lastname|location|status|
		photolink|friendcount|name}</requestedaction>
		</content>
	</request>
Exceptions * Incorrect Auth Key
* User ID does not exist
* Incorrect ResponseStyle
XML Responses
firstname
Description Returns the specified user's first name
Response XML
<?xml version="1.0" encoding="UTF-8"?>
	<response>
		<user>
			<firstname></firstname>
		</user>
	</response>
Exceptions ?
lastname
Description Returns the specified user's last name
Response XML
<?xml version="1.0" encoding="UTF-8"?>
	<response>
		<user>
			<lastname></lastname>
		</user>
	</response>
Exceptions ?
location
Description Returns the specified user's city and country
Response XML
<<?xml version=”1.0” encoding=”UTF-8”?>
	<response>
		<user>
			<location>
				<city></city>
				<country></country>
			</location>
		</user>
	</response>
Exceptions ?
status
Description Returns the specified user's current status message
Response XML
<<?xml version=”1.0” encoding=”UTF-8”?>
	<response>
		<user>
			<status></status>
		</user>
	</response>
Exceptions ?
photolink
Description Returns the specified user's photo
Response XML
<<?xml version=”1.0” encoding=”UTF-8”?>
	<response>
		<user>
			<photolink></photolink>
		</user>
	</response>
Exceptions ?
friendcount
Description Returns the number of friends the specified user has
Response XML
<<?xml version=”1.0” encoding=”UTF-8”?>
	<response>
		<user>
			<friendcount></friendcount>
		</user>
	</response>
Exceptions ?
name
Description Returns the specified user’s first name and last name
Response XML
<?xml version=”1.0” encoding=”UTF-8”?>
	<response>
		<user>
			<firstname></firstname>
			<lastname></lastname>
		</user>
	</response>
Exceptions ?
all
Description Returns all the details of the specified user
Response XML
<?xml version=”1.0” encoding=”UTF-8”?>
	<response>
		<user>
			<firstname></firstname>
			<lastname></lastname>
			<location>
				<city></city>
				<country></country>
			</location>
			<status></status>
			<friendcount></friendcount>
			<photolink></photolink>
		</user>
	</response>
Exceptions ?

Friends API

The Friends API provides you with basic information about the user’s friends on Rediff’s social network.

Data APIs

XML Request
Request URL http://www.rediffapi.com/data/friends
HTTP Method POST
Parameters xml
Request XML
<?xml version="1.0" encoding="UTF-8"?>
	<request>
		<authenticationset>
			<authkey>XXXXXXXXXXXXXXXXXXXXXX</authkey>
                        <appkey>ZZZZZZZZZZZZZZZZZZ</appkey>
			<userid>YYYYYYYYYY</userid>
		</authenticationset>
		<requestinfo>
			<responsestyle>xml</responsestyle>
		</requestinfo>
		<content>
			<requestedaction>getFriends</requestedaction>
		</content>
	</request>
Exceptions ?
XML Responses
getFriends
Description Returns a list of friends for the specified user along with details such as user ID, firstname, lastname, status etc.
Response XML
<?xml version=”1.0” encoding=”UTF-8”?>
		<response>
			<users>
				<usersMeta>
					<startCount></startCount>
					<count></count>
					<totalCount></totalCount>
				</usersMeta>
				<user>
					<userid></userid>
					<firstname></firstname>
					<lastname></lastname>
					<status></status>
					<location>
						<city></city>
						<country></country>
					</location>
				</user> 
				<user></user>
				<user></user>
				<user></user>
			</users>
		</response>
Exceptions ?

Pattern APIs

Invite Friends to the App

This pattern allows the developers to quickly incorporate the pattern to Invite friends to the app being used.

<div id="rediff-studio-badge-for-invite">
       <script type="text/javascript" src="http://apps.rediff.com/patternLayout/invite/fetch/{userid}/{authkey}" ></script>
</div>

Required Variables

The following variables need to be declared and set in your Javascript code for the proper execution of the pattern.

// App's Authkey
var APP_AUTH_KEY="71283yu2y812ewegt7wt11ye182e7t18e ";
Add Friends to MyPage

This pattern allows the developers to quickly incorporate the pattern to Add/Invite friends to a user's MyPage account.

<div id="rediff-studio-badge-for-addition" >
        <script type="text/javascript" src="http://apps.rediff.com/patternLayout/addition/fetch/{userid}/{authkey}" ></script>
</div>

Required Variables

The following variables need to be declared and set in your Javascript code for the proper execution of the pattern.

// App's Authkey
var APP_AUTH_KEY="71283yu2y812ewegt7wt11ye182e7t18e ";
Feed Publisher

The Feed Publisher Pattern allows the developers to quickly incorporate a feed publishing mechanism into their code.

If you want the ready-made button, here is the code:

<div id="rediff-studio-badge-for-publisher">
    <script type="text/javascript" src="http://apps.rediff.com/patternLayout/publisher/fetch/{userid}/{authkey}" ></script>
</div>

If you want to code the trigger to the feed-publish modal yourself, here is the javascript:

<div id="rediff-studio-badge-for-publisher" >
  <script type="text/java-script" src="http://apps.rediff.com/patternLayout/publisher/feed_js/[USERID]/[AUTHKEY]" ></script>
 
  <INPUT TYPE="button" VALUE="Share with Friends" ONCLICK="showFeedModal();">
  <!-- Replace this INPUT with what you want, the ONCLICK is what you actually need -->
</div>

Required Variables

The following variables need to be declared and set in your Javascript code for the proper execution of the pattern.

       // App's Authkey
       var APP_AUTH_KEY="71283yu2y812ewegt7wt11ye182e7t18e";
       // The message to be published to the feed. If 'null', then the pattern displays the error message defined below.
       var FEED_PUBLISH_MSG = null;
       // The title for the feed.
       var FEED_PUBLISH_TITLE = null;
       // The URL of the thumbnail associated with the feed message.
       var FEED_PUBLISH_THUMB_URL = null;
       // The title of the button that will invoke the pattern.
       var FEED_PUBLISH_BUTTON_TITLE = "Share Your Mood";
       // The error message to be displayed if the FEED_PUBLISH_MSG variable is not set.
       var FEED_PUBLISH_ERR_MESSAGE = "You need to select your mood before you can share it with your friends";
       // The APP ID of the app
       var APP_ID = "xxx";

CLICK HERE to return to the main Table of Contents.

understand_rediff_api_definitions.txt · Last modified: 2010/11/02 14:52 by 202.137.232.117
Back to top
CC Attribution-Noncommercial-Share Alike 3.0 Unported
chimeric.de = chi`s home Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0