This file contains 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
ticket = DeskApi.cases.create({ | |
external_id: 123456, | |
subject: 'Subject', | |
description: 'Description', | |
priority: 1, | |
status: 'resolved', | |
type: 'email', | |
labels: ['Label 1', 'Label 2'], | |
custom_fields: { | |
my_key: 'My Value' |
This file contains 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
require 'desk_api' | |
require 'csv' | |
DeskApi.configure do |config| | |
config.username = 'you@example.com' | |
config.password = 'Top$ecret1' | |
config.endpoint = 'https://example.desk.com' | |
end | |
CSV.foreach('./customers.csv', headers: true) do |csv| |
This file contains 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
require 'desk_api' | |
DeskApi::Default::CONNECTION_OPTIONS[:request] = { | |
open_timeout: 45, | |
timeout: 45 | |
} | |
client = DeskApi::Client.new({ | |
token: 'TOKEN', | |
token_secret: 'TOKEN_SECRET', |
This file contains 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
new DESK.Widget({ | |
id: 'test', // The ID of the element to place the button into | |
version: 1, | |
site: 'hecos.desk.com', | |
port: '80', | |
type: 'chat', | |
displayMode: 0, //0 for popup, 1 for lightbox | |
features: { | |
offerAlways: false, | |
offerAgentsOnline: true, |
This file contains 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
{ | |
"_links": { | |
"company": { | |
"href": "/api/v2/companies/1", | |
"class": "company" | |
} | |
} | |
} |
This file contains 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
require 'desk_api' | |
# Authentication | |
DeskApi.configure do |config| | |
config.username = 'jsmith@example.com' | |
config.password = '1234secret' | |
config.endpoint = 'https://example.desk.com' | |
end | |
# Create the case |
This file contains 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
BASE_URL: https://desk-oauth-express.herokuapp.com | |
CONSUMER_KEY: MY_CONSUMER_KEY | |
CONSUMER_SECRET: MY_CONSUMER_SECRET | |
SESSION_SECRET: MY_SESSION_SECRET |
This file contains 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
<?php | |
$json = json_encode(array( | |
"subject" => "Test", | |
"description" => "testing", | |
"message" => array( | |
"subject" => "Test", | |
"body" => "Test", | |
"direction" => "in", | |
"to" => "support@example.com", |
This file contains 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/perl | |
use strict; | |
use warnings; | |
use feature qw(say); | |
use JSON; | |
use WWW::Curl::Easy; | |
my $DeskSite = 'https://example.desk.com'; |
This file contains 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
<?php | |
$json = json_encode(array( | |
'_links' => array( | |
'assigned_user' => array( | |
'href' => '/api/v2/users/16096734', | |
'class' => 'user' | |
) | |
) | |
)); |