View FetchingLabels.class
try { | |
DeskClient client = new DeskClient(new Map<String, String>{ | |
'username' => 'you@example.com', | |
'password' => 'your_password', | |
'subdomain' => 'your_subdomain' | |
}); | |
List<Object> labels = (List<Object>)client.getResource('cases').find(3368).get('labels'); | |
// get the count of the labels | |
System.debug(labels.size()); |
View customer_theme.html
<div class="agent_customer_section" id="my_custom_field" style="display:none;"> | |
{{custom_my_custom_field}} | |
</div> | |
<script> | |
$(function() { | |
var case_assigned_group = $('#edit_customer_{{customer.id}}') | |
.closest('#case_sidebar') | |
.find('#ticket_group_id option:selected') | |
.text(); |
View reply.json
{ | |
"direction": "in", | |
"status": "received", | |
"to": "Helpdesk <helpdesk@myhelpdesk.com>", | |
"from": "Jane Doe <jane@example.com>", | |
"subject": "Replying to a case via the API", | |
"body": "Please assist me with this case", | |
"created_at": "2012-05-02T21:38:48Z" | |
} |
View create_case.json
{ | |
"type": "email", | |
"subject": "Creating a case via the API", | |
"priority": 4, | |
"status": "open", | |
"labels": [ | |
"Spam", | |
"Ignore" | |
], | |
"language": "fr", |
View email_widget.html
<!--If you already have jquery on the page you don't need to insert this script tag--> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" type="text/javascript"></script> | |
<link href="https://d218iqt4mo6adh.cloudfront.net/assets/widget_embed_191.css" media="screen" rel="stylesheet" type="text/css" /> | |
<!--If you already have fancybox on the page this script tag should be omitted--> | |
<script src="https://d218iqt4mo6adh.cloudfront.net/assets/widget_embed_libraries_191.js" type="text/javascript"></script> | |
<script> | |
// ******************************************************************************** | |
// This needs to be placed in the document body where you want the widget to render |
View create_customer.js
client.post('/api/v2/customers', { | |
"emails": [ | |
{ | |
"type": "home", | |
"value": "jsmith@example.com" | |
} | |
], | |
"custom_fields": { | |
"user_id": null | |
} |
View create_qna_case.rb
require 'desk_api' | |
DeskApi.configure do |config| | |
config.username = 'me@support.com' | |
config.password = 'MyReallySecretPassword' | |
config.subdomain = 'syncmade' | |
end | |
DeskApi.cases.create({ | |
type: 'qna', |
View rauth_test.py
from rauth import OAuth1Session | |
import pprint | |
try: | |
read_input = raw_input | |
except NameError: | |
read_input = input | |
session = OAuth1Session('YOUR_CONSUMER_KEY', | |
'YOUR_CONSUMER_SECRET', |
View multipass.cs
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Security.Cryptography; | |
using System.IO; | |
using System.Web; | |
using System.Diagnostics; | |
using System.DirectoryServices; |
View CaseThemeAddition.html
<script> | |
$(function() { | |
var tid = $('#tabs .ui-state-active a').attr('href').replace('#tabs-tid_', '') | |
, sel = '#email_reply_div_tid_' + tid | |
setTimeout(function() { | |
$(sel).prepend([ | |
'<div>', | |
' <ul class="reply-toggle">', | |
' <li class="active">', |
OlderNewer