Givealink API Documentation

Overview

The Givealink API allows you to call methods that respond in REST style xml. The API root URL is located at http://givealink.org/api/2.0/. Some methods are public, i.e., they do not require user authentication, while others are private, e.g., write services. A user wanting to invoke a private method needs to be authenticated by way of the scheme described in the Authentication How-To section.

Encoding

Use UTF-8 encoding when sending arguments to API methods.

Request Styles

The Consumer sends a request to the root URL specifying a method in the form package.method with a set of parameters (required plus possible optional). The API action is specified via the required parameter method.

For example, the call http://givealink.org/api/2.0/?method=tag.getTopTags&limit=10&api_key=XXXXXX invokes the method tag.getTopTags with the parameter n specifying the number of most popular tags to return.

Response Styles

The API responds in XML format following the template below:

    <givealink status="status_message">
      payload
    </givealink>
    

where status_message : [ok|fail] and payload is the content of the reply.

Example:

    <givealink status="ok">
      response of the API call
    </givealink>
    

Or in the case of error:

    <givealink status="fail">
      <message>error_message</message>
      <code>error_code</code>
    </givealink>
    

where error_code and error_message depend on the called API method.

Authentication

The authentication protocol allows you to perform actions on user accounts in a manner that is secure for Givealink users. All write services require authentication. Givealink is a OAuth Service Provider using OAuth for user authorization. See the Authentication How-To for more details.

Givealink provides authentication methods to the following URLs:

  1. Get an Unauthorized Request Token:   http://givealink.org/oauth/request_token
  2. Obtaining User Authorization:   http://givealink.org/oauth/authorize
  3. Get an Access Token:   http://givealink.org/oauth/access_token

Terms of use

Please use an identifiable User-Agent header on all requests. This reduces the risk of your application getting banned and helps our logging.

Use common sense when deciding how many calls to make. For example, if you're making a web application, try not to hit the API on page load. You account may be suspended if your application makes calls too frequently.



API methods specification

User.getAnnotations

Returns the set of annotations from a user

Params

api_keyrequiredA Givealink API key
userrequiredEmail of the user in question
tagoptionalA space separated list of tags
urloptionalA space separated list of urls
pagoptionalThe page you want to fetch to (the result set is divided in pages of 40 elements)
limitoptionalLimit the amount of annotations returned
with_titleoptionalRetrieve the title associated to an annotation (yes/no)
with_descoptionalRetrieve the description associated to an annotation (yes/no)
with_timeoptionalRetrieve the timestamp associated to an annotation (yes/no)

Authentication

This service requires authentication. Please see our Authentication How-To for details.

Sample Response

<givealink status="ok">
  <usergetannotations user="mario.rossi@givealink.org" page="1" nPages="22">
    <url name="http://news.cnet.com/" desc="Website dedicated to technology"
            title="Technology News - CNET News">
      <tag name="news" time="Mon Sep 14 15:59:17 +0200 2009">
      <tag name="tech" time="Mon Sep 14 16:22:45 +0200 2009">
    </url>
  ...
  </usergetannotations>
</givealink>

Errors

1INVALID_PARAMETERSYour request is missing a required parameter
2INVALID_API_KEYYou must be granted a valid key by Givealink
3INVALID_METHODNo method with that name in this package
7UNAUTHORIZEDInvalid OAuth Request
12WRONG_DATA_TYPEType not allowed in a parameter

Tag.delete

Delete a tag and all the related annotations

Params

userrequiredUser in question
tagrequiredTag to delete
api_keyrequiredA Givealink API key

Authentication

This service requires authentication. Please see our Authentication How-To for details.

Sample Response

<givealink status="ok">
</givealink>

Errors

1INVALID_PARAMETERSYour request is missing a required parameter
2INVALID_API_KEYYou must be granted a valid key by Givealink
3INVALID_METHODNo method with that name in this package
7UNAUTHORIZEDInvalid OAuth Request
10UNKNOWN_TAGUnknown tag in question
8UNKNOWN_USERUnknown user in question

