Created
August 30, 2016 13:33
-
-
Save aeden/0256758707467ad2d5e598b731ce08fd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'dnsimple' | |
# Construct a client instance. | |
# | |
# If you want to connect to production, omit the `base_url` option. | |
# | |
# Note that in this case a bogus access token is being sent to show what happens when authentication | |
# fails. | |
client = Dnsimple::Client.new(base_url: "https://api.sandbox.dnsimple.com", access_token: "fake") | |
# All calls to client pass through a service. In this case, `client.identity` is the identity service. | |
# | |
# Dnsimple::Client::Identity#whoami is the method for retrieving the account details for your | |
# current credentials via the DNSimple API. | |
# | |
# In this case the call will fail and raise an exception. | |
client.identity.whoami |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment