Skip to content

Instantly share code, notes, and snippets.

@dlitvakb
Created August 10, 2012 18:47
Show Gist options
  • Save dlitvakb/3316676 to your computer and use it in GitHub Desktop.
Save dlitvakb/3316676 to your computer and use it in GitHub Desktop.

New NetDNA REST API Clients

On a previous post we've talked abut our new REST API and the benefits it provides to our power users. If that was not enough for your satisfaction, we are releasing REST Clients for Python and Ruby to help you use our service without having worry about anything.

Forget about OAuth problems

Having Invalid Signature problems? Your OAuth Library doesn't comply the OAuth standards? Don't worry, we've already faced all this problems and we have the solution for them. Our client respects the full standard and you won't have to deal with OAuth problems AT ALL.

How to install

The installation is a simple and quick process, as our libraries are published at Python Package Index and Rubygems.

  • Python: $ sudo pip install netdnarws
  • Ruby: $ gem install netdnarws

Usage

Using our client is really simple and straight forward. The following example is for getting the Pullzonees our account has.

  • Python:
from netdnarws import NetDNA

api = NetDNA("my_username", "my_key", "my_secret")

api.get("/zones/pull.json")

# ... outputs ...

# {u'code': 200,
#  u'data': {u'current_page_size': 3,
#   u'page': 1,
#   u'page_size': u'50',
#   u'pages': 1,
#   u'pullzones': [ ... ],
#   u'total': 3}}
  • Ruby:
require 'netdnarws'

api = NetDNARWS::NetDNA.new("my_username", "my_key", "my_secret")

api.get("/zones/pull.json")

# ... outputs ...

# {"code"=>200,
#  "data"=>
#   {"page"=>1,
#    "pages"=>1,
#    "page_size"=>"50",
#    "current_page_size"=>3,
#    "total"=>3,
#    "pullzones"=> [ ... ]}
# }

Find out more and contribute

This software is Open Source and published in our Public GitHub Repository. If you wish to contribute, feel free to report us any issues or send us pull requests.

@jdorfman
Copy link

looking good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment