cre-o / mailru-api-node

Mail.ru API client for Node.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mail.ru REST API client for node

This npm module allows you to simplify making API requests into mail.ru REST API.

Example usage

mailru = require('mailru-api')

# Basic configuration params
requestOptions =
  applicationSecretKey: 'secretKey'
  applicationId: 'appId'

mailru.setOptions(requestOptions)
# You can specify accessToken in requestOptions or separately
# For example: if you have many users and you whant to iterate through them
mailru.setAccessToken('accessToken')

# All data passed in Object
mailru.get { method: 'users.getInfo' }, (err, data) ->
  # Some actions with data

# You can also specify types of requests
mailru.post, mailru.get

Refresh user token method

ok.refresh '{refresh_token}', (err, data) ->
  data.access_token # new token

Enjoy!

TODO

  • What do you need? Let me know or fork.

About

Mail.ru API client for Node.


Languages

Language:CoffeeScript 99.0%Language:JavaScript 1.0%