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
import oauth2 as oauth | |
import time | |
import simplejson | |
import httplib2 | |
import logging | |
import pprint | |
logger = logging.getLogger("model") | |
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
try { | |
DeskClient client = new DeskClient(new Map<String, String>{ | |
'username' => '[email protected]', | |
'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()); |
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="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(); |
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": "Creating a case via the API", | |
"priority": 4, | |
"status": "open", | |
"labels": [ | |
"Spam", | |
"Ignore" | |
], | |
"language": "fr", |
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
{ | |
"direction": "in", | |
"status": "received", | |
"to": "Helpdesk <[email protected]>", | |
"from": "Jane Doe <[email protected]>", | |
"subject": "Replying to a case via the API", | |
"body": "Please assist me with this case", | |
"created_at": "2012-05-02T21:38:48Z" | |
} |
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 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 |
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
client.post('/api/v2/customers', { | |
"emails": [ | |
{ | |
"type": "home", | |
"value": "[email protected]" | |
} | |
], | |
"custom_fields": { | |
"user_id": 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' | |
DeskApi.configure do |config| | |
config.username = '[email protected]' | |
config.password = 'MyReallySecretPassword' | |
config.subdomain = 'syncmade' | |
end | |
DeskApi.cases.create({ | |
type: 'qna', |
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
from rauth import OAuth1Session | |
import pprint | |
try: | |
read_input = raw_input | |
except NameError: | |
read_input = input | |
session = OAuth1Session('YOUR_CONSUMER_KEY', | |
'YOUR_CONSUMER_SECRET', |
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.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; |