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
<div id="save_{{case.id}}"> | |
<div class="agent_ticket_section"> | |
{{subject}} | |
</div> | |
<div class="agent_ticket_section"> |
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
// get the first cases page | |
client.cases(function(err, cases) { | |
// define a worker function that handles the | |
// cases and starts over with the previous page | |
// make sure you have a "callback" (doSomethingElse) | |
// function defined before going into this loop | |
function workCases(err, cases) { | |
// test if cases is null (previous will return null | |
// if there is no previous page) | |
if (cases !== null) { |
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
require 'desk_api' | |
require 'csv' | |
client = DeskApi::Client.new({ | |
username: '[email protected]', # your desk.com username | |
password: 'yourpassword', # your desk.com password | |
subdomain: 'yoursubdomain' # your desk.com subdomain (https://this.desk.com) | |
}) | |
CSV.foreach('./customers.csv', headers: true) do |row| |
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
public class DeskLabelService | |
{ | |
private static String OAUTH_KEY = 'your_consumer_key'; | |
private static String OAUTH_SECRET = 'your_consumer_secret'; | |
private static String ACCESS_TOKEN = 'your_access_token'; | |
private static String ACCESS_TOKEN_SECRET = 'your_access_token_secret'; | |
public static String DESK_DOMAIN = 'yourdomain.desk.com'; | |
@future(callout=true) |
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
require 'desk_api' | |
require 'json' | |
site = { | |
username: '[email protected]', | |
password: 'yourpassword', | |
site_name: 'yoursubdomain' | |
} | |
client = DeskApi::Client.new username: site[:username], password: site[:password], subdomain: site[:site_name] |
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
<?php | |
$case = array( | |
'type' => 'email', | |
'subject' => 'Email Case Subject', | |
'priority' => 4, | |
'status' => 'open', | |
'labels' => array('Spam', 'Ignore'), | |
'message' => array( | |
'direction' => 'in', |
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
global class FetchGroupsAndUsers implements Schedulable, Database.Batchable<DeskResource>, Database.AllowsCallouts | |
{ | |
public static String CRON_EXPRESSION = '0 0 0 * * ? *'; | |
global static final DeskClient DESK_CLIENT = new DeskClient(new Map<String, String>{ | |
'username' => '[email protected]', | |
'password' => 'somepassword', | |
'subdomain' => 'devel' | |
}); | |
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
<style> | |
table#users { width: 100%; } | |
table#users th { font-weight: bold; font-size: 120%; } | |
</style> | |
<table class="table table-striped" id="users"> | |
<thead> | |
<tr> | |
<th>Name</th> | |
<th>Email</th> |
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
<?php | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, "https://yoursite.desk.com/api/v2/customers/search?email=thomas%40stachl.me"); | |
curl_setopt($ch, CURLOPT_PORT, 443); | |
curl_setopt($ch, CURLOPT_TIMEOUT, 15); | |
curl_setopt($ch, CURLOPT_USERAGENT, $_SERVER['HTTP_USER_AGENT']); | |
curl_setopt($ch, CURLOPT_USERPWD, "email:password"); | |
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); |
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
source 'https://rubygems.org' | |
ruby '2.0.0' | |
gem 'desk_api', '0.5.0' | |
gem 'rubyzip', '1.1.0' | |
gem 'open_uri_redirections', '0.1.4' |