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
curl -L https://example.desk.com/api/v2/cases/3061/attachments/82558857/url -u [email protected]:password > my_image.jpg |
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' | |
# Create the CSV files | |
cases = CSV.open('./cases.csv', 'wb') | |
interactions = CSV.open('./interactions.csv', 'wb') | |
# Add the headers to the CSV files | |
cases << ['Case #', 'Subject', 'Description', 'Status'] | |
interactions << ['Case #', 'Body', 'Created Date'] |
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 | |
function post($path, $json) { | |
$ch = curl_init(); | |
curl_setopt($ch, CURLOPT_URL, "https://site.desk.com$path"); | |
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); | |
curl_setopt($ch, CURLOPT_USERPWD, "my-email:my-password"); | |
curl_setopt($ch, CURLOPT_POSTFIELDS, $json); | |
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
<?php | |
$date = new DateTime('2015-01-21T20:34:53Z'); | |
$date->setTimezone(new DateTimeZone('Pacific/Chatham')); | |
echo $date->format(DateTime::ISO8601); |
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 class='input-block'> | |
<span class='label'> | |
CUSTOM FIELD LABEL <span>({{system.snippets.required}})</span> | |
</span> | |
<div> | |
{{ ticket_custom_**CUSTOM FIELD KEY** }} | |
</div> | |
</div> |
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
{ | |
"type": "email", | |
"subject": "Email Case Subject", | |
"priority": 4, | |
"status": "open", | |
"labels": [ | |
"Spam", | |
"Ignore" | |
], | |
"message": { |
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
{% if case.group.name == 'Support' %} | |
<!-- put the case theme for support here --> | |
{% elsif case.group.name == 'Internal' %} | |
<!-- put the case theme for internal here --> | |
{% else %} | |
<!-- put the case theme for default here --> | |
{% endif %} |
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
<h2>{{email.subject}}</h2> | |
{% if email.subject contains 'Suggestion' %} | |
<h3>This is a suggestion</h3> | |
{% else %} | |
<h3>This is default</h3> | |
{% endif %} |
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
using System; | |
using System.Text; | |
using System.Net; | |
using System.Net.Http; | |
using System.Net.Http.Headers; | |
using Newtonsoft.Json.Linq; | |
namespace DeskApiExample | |
{ | |
class MainClass |
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
<!-- different web themes --> | |
<div id="company-support-portal"> | |
<div id="company-header"> | |
<div class="wrapper"> | |
{{ desk.page.theme.header_content }} | |
<div id="customer-account"> | |
{% if current_user and current_user.is_guest == false %} | |
<span> | |
{{system.snippets.welcome}} {{ current_user.customer.name }} |