Skip to content

Instantly share code, notes, and snippets.

@tstachl
Created April 4, 2014 00:12
Show Gist options
  • Save tstachl/9965457 to your computer and use it in GitHub Desktop.
Save tstachl/9965457 to your computer and use it in GitHub Desktop.
RAuth example with desk.com
from rauth import OAuth1Session
import pprint
try:
read_input = raw_input
except NameError:
read_input = input
session = OAuth1Session('YOUR_CONSUMER_KEY',
'YOUR_CONSUMER_SECRET',
access_token='YOUR_ACCESS_TOKEN',
access_token_secret='YOUR_ACCESS_TOKEN_SECRET')
tickets = session.get('https://YOURSUBDOMAIN.desk.com/api/v2/cases', verify=True)
for i, ticket in enumerate(tickets.json()['_embedded']['entries'], 1):
subject = ticket['subject']
blurb = ticket['blurb']
print(u'{0}. {1} - {2}'.format(i, subject, blurb))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment