All Projects → ovh → Node Ovh

ovh / Node Ovh

Licence: other
Node.js wrapper for the OVH APIs

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Node Ovh

Myq Api
An updated API to interface with myQ devices
Stars: ✭ 71 (-32.38%)
Mutual labels:  api-wrapper
Roam Research Private Api
Private API to enable API access for Roam Research. Now you can connect Roam to your other projects.
Stars: ✭ 88 (-16.19%)
Mutual labels:  api-wrapper
Pymba
Python wrapper for Allied Vision's Vimba C API
Stars: ✭ 98 (-6.67%)
Mutual labels:  api-wrapper
Newsapi
A python wrapper for News API.
Stars: ✭ 71 (-32.38%)
Mutual labels:  api-wrapper
Cryptocompy
Simple Python 3 wrapper for the public CryptoCompare API.
Stars: ✭ 81 (-22.86%)
Mutual labels:  api-wrapper
Gistr
Interact with GitHub gists from R
Stars: ✭ 90 (-14.29%)
Mutual labels:  api-wrapper
Avenue
Wrapper around URLSession and URLSessionTask to enable seamless integration with Operation / OperationQueue.
Stars: ✭ 58 (-44.76%)
Mutual labels:  api-wrapper
Binancedotnet
Official C# Wrapper for the Binance exchange API, with REST and WebSocket endpoints
Stars: ✭ 102 (-2.86%)
Mutual labels:  api-wrapper
Go Binance
Golang wrapper for Binance API
Stars: ✭ 85 (-19.05%)
Mutual labels:  api-wrapper
Bluelinky
An unofficial nodejs API wrapper for Hyundai bluelink
Stars: ✭ 94 (-10.48%)
Mutual labels:  api-wrapper
Psmsgraph
A PowerShell module for the Microsoft Graph API
Stars: ✭ 71 (-32.38%)
Mutual labels:  api-wrapper
Iexcloud api wrapper
iexcloud api wrapper written in typescript (asynchronous interface)
Stars: ✭ 80 (-23.81%)
Mutual labels:  api-wrapper
Ckanr
R client for the CKAN API
Stars: ✭ 91 (-13.33%)
Mutual labels:  api-wrapper
Poloniex
Poloniex python API client for humans
Stars: ✭ 71 (-32.38%)
Mutual labels:  api-wrapper
Instagram api gem
A Ruby wrapper for the Instagram API
Stars: ✭ 100 (-4.76%)
Mutual labels:  api-wrapper
Corenavigation
📱📲 Navigate between view controllers with ease. 💫 🔜 More stable version (written in Swift 5) coming soon.
Stars: ✭ 69 (-34.29%)
Mutual labels:  api-wrapper
Mediawiki
MediaWiki API wrapper in python http://pymediawiki.readthedocs.io/en/latest/
Stars: ✭ 89 (-15.24%)
Mutual labels:  api-wrapper
Astorage
A tiny API wrapper for localStorage
Stars: ✭ 103 (-1.9%)
Mutual labels:  api-wrapper
Rorcid
A programmatic interface the Orcid.org API
Stars: ✭ 101 (-3.81%)
Mutual labels:  api-wrapper
Discord.jl
The Julia Discord API Wrapper
Stars: ✭ 93 (-11.43%)
Mutual labels:  api-wrapper

Node.js Wrapper for OVH APIs

The easiest way to use the OVH.com APIs in your node.js applications.

NPM Version Build Status Coverage Status

// Create your first application tokens here: https://api.ovh.com/createToken/?GET=/me
var ovh = require('ovh')({
  appKey: process.env.APP_KEY,
  appSecret: process.env.APP_SECRET,
  consumerKey: process.env.CONSUMER_KEY
});

ovh.request('GET', '/me', function (err, me) {
  console.log(err || 'Welcome ' + me.firstname);
});

You can also use the promised version like this:

ovh.requestPromised('GET', '/me')
  .then(function (response) {
    //Do what you want
  })
  .catch(function (err) {
    //Return an error object like this {error: statusCode, message: message}
  });

Installation

The easiest way to get the latest stable release is to grab it from the npm registry.

$ npm install ovh

Alternatively, you may get latest development version directly from Git.

$ npm install git://github.com/ovh/node-ovh.git

Example Usage

Login as a user

1. Create an application

Depending the API you plan to use, you need to create an application on the below websites:

Once created, you will obtain an application key (AK) and an application secret (AS).

2. Authorize your application to access to a customer account

To allow your application to access to a customer account using an OVH API, you need a consumer key (CK).

Here is a sample code you can use to allow your application to access to a complete account.

Depending the API you want to use, you need to specify the below API endpoint:

  • OVH Europe: ovh-eu (default)
  • OVH US: ovh-us
  • OVH North-America: ovh-ca
  • SoYouStart Europe: soyoustart-eu
  • SoYouStart North-America: soyoustart-ca
  • Kimsufi Europe: kimsufi-eu
  • Kimsufi North-America: kimsufi-ca
var ovh = require('ovh')({
  endpoint: 'ovh-eu',
  appKey: 'YOUR_APP_KEY',
  appSecret: 'YOUR_APP_SECRET'
});

ovh.request('POST', '/auth/credential', {
  'accessRules': [
    { 'method': 'GET', 'path': '/*'},
    { 'method': 'POST', 'path': '/*'},
    { 'method': 'PUT', 'path': '/*'},
    { 'method': 'DELETE', 'path': '/*'}
  ]
}, function (error, credential) {
  console.log(error || credential);
});
$ node credentials.js
{ validationUrl: 'https://api.ovh.com/auth/?credentialToken=XXX',
  consumerKey: 'CK',
  state: 'pendingValidation' }

This consumer key can be scoped with a specific authorization. For example if your application will only send SMS:

ovh.request('POST', '/auth/credential', {
  'accessRules': [
    { 'method': 'POST', 'path': '/sms/*/jobs'},
  ]
}, function (error, credential) {
  console.log(error || credential);
});

Once the consumer key will be authorized on the specified URL, you'll be able to play with the API calls allowed by this key.

3. Let's play!

You are now be able to play with the API. Look at the examples available online.

You can browse the API schemas using the web consoles of the APIs:

Migration from 1.x.x to 2.x.x without Proxy support

For example if you use the OVH Europe API, you'll have to check on https://eu.api.ovh.com/console/ the endpoints available for your feature.

In order to have the informations about the bill with id "0123".

  • Before in 1.x.x with Proxy:
ovh.me.bill["0123"].$get(function (err, billInformation) {

});
  • Now in 2.x.x with promise:
ovh.requestPromised('GET', '/me/bill/0123') //This route has been found at https://eu.api.ovh.com/console/
  .then(function (billInformation) {

  })
  .catch(function (err) {

  });

Full documentation and examples

The full documentation is available online: https://ovh.github.io/node-ovh.

Hacking

Get the sources

git clone https://github.com/ovh/node-ovh.git
cd node-ovh

You've developed a new cool feature? Fixed an annoying bug? We'd be happy to hear from you!

Run the tests

Tests are based on mocha. This package includes unit and integration tests.

git clone https://github.com/ovh/node-ovh.git
cd node-ovh
npm install -d
npm test

Integration tests use the OVH /domain/zone API, the tokens can be created here.

export APP_KEY=xxxxx
export APP_SECRET=yyyyy
export CONSUMER_KEY=zzzzz
export DOMAIN_ZONE_NAME=example.com
npm run-script test-integration

Documentation

The documentation is based on Github Pages and is available in the gh-pages branch.

Supported APIs

OVH Europe

OVH US

OVH North America

SoYouStart Europe

SoYouStart North America

Kimsufi Europe

Kimsufi North America

Related links

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].