zen_freshdesk 0.0.1 → 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/zen_freshdesk/version.rb +1 -1
- data/lib/zen_freshdesk.rb +32 -46
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 92afde6988d878206ec64481062db30049e59884
|
4
|
+
data.tar.gz: 2be16a604d7197e8bc37d197d05691ad89f20965
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e4f03a04539ba472c8f0df6667d491064e63741a0853076ea7982e911f1de158f7f6326977db759af71d28cfb95b954b5fa647cfbbbc33288228eef298d5043
|
7
|
+
data.tar.gz: 9b827a7b6b57738cc70c1ed48ed21d1d7399ae71a19b5903b94fa312aaa80dad4670ef85981cedc1c135da40943935d6bb58d8fa28b065300e3c7319a9b2ffd3
|
data/lib/zen_freshdesk.rb
CHANGED
@@ -18,53 +18,39 @@ module ZenFreshdesk
|
|
18
18
|
:subject, :description, :header, :email
|
19
19
|
end
|
20
20
|
|
21
|
-
def self.create_ticket(
|
22
|
-
header = {:content_type => "application/json", :Authorization => "Basic #{Base64.encode64(api_key)}"}
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
puts res
|
21
|
+
def self.create_ticket()
|
22
|
+
header = {:content_type => "application/json", :Authorization => "Basic #{Base64.encode64(ZenFreshdesk.configuration.api_key)}"}
|
23
|
+
|
24
|
+
body = {
|
25
|
+
"helpdesk_ticket" => {
|
26
|
+
"description" => ZenFreshdesk.configuration.description,
|
27
|
+
"subject" => ZenFreshdesk.configuration.subject,
|
28
|
+
"email" => ZenFreshdesk.configuration.email,
|
29
|
+
"priority" => 1,
|
30
|
+
"status" => 2,
|
31
|
+
"ticket_type" => "Question"
|
32
|
+
},
|
33
|
+
"requester_id" => ZenFreshdesk.configuration.requester_id,
|
34
|
+
"responder_id" => ZenFreshdesk.configuration.responder_id
|
35
|
+
}.to_json()
|
36
|
+
|
37
|
+
res = RestClient.post(ZenFreshdesk.configuration.uri_api, body, header )
|
38
|
+
puts res.code
|
39
|
+
puts res
|
40
|
+
end
|
42
41
|
end
|
43
42
|
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
@body = {
|
56
|
-
"helpdesk_ticket" => {
|
57
|
-
"description" => DESCRIPTION,
|
58
|
-
"subject" => SUBJECT,
|
59
|
-
"email" => EMAIL,
|
60
|
-
"priority" => 1,
|
61
|
-
"status" => 2,
|
62
|
-
"ticket_type" => "Question"
|
63
|
-
},
|
64
|
-
"requester_id" => REQUESTER_ID,
|
65
|
-
"responder_id" => RESPONDER_ID
|
66
|
-
}.to_json()
|
43
|
+
# ZenFreshdesk.configure do |config|
|
44
|
+
# config.api_key = "UPf8ktY8VePpIOQPsNsq"
|
45
|
+
# config.uri_api = "http://chinh.freshdesk.com/helpdesk/tickets.json?tags=test"
|
46
|
+
# config.projects = ""
|
47
|
+
# config.requester_id = "1"
|
48
|
+
# config.submitter_id = ""
|
49
|
+
# config.responder_id = "3"
|
50
|
+
# config.subject = "chinh Support needed.."
|
51
|
+
# config.description = "chinh Some details on the issue ..."
|
52
|
+
# config.email = "tom@outerspace.com"
|
53
|
+
# end
|
67
54
|
|
55
|
+
ZenFreshdesk.create_ticket()
|
68
56
|
|
69
|
-
# create_ticket(URI_API,API_KEY,PROJECT,@body,SUBMITTER)
|
70
|
-
end
|