Skip to content

Instantly share code, notes, and snippets.

@tstachl
Created November 15, 2014 23:21
Show Gist options
  • Save tstachl/38513076b76d64349d93 to your computer and use it in GitHub Desktop.
Save tstachl/38513076b76d64349d93 to your computer and use it in GitHub Desktop.
# configure the client
client = DeskApi::Client.new username: '[email protected]', password: '$uper$ecretP@ssword', endpoint: 'https://example.desk.com'
# create the customer using a plain request
resp = client.post('/api/v2/customers', {
first_name: 'John',
last_name: 'Doe',
emails: [{ type: 'home', value: '[email protected]' }]
})
# creating customer using advanced resource
customer = client.customers.create({
first_name: 'John',
last_name: 'Doe',
emails: [{ type: 'home', value: '[email protected]' }]
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment