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
| Zip::ZipFile.open(zipfile) do |zip| | |
| zip.each do |f| | |
| path = File.join('/your/aws/path', f.name) | |
| aws = AWS::S3.new.buckets['yourbucket'][path] | |
| aws.write(file: zip.get_output_stream(f)) | |
| aws_url = aws.public_url(secure: true).to_s | |
| end | |
| end | |
| end |
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' | |
| # Authentication | |
| DeskApi.configure do |config| | |
| config.username = '[email protected]' | |
| config.password = '1234secret' | |
| config.endpoint = 'https://example.desk.com' | |
| end | |
| # Create the case |
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
| { | |
| "_links": { | |
| "company": { | |
| "href": "/api/v2/companies/1", | |
| "class": "company" | |
| } | |
| } | |
| } |
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
| 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 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::Default::CONNECTION_OPTIONS[:request] = { | |
| open_timeout: 45, | |
| timeout: 45 | |
| } | |
| client = DeskApi::Client.new({ | |
| token: 'TOKEN', | |
| token_secret: 'TOKEN_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
| require 'desk_api' | |
| require 'csv' | |
| DeskApi.configure do |config| | |
| config.username = '[email protected]' | |
| config.password = 'Top$ecret1' | |
| config.endpoint = 'https://example.desk.com' | |
| end | |
| CSV.foreach('./customers.csv', headers: true) do |csv| |
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
| <apex:page standardStylesheets="false" showHeader="false" sidebar="false" recordSetVar="macros" docType="html-5.0" | |
| standardController="Macro__c" extensions="ApplyMacroControllerExtension" title="Select Macro" > | |
| <apex:includeScript value=""/> | |
| <apex:includeScript value="/support/console/30.0/integration.js"/> | |
| <apex:includeScript value="/soap/ajax/30.0/connection.js"/> | |
| <apex:includeScript value="/support/api/30.0/interaction.js"/> | |
| <apex:includeScript value="/canvas/sdk/js/30.0/publisher.js"/> | |
| <apex:stylesheet value="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" /> |
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
| 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 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
| <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">', |
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 DeskTriggerHelper | |
| { | |
| private static DeskClient CLIENT = new DeskClient(new Map<String, String>{ | |
| 'token' => 'TOKEN', | |
| 'tokenSecret' => 'TOKEN_SECRET', | |
| 'consumerKey' => 'CONSUMER_KEY', | |
| 'consumerSecret' => 'CONSUMER_SECRET', | |
| 'endpoint' => 'https://example.desk.com' | |
| }); | |