Skip to content

Latest commit

 

History

History
111 lines (62 loc) · 5 KB

8.- Api Documentation.md

File metadata and controls

111 lines (62 loc) · 5 KB

Api Documentation

Welcome

Consult an Entity

Get all the connections of an Entity

Perform a search for Entities

Examples

##Welcome

Welcome to the Development Version of the API (Application Programming Interface) of Poderopedia. We have decided to release it for those interested in it. Anyone can try it and we would appreciate your feedback.

The first alpha version of the Poderopedia API allows:

  • Generate views of the entities in the Poderopedia database and its connections using the D3.js library.
  • Search the database for basic information of the entities in Poderopedia.

To use the Poderopedia API you must get an API Key from Poderopedia that will be required at each visit you make.

To get an API Key from Poderopedia, first you must go to our registration site. Upon entering you will be asked to log on to the page. If you're not registered, you'll be asked to register, initiating the validation process through your email. When the validation is complete, you can enter the system and get your API Key selecting “Give me my API Keys now”.

The Poderopedia API is subject to our Use Terms and Conditions. Read them for more information.

If you're interested in taking part in the development and improvement of our API, give us your feedback or link us to projetcs that use the Poderopedia API. Please write to Juan Eduardo at [email protected]

##Consult an Entity

To query an entity in the system, you should have a GET type request to the URL http://api.poderopedia.org/visualizacion/getEntityById. Along with this request, the parameters entity (identifying the entity type, “person” or “organization” for example), ID (identifying the the ID of the requested entity, “906” for example) and user_key (the Poderopedia KEY) have to be sent. By doing so, you'll receive a JSON object like the one shown in the following example:

JSON Object Structure

As seen in the example above, the JSON object delivered by this call is composed of a list called “person” (in case of a person” and “organization” (in case of an organization), which has the following fields:

Object Fields

  • shortBio: Contains a short review about the entity found.

  • ID: It's the identifier number of the found entity.

  • Alias: Corresponds to a short name, abbreviation or nickname commonly used to designate the

##Get all the connections of an Entity

To obtain information about all the connections that a person has in the system, you have to make a GET type request to http://api.poderopedia.org/visualizacion/connection. Along with this, a request parameter ID should be sent, which is the ID number of the entity. Also the Entity itself (person or organization) and user_key, which corresponds to the API Key obtained in the previous step. By doing so, you'll receive a JSON object like the one shown in the following example:

We consult the URL: http://api.poderopedia.org/visualizacion/connection via GET, sending the following parameters: entity = organization, id = 906 and our user_key. We get the following result:

##Perform a search for Entities

To search for an entity in the system, you have to make a GET type request to the URL http://api.poderopedia.org/visualizaciones/search. Along with this request, you should send the entity parameters, identifying the type of entity (“person” or “organization”), alias (“Sebastian Piñera” for example) and the user_key, which indicates the API Key for Poderopedia. By doing this, if a result is found, it will deliver a JSON object as the following example:

JSON Object Structure

As seen in the example above, the JSON object delivered by this call is composed of a list called “person” (in case of a person” and “organization” (in case of an organization), which has the following fields:

Object Fields

  • shortBio: Contains a short review about the entity found.

  • ID: It's the identifier number of the found entity.

  • Alias: Corresponds to a short name, abbreviation or nickname commonly used to designate the found entity.

##Examples

Get Connections from a Person

URL: http://api.poderopedia.org/visualizacion/connection
Method: GET
Parameters:
id = 25 
entity = persona 
user_key = dummy_user_key1234 
Result:

Get Connections from a Organization

URL: http://api.poderopedia.org/visualizacion/connection
Method: GET
Parameters:
id = 25 
entity = organization 
user_key = dummy_user_key1234 
Result:

In the case of seeking connections in a organization or company rather than a person, then the parameter entity must be organization

Search for an Entity

URL: http://api.poderopedia.org/visualizacion/search
Method: GET
Parameters:
user_key: dummy_key1234 
entity: persona 
alias: Sebastian Piñera 
Result: