Official Visupedia API library client for node.js
This library is generated by alpaca
Make sure you have npm installed.
$ npm install visupedia
Works with [ 0.8 / 0.9 / 0.10 / 0.11 ]
var visupedia = require('visupedia');
// Then we instantiate a client (as shown below)
var client = visupedia.client();
// If you need to send options
var client = visupedia.client({}, clientOptions);
The following options are available while instantiating a client:
- base: Base url for the api
- api_version: Default version of the api (to be used in url)
- user_agent: Default user-agent for all requests
- headers: Default headers for all requests
- request_type: Default format of the request body
All the callbacks provided to an api call will recieve the response as shown below
// You can also omit the 'methodOptions' param below
client.klass('args').method('args', methodOptions, function (err, response) {
if (err) console.log(err);
response.code;
// >>> 200
response.headers;
// >>> {'x-server': 'apache'}
}
The following options are available while calling a method of an api:
- api_version: Version of the api (to be used in url)
- headers: Headers for the request
- query: Query parameters for the url
- body: Body of the request
- request_type: Format of the request body
Set request_type in options to modify the body accordingly
When the value is set to raw, don't modify the body at all.
body = 'username=pksunkara';
// >>> 'username=pksunkara'
Returns an MyVisu api instance
The following arguments are required:
- key: The api key provided by Visupedia
var visu = client.visu("53214f86e2ae54.93050075");
Returns all information about the wanted Visu
The following arguments are required:
- id: The unique ID of the Visu
- lang: The language code wanted for the Visu
- version: Use a specific version of our API
visu.get("18074f27cb5336.93484109", "fr", "2", options, callback);
Here is a list of Contributors
MIT
Report here.
Gaël Gillard (dev@visupedia.net)