Tag.getSimilar

Returns a list of tags similar to a given tag

Params

tagrequiredTag in question
api_keyrequiredA Givealink API key
limitoptionalLimit the amount of similar tags returned.maximum/default is 40)

Authentication

This service does not require authentication.

Sample Response

<givealink status="ok">
  <taggetsimilar tag="news">
    <tag name="technology" sim="0.92385"/>
    <tag name="business" sim="0.92385"/>

    ...
  </taggetsimilar>
</givealink>

Errors

1INVALID_PARAMETERSYour request is missing a required parameter
2INVALID_API_KEYYou must be granted a valid key by Givealink
3INVALID_METHODNo method with that name in this package
10UNKNOWN_TAGUnknown tag in question

Tag.getTags

Returns a list of most used tags

Params

modeoptionalChoose which mode you want to use (top/random, default mode is top).
When mode="top" it returns the most popular urls; when mode="random" it returns random urls.
spamoptionalWhether filter out the spam tags (yes/no, default is yes).
When spam="yes" it remians the possible spam tags; when spam="no" it filters out the possible spam tags.
limitoptionalLimit the amount of tags returned (maximum/default is 40)
api_keyrequiredA Givealink API key

Authentication

This service does not require authentication.

Sample Response

<givealink status="ok">
  <taggettags mode="top" limit="40">
    <tag name="research" strength="25.5125"/>
    <tag name="business" strength="9.63206"/>

    ...
  </taggettags>
</givealink>

Errors

1INVALID_PARAMETERSYour request is missing a required parameter
2INVALID_API_KEYYou must be granted a valid key by Givealink
3INVALID_METHODNo method with that name in this package

Tag.getUrls

Returns a list of urls annotated by this tag

Params

tagrequiredGet urls of this tag
with_titleoptionalWhether includes url titles or not(yes/no, defalut is "no")
limitoptionalLimit the number of urls for each tag returned (maximum/default is 20)
api_keyrequiredA Givealink API key

Authentication

This service does not require authentication.

Sample Response

<givealink status="ok">
  <taggeturls tag="google" with_title="no" limit="40">
    <url name="www.google.com" />
    <url name="scholar.google.com" />

    ...
  </taggeturls>
</givealink>

Errors

1INVALID_PARAMETERSYour request is missing a required parameter
2INVALID_API_KEYYou must be granted a valid key by Givealink
3INVALID_METHODNo method with that name in this package
10UNKNOWN_TAGUnknown tag in question

Tag.isSpam

Returns the results of whether a list of tags are spam or not.

Params

tagrequiredA list of tags to be decided whether they are spam or not
api_keyrequiredA Givealink API key

Authentication

This service does not require authentication.

Sample Response

<givealink status="ok">
  <isspam tag="indiana" is_spam="false" name="indiana" />
  <isspam tag="online" is_spam="true" name="online" />
  <isspam tag="web" is_spam="true" name="web" />
  ...
</givealink>

Errors

1INVALID_PARAMETERSYour request is missing a required parameter
2INVALID_API_KEYYou must be granted a valid key by Givealink
3INVALID_METHODNo method with that name in this package

Tag.search

Returns related information when searching by tags.

Params

tagrequiredOne or multiple tags as search keywords
api_keyrequiredA Givealink API key

Authentication

This service does not require authentication.

Sample Response

<bipartite>
  <urls>
    <information count="50">
    <url tags="imported learn group university meeting indiana ceramics iu fil" 
	  url="http://homer.informatics.indiana.edu/~nan/" 
	  title="Homer~nan/" />
    <url tags="systems research agents university ai meeting complex informatics ceramics iu alife" 
	  url="http://cx.informatics.indiana.edu/" 
	  title=" Center for Complex Networks and Systems Research" />
    ...
  </urls>
  <tags>
    <information count="15"/>
    <tag centrality="470.725" name="indiana"/>
    <tag centrality="10597.9" name="imported"/>
	...
  </tags>  
  <pairs>
    <information count="6"/>
    <pair tag="indiana" url="http://homer.informatics.indiana.edu/~nan/"/>
    <pair tag="indiana" url="http://homer.informatics.indiana.edu/~nan/"/>
	...
  </pairs>
</bipartite>

Errors

1INVALID_PARAMETERSYour request is missing a required parameter
2INVALID_API_KEYYou must be granted a valid key by Givealink
3INVALID_METHODNo method with that name in this package

Tag.similarity

Returns similarities of each pair of tags in a list of tags.

Params

tagrequiredTags are space-sperated
api_keyrequiredA Givealink API key

Authentication

This service does not require authentication.

Sample Response

<givealink status="ok">
  <tagsims>
    <edge source="web" target="webdesign" sim=28.1577 />
    <edge source="web" target="model" sim=1.92 />

    ...
  </tagsims>
</givealink>

Errors

1INVALID_PARAMETERSYour request is missing a required parameter
2INVALID_API_KEYYou must be granted a valid key by Givealink
3INVALID_METHODNo method with that name in this package

Tag.subtag

For each annotation containing a given tag create a copy replacing the tag field with a new tag

Params

tagrequiredTag in question
sub_tagrequiredNew tag
userrequiredUser in question
api_keyrequiredA Givealink API key

Authentication

This service requires authentication. Please see our Authentication How-To for details.

Sample Response

<givealink status="ok">
</givealink>

Errors

1INVALID_PARAMETERSYour request is missing a required parameter
2INVALID_API_KEYYou must be granted a valid key by Givealink
3INVALID_METHODNo method with that name in this package
6INVALID_TAGInvalid tag specified: it is either empty or only contains disallowed characters
7UNAUTHORIZEDInvalid OAuth Request
10UNKNOWN_TAGUnknown tag in question
8UNKNOWN_USERUnknown user in question
13INTERNAL_ERRORInternal server error

Tag.update

Update the annotations containing a given tag with a new tag

Params

old_tagrequiredTag to update
new_tagrequiredNew tag
userrequiredUser in question
api_keyrequiredA Givealink API key

Authentication

This service requires authentication. Please see our Authentication How-To for details.

Sample Response

<givealink status="ok">
</givealink>

Errors

1INVALID_PARAMETERSYour request is missing a required parameter
2INVALID_API_KEYYou must be granted a valid key by Givealink
3INVALID_METHODNo method with that name in this package
6INVALID_TAGInvalid tag specified: it is either empty or only contains disallowed characters
7UNAUTHORIZEDInvalid OAuth Request
10UNKNOWN_TAGUnknown tag in question
8UNKNOWN_USERUnknown user in question
13INTERNAL_ERRORInternal server error

Url.generate

Return a url randomly selected.

Params

limitoptionalThe number of returned random urls, default value is 1.
with_titleoptionalWhether return title of urls ("yes"/"no"), default value is "no".
api_keyrequiredA Givealink API key

Authentication

This service does not require authentication.

Sample Response

<givealink status="ok">
  <urlgenerate limit="2" with_title="yes" >
    <url name="www.iub.edu" titl="Indiana University Bloomington" />
    <url name="http://www.laurodesigner.it/" titl="Lauro design" />
  </urlgenerate >
</givealink>

Errors

1INVALID_PARAMETERSYour request is missing a required parameter
2INVALID_API_KEYYou must be granted a valid key by Givealink
3INVALID_METHODNo method with that name in this package
9UNKNOWN_URLUnknown url in question

Url.getInfo

Get the title and the description associated to a url

Params

urlrequiredUrl in question
userrequiredUser in question
api_keyrequiredA Givealink API key

Authentication

This service requires authentication. Please see our Authentication How-To for details.

Sample Response

<givealink status="ok">
  <urlgetinfo url="http://www.wordreference.com">
    <info title="Wordreference.com"
          desc="English to French, Italian & Spanish Dictionary - WordReference.com" >
  </urlgetinfo>
</givealink>

Errors

1INVALID_PARAMETERSYour request is missing a required parameter
2INVALID_API_KEYYou must be granted a valid key by Givealink
3INVALID_METHODNo method with that name in this package
7UNAUTHORIZEDInvalid OAuth Request
9UNKNOWN_URLUnknown url in question

Url.getSimilar

Get the urls similar to this url

Params

pag
urlrequiredUrl in question
limitoptionalLimit the amount of urls returned
optionalThe page you want to fetch to (the result set is divided in pages of 40 elements)
api_keyrequiredA Givealink API key

Authentication

This service does not require authentication.

Sample Response

<givealink status="ok">
  <urlgetsimilar pag="1" nPages="12" >
    <url name="http://www.wordreference.com/"/>
      <similar name="http://dictionary.cambridge.org/" value="1"/>
      <similar name="http://www.thefreedictionary.com/" value="1"/>
      <similar name="http://www.cnn.com/" value="0.0767"/>

    ...
  </urlgetsimilar>
</givealink>

Errors

1INVALID_PARAMETERSYour request is missing a required parameter
2INVALID_API_KEYYou must be granted a valid key by Givealink
3INVALID_METHODNo method with that name in this package
9UNKNOWN_URLUnknown url in question

Url.getTags

Returns a list of tags used for this url.

Params

urlrequiredGet tagss of this url
limitoptionalLimit the amount of tags returned (maximum/default is 40)
api_keyrequiredA Givealink API key

Authentication

This service does not require authentication.

Sample Response

<givealink status="ok">
  <urlgettags url="http://www.iub.edu/" limit="40">
    <tag name="iu" />
    <tag name="indiana_university" />

    ...
  </urltags>
</givealink>

Errors

1INVALID_PARAMETERSYour request is missing a required parameter
2INVALID_API_KEYYou must be granted a valid key by Givealink
3INVALID_METHODNo method with that name in this package
9UNKNOWN_URLUnknown url in question

Url.getTitle

Returns a title of the given url randomly.

Params

urlrequiredGet title of this url
api_keyrequiredA Givealink API key

Authentication

This service does not require authentication.

Sample Response

<givealink status="ok">
  <gettitle url="http://www.google.com/" />
</givealink>

Errors

1INVALID_PARAMETERSYour request is missing a required parameter
2INVALID_API_KEYYou must be granted a valid key by Givealink
3INVALID_METHODNo method with that name in this package
9UNKNOWN_URLUnknown url in question

Url.isSpam

Returns the results of whether a list of urls are spam or not.

Params

urlrequiredA list of urls to be decided whether they are spam or not
api_keyrequiredA Givealink API key

Authentication

This service does not require authentication.

Sample Response

<givealink status="ok">
  <isspam url="http://www.google.com/" is_spam="false" name="http://www.google.com/" />
  <isspam url="http://www.iub.edu/" is_spam="false" name="http://www.iub.edu/" />
  ...
</givealink>

Errors

1INVALID_PARAMETERSYour request is missing a required parameter
2INVALID_API_KEYYou must be granted a valid key by Givealink
3INVALID_METHODNo method with that name in this package

Url.search

Returns related information when searching by urls.

Params

urlrequiredOne or multiple urls as search keywords
api_keyrequiredA Givealink API key

Authentication

This service does not require authentication.

Sample Response

<bipartite>
  <urls>
    <information count="50">
    <url tags="online web internet search engine news imported tools information 
	bookmarks google reference resources financial planning links math investing computers 
	bar bookmark menu engines district explorer folder educator search developments" 
	  url="http://www.google.com/" 
	  title="Google" />
    <url tags="search bookmarks_toolbar_folder" 
	  url="http://www.iub.edu/compute/" 
	  title="Indiana University Bloomington Computer Services" />
	...
  </urls>
  <tags>
    <information count="6"/>
    <tag centrality="32259.7" name="web"/>
    <tag centrality="23543.1" name="internet"/>
	...
  </tags>  
  <pairs>
    <information count="20"/>
    <pair tag="google" url="http://www.google.com//>
    <pair tag="web" url="http://www.google.com//>
	...
  </pairs>
</bipartite>

Errors

1INVALID_PARAMETERSYour request is missing a required parameter
2INVALID_API_KEYYou must be granted a valid key by Givealink
3INVALID_METHODNo method with that name in this package

Url.setDescription

Associate a description to a given url

Params

descrequiredDescription in question
urlrequiredUrl in question
userrequiredUser in question
api_keyrequiredA Givealink API key

Authentication

This service requires authentication. Please see our Authentication How-To for details.

Sample Response

<givealink status="ok">
</givealink>

Errors

1INVALID_PARAMETERSYour request is missing a required parameter
2INVALID_API_KEYYou must be granted a valid key by Givealink
3INVALID_METHODNo method with that name in this package
7UNAUTHORIZEDInvalid OAuth Request
9UNKNOWN_URLUnknown url in question

Url.setInfo

Associate a title and a description to a given url

Params

titlerequiredTitle in question
descrequiredDescription in question
urlrequiredUrl in question
userrequiredUser in question
api_keyrequiredA Givealink API key

Authentication

This service requires authentication. Please see our Authentication How-To for details.

Sample Response

<givealink status="ok">
</givealink>

Errors

1INVALID_PARAMETERSYour request is missing a required parameter
2INVALID_API_KEYYou must be granted a valid key by Givealink
3INVALID_METHODNo method with that name in this package
7UNAUTHORIZEDInvalid OAuth Request
9UNKNOWN_URLUnknown url in question

Url.setTitle

Associate a title to a given url

Params

titlerequiredTitle in question
urlrequiredUrl in question
userrequiredUser in question
api_keyrequiredA Givealink API key

Authentication

This service requires authentication. Please see our Authentication How-To for details.

Sample Response

<givealink status="ok">
</givealink>

Errors

1INVALID_PARAMETERSYour request is missing a required parameter
2INVALID_API_KEYYou must be granted a valid key by Givealink
3INVALID_METHODNo method with that name in this package
7UNAUTHORIZEDInvalid OAuth Request
9UNKNOWN_URLUnknown url in question

Url.similarity

Returns similarities of each pair of urls in a list of urls.

Params

urlrequiredUrls are space-sperated
api_keyrequiredA Givealink API key

Authentication

This service does not require authentication.

Sample Response

<givealink status="ok">
  <urlsims url="http://www.iub.edu/" >
    <edge source="http://www.iub.edu/" target="http://www.idsnews.com/" sim=1.877 />
    <edge source="http://www.google.com/" target="http://www.yahoo.com/" sim=4.918 />

    ...
  </urlsims>
</givealink>

Errors

1INVALID_PARAMETERSYour request is missing a required parameter
2INVALID_API_KEYYou must be granted a valid key by Givealink
3INVALID_METHODNo method with that name in this package
9UNKNOWN_URLUnknown url in question

Url.targetSimilarity

Returns similarities of a list of urls and a target url.

Params

targetrequiredTarget url with which similarity will be calculated
urlrequiredUrls are space-sperated
api_keyrequiredA Givealink API key

Authentication

This service does not require authentication.

Sample Response

<givealink status="ok">
  <urltargetsims >
    <edge source="http://www.idsnews.com/" target="http://www.iub.edu/" sim=2.877 />
    <edge source="http://www.yahoo.com/" target="http://www.iub.edu/" sim=1.918 />

    ...
  </urltargetsims>
</givealink>

Errors

1INVALID_PARAMETERSYour request is missing a required parameter
2INVALID_API_KEYYou must be granted a valid key by Givealink
3INVALID_METHODNo method with that name in this package
9UNKNOWN_URLUnknown url in question

Annotation.add

Add a new annotation

Params

userrequiredUser in question
urlrequiredUrl in question
tagrequiredTag in question
titleoptionalTitle of the annotation
descoptionalDescription of the annotation
api_keyrequiredA Givealink API key

Authentication

This service requires authentication. Please see our Authentication How-To for details.

Sample Response

<givealink status="ok">
</givealink>

Errors

1INVALID_PARAMETERSYour request is missing a required parameter
2INVALID_API_KEYYou must be granted a valid key by Givealink
3INVALID_METHODNo method with that name in this package
5INVALID_URLInvalid url
6INVALID_TAGInvalid tag specified: it is either empty or only contains disallowed characters
7UNAUTHORIZEDInvalid OAuth Request
8UNKNOWN_USERUnknown user in question
9UNKNOWN_URLUnknown url in question
10UNKNOWN_TAGUnknown tag in question

Annotation.delete

Delete an annotation

Params

userrequiredUser in question
urlrequiredUrl in question
tagrequiredTag in question
api_keyrequiredA Givealink API key

Authentication

This service requires authentication. Please see our Authentication How-To for details.

Sample Response

<givealink status="ok">
</givealink>

Errors

1INVALID_PARAMETERSYour request is missing a required parameter
2INVALID_API_KEYYou must be granted a valid key by Givealink
3INVALID_METHODNo method with that name in this package
7UNAUTHORIZEDInvalid OAuth Request
8UNKNOWN_USERUnknown user in question
9UNKNOWN_URLUnknown url in question
10UNKNOWN_TAGUnknown tag in question
11UNKNOWN_ANNOTATION11

Post.add

Add a post (i.e., a user, a url and a set of associated tags). This method overrides previous annotations associated to the url in question

Params

userrequiredUser in question
urlrequiredUrl in question
tagrequiredA space separated list of tags
titleoptionalTitle of the annotation
descoptionalDescription of the annotation
api_keyrequiredA Givealink API key

Authentication

This service requires authentication. Please see our Authentication How-To for details.

Sample Response

<givealink status="ok">
</givealink>

Errors

1INVALID_PARAMETERSYour request is missing a required parameter
2INVALID_API_KEYYou must be granted a valid key by Givealink
3INVALID_METHODNo method with that name in this package
5INVALID_URLInvalid url
6INVALID_TAGInvalid tag specified: it is either empty or only contains disallowed characters
7UNAUTHORIZEDInvalid OAuth Request
8UNKNOWN_USERUnknown user in question
9UNKNOWN_URLUnknown url in question
10UNKNOWN_TAGUnknown tag in question

Post.delete

Delete a post (i.e., a url and all associated annotations)

Params

userrequiredUser in question
urlrequiredUrl in question
api_keyrequiredA Givealink API key

Authentication

This service requires authentication. Please see our Authentication How-To for details.

Sample Response

<givealink status="ok">
</givealink>

Errors

1INVALID_PARAMETERSYour request is missing a required parameter
2INVALID_API_KEYYou must be granted a valid key by Givealink
3INVALID_METHODNo method with that name in this package
5INVALID_URLInvalid url
7UNAUTHORIZEDInvalid OAuth Request
8UNKNOWN_USERUnknown user in question
9UNKNOWN_URLUnknown url in question

Post.merge

Add a post (i.e., a user, a url and a set of associated tags). This method does not overrides previous annotations associated to the url in question

Params

userrequiredUser in question
urlrequiredUrl in question
tagrequiredA space separated list of tags
titleoptionalTitle of the annotation
descoptionalDescription of the annotation
api_keyrequiredA Givealink API key

Authentication

This service requires authentication. Please see our Authentication How-To for details.

Sample Response

<givealink status="ok">
</givealink>

Errors

1INVALID_PARAMETERSYour request is missing a required parameter
2INVALID_API_KEYYou must be granted a valid key by Givealink
3INVALID_METHODNo method with that name in this package
5INVALID_URLInvalid url
6INVALID_TAGInvalid tag specified: it is either empty or only contains disallowed characters
7UNAUTHORIZEDInvalid OAuth Request
8UNKNOWN_USERUnknown user in question
9UNKNOWN_URLUnknown url in question
10UNKNOWN_TAGUnknown tag in question