Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update README.md

  • Loading branch information...
commit 5a64da6d0c6daab399b4450b24c42340acc909e6 1 parent f8c6d8b
@falquaddoomi falquaddoomi authored
Showing with 2 additions and 5 deletions.
  1. +2 −5 README.md
View
7 README.md
@@ -20,9 +20,6 @@ api.login(<username>, <password>)
# now the api handle contains both a short-use token and a hashed
# password which can be used indefinitely. if either become invalid,
# the api will throw an OhmageApiException containing a code 0200.
-
-# if you'd like to examine or store the credentials, they're available
-# via api.auth_username, api.auth_hashedpass, and api.auth_token.
~~~
## Performing a simple request and checking for errors
@@ -35,8 +32,8 @@ try:
result = api.campaign_read(output_format="short")
except OhmageApi.OhmageApiException as ex:
# let's do something special if there was an auth error (e.g. code 0200)
- if '0200' in ex.codes():
- print "Your login credentials are bad. Please log in again."
+ if 200 in ex.codes():
+ print "Your login credentials are invalid, exiting."
exit(-1)
# otherwise, pass it up to our caller
raise
Please sign in to comment.
Something went wrong with that request. Please try again.