Ok.ru API with node
This npm module allows you to simplify making API requests into odnoklassniki REST API.
Example usage
ok = require"ok.ru" # Basic configuration params requestOptions = applicationSecretKey: '{secretKey}' applicationKey: '{applicationKey}' applicationId: '{applicationId}' oksetOptionsrequestOptions# You can specify accessToken in requestOptions or separately # For example: if you have many users and you whant to iterate through them oksetAccessToken'{access_token}' # All data passed in Object okpost method: 'group.getUserGroupsV2' # Some actions with data # You can also specify types of requests okpostokget # Or pass in, as argument 'get' method: 'users.isAppUser' # some actions with data # It properly handle errors oksetAccessToken'invalid_token' # Invalid token 'get' method: 'users.isAppUser' # some actions with data alert "Alarm! Error! " if err? # It can transport all response and headers consolelog response
Refresh user token method
okrefresh '{refresh_token}' dataaccess_token # new token
Test it!
Add your params at test/settings.yml and you are ready to go!
$ mocha
Enjoy!
TODO
- What do you need? Let me know or fork.