desk 0.3.3 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (193) hide show
  1. checksums.yaml +7 -0
  2. data/README.mkd +305 -106
  3. data/TRANSITION.mkd +133 -0
  4. data/desk.gemspec +1 -1
  5. data/lib/desk.rb +1 -1
  6. data/lib/desk/api.rb +5 -1
  7. data/lib/desk/client.rb +184 -10
  8. data/lib/desk/client/article.rb +4 -83
  9. data/lib/desk/client/brand.rb +11 -0
  10. data/lib/desk/client/case.rb +59 -42
  11. data/lib/desk/client/company.rb +11 -0
  12. data/lib/desk/client/custom_field.rb +10 -0
  13. data/lib/desk/client/customer.rb +26 -124
  14. data/lib/desk/client/facebook_user.rb +11 -0
  15. data/lib/desk/client/filter.rb +11 -0
  16. data/lib/desk/client/group.rb +3 -29
  17. data/lib/desk/client/insight.rb +17 -0
  18. data/lib/desk/client/integration_url.rb +11 -0
  19. data/lib/desk/client/job.rb +11 -0
  20. data/lib/desk/client/label.rb +11 -0
  21. data/lib/desk/client/macro.rb +3 -133
  22. data/lib/desk/client/mailbox.rb +26 -0
  23. data/lib/desk/client/rule.rb +14 -0
  24. data/lib/desk/client/site_setting.rb +11 -0
  25. data/lib/desk/client/system_message.rb +16 -0
  26. data/lib/desk/client/topic.rb +4 -81
  27. data/lib/desk/client/twitter_account.rb +11 -0
  28. data/lib/desk/client/twitter_user.rb +11 -0
  29. data/lib/desk/client/user.rb +3 -30
  30. data/lib/desk/configuration.rb +1 -1
  31. data/lib/desk/connection.rb +2 -1
  32. data/lib/desk/deash.rb +100 -0
  33. data/lib/desk/request.rb +33 -20
  34. data/lib/desk/version.rb +1 -1
  35. data/lib/faraday/request/oauth.rb +6 -3
  36. data/lib/faraday/response/deashify.rb +23 -0
  37. data/spec/desk/client/article_spec.rb +62 -117
  38. data/spec/desk/client/brand_spec.rb +18 -0
  39. data/spec/desk/client/case_spec.rb +182 -66
  40. data/spec/desk/client/companies_spec.rb +26 -0
  41. data/spec/desk/client/custom_fields_spec.rb +18 -0
  42. data/spec/desk/client/customer_spec.rb +16 -145
  43. data/spec/desk/client/facebook_users_spec.rb +17 -0
  44. data/spec/desk/client/filter_spec.rb +28 -0
  45. data/spec/desk/client/group_spec.rb +32 -49
  46. data/spec/desk/client/inbound_mailboxes_spec.rb +70 -0
  47. data/spec/desk/client/integration_url_spec.rb +28 -0
  48. data/spec/desk/client/job_spec.rb +32 -0
  49. data/spec/desk/client/label_spec.rb +31 -0
  50. data/spec/desk/client/macro_spec.rb +22 -185
  51. data/spec/desk/client/rule_spec.rb +18 -0
  52. data/spec/desk/client/site_setting_spec.rb +18 -0
  53. data/spec/desk/client/system_message_spec.rb +42 -0
  54. data/spec/desk/client/topic_spec.rb +31 -112
  55. data/spec/desk/client/twitter_account_spec.rb +32 -0
  56. data/spec/desk/client/twitter_user_spec.rb +27 -0
  57. data/spec/desk/client/user_spec.rb +19 -42
  58. data/spec/desk_spec.rb +2 -2
  59. data/spec/faraday/response_spec.rb +3 -6
  60. data/spec/fixtures/article +50 -0
  61. data/spec/fixtures/article_create +50 -0
  62. data/spec/fixtures/article_translation +29 -0
  63. data/spec/fixtures/article_translation_create +29 -0
  64. data/spec/fixtures/article_translation_update +29 -0
  65. data/spec/fixtures/article_translations +81 -0
  66. data/spec/fixtures/article_update +50 -0
  67. data/spec/fixtures/articles +123 -0
  68. data/spec/fixtures/articles_search +124 -0
  69. data/spec/fixtures/brand +11 -0
  70. data/spec/fixtures/brands +45 -0
  71. data/spec/fixtures/case +44 -0
  72. data/spec/fixtures/case_attachment +19 -0
  73. data/spec/fixtures/case_attachment_create +19 -0
  74. data/spec/fixtures/case_attachments +61 -0
  75. data/spec/fixtures/case_create +51 -0
  76. data/spec/fixtures/case_message +26 -0
  77. data/spec/fixtures/case_note +21 -0
  78. data/spec/fixtures/case_note_create +26 -0
  79. data/spec/fixtures/case_notes +65 -0
  80. data/spec/fixtures/case_replies +75 -0
  81. data/spec/fixtures/case_reply +26 -0
  82. data/spec/fixtures/case_reply_create +26 -0
  83. data/spec/fixtures/case_reply_update +26 -0
  84. data/spec/fixtures/case_update +49 -0
  85. data/spec/fixtures/cases +111 -0
  86. data/spec/fixtures/cases_search +113 -0
  87. data/spec/fixtures/companies +75 -0
  88. data/spec/fixtures/companies_search +76 -0
  89. data/spec/fixtures/company +26 -0
  90. data/spec/fixtures/company_create +26 -0
  91. data/spec/fixtures/company_search +76 -0
  92. data/spec/fixtures/company_update +27 -0
  93. data/spec/fixtures/custom_field +15 -0
  94. data/spec/fixtures/custom_fields +58 -0
  95. data/spec/fixtures/customer +60 -0
  96. data/spec/fixtures/customer_create +54 -0
  97. data/spec/fixtures/customer_update +60 -0
  98. data/spec/fixtures/customers +143 -0
  99. data/spec/fixtures/customers_search +143 -0
  100. data/spec/fixtures/facebook_user +16 -0
  101. data/spec/fixtures/facebook_users +55 -0
  102. data/spec/fixtures/filter +16 -0
  103. data/spec/fixtures/filter_cases +111 -0
  104. data/spec/fixtures/filters +55 -0
  105. data/spec/fixtures/group +9 -0
  106. data/spec/fixtures/group_filters +55 -0
  107. data/spec/fixtures/group_users +63 -0
  108. data/spec/fixtures/groups +42 -0
  109. data/spec/fixtures/inbound_mailbox +32 -0
  110. data/spec/fixtures/inbound_mailboxes +87 -0
  111. data/spec/fixtures/integration_url +15 -0
  112. data/spec/fixtures/integration_url_create +15 -0
  113. data/spec/fixtures/integration_url_update +15 -0
  114. data/spec/fixtures/integration_urls +54 -0
  115. data/spec/fixtures/job +17 -0
  116. data/spec/fixtures/job_create +17 -0
  117. data/spec/fixtures/jobs +57 -0
  118. data/spec/fixtures/label +17 -0
  119. data/spec/fixtures/label_create +17 -0
  120. data/spec/fixtures/label_update +17 -0
  121. data/spec/fixtures/labels +57 -0
  122. data/spec/fixtures/macro +20 -0
  123. data/spec/fixtures/macro_action +17 -0
  124. data/spec/fixtures/macro_action_update +17 -0
  125. data/spec/fixtures/macro_actions +57 -0
  126. data/spec/fixtures/macro_create +20 -0
  127. data/spec/fixtures/macro_update +20 -0
  128. data/spec/fixtures/macros +63 -0
  129. data/spec/fixtures/rule +13 -0
  130. data/spec/fixtures/rules +49 -0
  131. data/spec/fixtures/site_setting +10 -0
  132. data/spec/fixtures/site_settings +43 -0
  133. data/spec/fixtures/system_message +4 -0
  134. data/spec/fixtures/topic +23 -0
  135. data/spec/fixtures/topic_create +23 -0
  136. data/spec/fixtures/topic_translation +12 -0
  137. data/spec/fixtures/topic_translation_create +12 -0
  138. data/spec/fixtures/topic_translation_update +12 -0
  139. data/spec/fixtures/topic_translations +47 -0
  140. data/spec/fixtures/topic_update +23 -0
  141. data/spec/fixtures/topics +69 -0
  142. data/spec/fixtures/twitter_account +14 -0
  143. data/spec/fixtures/twitter_account_tweet +20 -0
  144. data/spec/fixtures/twitter_account_tweet_create +20 -0
  145. data/spec/fixtures/twitter_account_tweets +63 -0
  146. data/spec/fixtures/twitter_accounts +51 -0
  147. data/spec/fixtures/twitter_user +18 -0
  148. data/spec/fixtures/twitter_user_create +18 -0
  149. data/spec/fixtures/twitter_users +59 -0
  150. data/spec/fixtures/user +20 -0
  151. data/spec/fixtures/user_preference +18 -0
  152. data/spec/fixtures/user_preference_update +14 -0
  153. data/spec/fixtures/user_preferences +223 -0
  154. data/spec/fixtures/users +63 -0
  155. data/spec/helper.rb +12 -0
  156. data/spec/shared_context.rb +16 -0
  157. data/spec/shared_examples.rb +312 -0
  158. metadata +247 -181
  159. data/lib/desk/client/interaction.rb +0 -75
  160. data/spec/desk/client/interaction_spec.rb +0 -191
  161. data/spec/fixtures/article.json +0 -50
  162. data/spec/fixtures/article_create.json +0 -54
  163. data/spec/fixtures/article_destroy.json +0 -3
  164. data/spec/fixtures/article_update.json +0 -54
  165. data/spec/fixtures/articles.json +0 -58
  166. data/spec/fixtures/case.json +0 -59
  167. data/spec/fixtures/case_update.json +0 -59
  168. data/spec/fixtures/cases.json +0 -182
  169. data/spec/fixtures/customer.json +0 -58
  170. data/spec/fixtures/customer_create.json +0 -56
  171. data/spec/fixtures/customer_create_email.json +0 -15
  172. data/spec/fixtures/customer_update.json +0 -47
  173. data/spec/fixtures/customer_update_email.json +0 -15
  174. data/spec/fixtures/customers.json +0 -98
  175. data/spec/fixtures/group.json +0 -8
  176. data/spec/fixtures/groups.json +0 -23
  177. data/spec/fixtures/interaction_create.json +0 -126
  178. data/spec/fixtures/interactions.json +0 -139
  179. data/spec/fixtures/macro.json +0 -8
  180. data/spec/fixtures/macro_action.json +0 -9
  181. data/spec/fixtures/macro_action_update.json +0 -12
  182. data/spec/fixtures/macro_actions.json +0 -69
  183. data/spec/fixtures/macro_create.json +0 -13
  184. data/spec/fixtures/macro_destroy.json +0 -3
  185. data/spec/fixtures/macro_update.json +0 -13
  186. data/spec/fixtures/macros.json +0 -24
  187. data/spec/fixtures/topic.json +0 -9
  188. data/spec/fixtures/topic_create.json +0 -14
  189. data/spec/fixtures/topic_destroy.json +0 -3
  190. data/spec/fixtures/topic_update.json +0 -14
  191. data/spec/fixtures/topics.json +0 -35
  192. data/spec/fixtures/user.json +0 -15
  193. data/spec/fixtures/users.json +0 -24
@@ -0,0 +1,50 @@
1
+ {
2
+ "subject": "How to make your customers happy",
3
+ "body": "<strong>Use Desk.com</strong>",
4
+ "body_email": "Email just doesn't cut it",
5
+ "body_email_auto": false,
6
+ "body_chat": "Use Desk.com",
7
+ "body_chat_auto": true,
8
+ "body_web_callback": "<strong>Use Desk.com</strong>",
9
+ "body_web_callback_auto": false,
10
+ "body_twitter": "Use Desk.com in 140 chars or less",
11
+ "body_twitter_auto": false,
12
+ "body_qna": "Use Desk.com",
13
+ "body_qna_auto": true,
14
+ "body_phone": "Use Desk.com",
15
+ "body_phone_auto": true,
16
+ "body_facebook": "Use Desk.com",
17
+ "body_facebook_auto": true,
18
+ "rating": 75,
19
+ "rating_count": 4,
20
+ "rating_score": 3,
21
+ "position": 1,
22
+ "quickcode": "AWESOME",
23
+ "in_support_center": true,
24
+ "internal_notes": "Notes to the agent here",
25
+ "publish_at": "2013-11-12T18:07:34Z",
26
+ "created_at": "2013-11-12T18:02:34Z",
27
+ "updated_at": "2013-11-12T18:07:34Z",
28
+ "_links": {
29
+ "self": {
30
+ "href": "/api/v2/articles/1",
31
+ "class": "article"
32
+ },
33
+ "topic": {
34
+ "href": "/api/v2/topics/2",
35
+ "class": "topic"
36
+ },
37
+ "translations": {
38
+ "href": "/api/v2/articles/1/translations",
39
+ "class": "article_translation"
40
+ },
41
+ "created_by": {
42
+ "href": "/api/v2/users/1",
43
+ "class": "user"
44
+ },
45
+ "updated_by": {
46
+ "href": "/api/v2/users/1",
47
+ "class": "user"
48
+ }
49
+ }
50
+ }
@@ -0,0 +1,123 @@
1
+ {
2
+ "total_entries": 2,
3
+ "_links": {
4
+ "self": {
5
+ "href": "/api/v2/articles?page=1&per_page=30",
6
+ "class": "page"
7
+ },
8
+ "first": {
9
+ "href": "/api/v2/articles?page=1&per_page=30",
10
+ "class": "page"
11
+ },
12
+ "last": {
13
+ "href": "/api/v2/articles?page=1&per_page=30",
14
+ "class": "page"
15
+ },
16
+ "next": null,
17
+ "previous": null
18
+ },
19
+ "_embedded": {
20
+ "entries": [
21
+ {
22
+ "subject": "Awesome Subject",
23
+ "body": "<p>Awesome apples</p>",
24
+ "body_email": "Email for Awesome apples",
25
+ "body_email_auto": false,
26
+ "body_chat": "Awesome apples",
27
+ "body_chat_auto": true,
28
+ "body_web_callback": "<p>Awesome Apples</p>",
29
+ "body_web_callback_auto": false,
30
+ "body_twitter": "Awesome apples",
31
+ "body_twitter_auto": true,
32
+ "body_qna": "Awesome apples",
33
+ "body_qna_auto": true,
34
+ "body_phone": "Awesome apples",
35
+ "body_phone_auto": true,
36
+ "body_facebook": "Awesome apples",
37
+ "body_facebook_auto": true,
38
+ "rating": 75,
39
+ "rating_count": 4,
40
+ "rating_score": 3,
41
+ "position": 1,
42
+ "quickcode": "AWESOME",
43
+ "in_support_center": true,
44
+ "internal_notes": "Notes to the agent here",
45
+ "publish_at": "2013-11-12T18:07:34Z",
46
+ "created_at": "2013-11-12T18:02:34Z",
47
+ "updated_at": "2013-11-12T18:07:34Z",
48
+ "_links": {
49
+ "self": {
50
+ "href": "/api/v2/articles/1",
51
+ "class": "article"
52
+ },
53
+ "topic": {
54
+ "href": "/api/v2/topics/1",
55
+ "class": "topic"
56
+ },
57
+ "translations": {
58
+ "href": "/api/v2/articles/1/translations",
59
+ "class": "article_translation"
60
+ },
61
+ "created_by": {
62
+ "href": "/api/v2/users/1",
63
+ "class": "user"
64
+ },
65
+ "updated_by": {
66
+ "href": "/api/v2/users/1",
67
+ "class": "user"
68
+ }
69
+ }
70
+ },
71
+ {
72
+ "subject": "How to make your customers happy",
73
+ "body": "<strong>Use Desk.com</strong>",
74
+ "body_email": "Email just doesn't cut it",
75
+ "body_email_auto": false,
76
+ "body_chat": "Use Desk.com",
77
+ "body_chat_auto": true,
78
+ "body_web_callback": "<strong>Use Desk.com</strong>",
79
+ "body_web_callback_auto": false,
80
+ "body_twitter": "Use Desk.com in 140 chars or less",
81
+ "body_twitter_auto": false,
82
+ "body_qna": "Use Desk.com",
83
+ "body_qna_auto": true,
84
+ "body_phone": "Use Desk.com",
85
+ "body_phone_auto": true,
86
+ "body_facebook": "Use Desk.com",
87
+ "body_facebook_auto": true,
88
+ "rating": 75,
89
+ "rating_count": 4,
90
+ "rating_score": 3,
91
+ "position": 1,
92
+ "quickcode": "AWESOME",
93
+ "in_support_center": true,
94
+ "internal_notes": "Notes to the agent here",
95
+ "publish_at": "2013-11-12T18:07:34Z",
96
+ "created_at": "2013-11-12T18:02:34Z",
97
+ "updated_at": "2013-11-12T18:07:34Z",
98
+ "_links": {
99
+ "self": {
100
+ "href": "/api/v2/articles/2",
101
+ "class": "article"
102
+ },
103
+ "topic": {
104
+ "href": "/api/v2/topics/1",
105
+ "class": "topic"
106
+ },
107
+ "translations": {
108
+ "href": "/api/v2/articles/2/translations",
109
+ "class": "article_translation"
110
+ },
111
+ "created_by": {
112
+ "href": "/api/v2/users/1",
113
+ "class": "user"
114
+ },
115
+ "updated_by": {
116
+ "href": "/api/v2/users/1",
117
+ "class": "user"
118
+ }
119
+ }
120
+ }
121
+ ]
122
+ }
123
+ }
@@ -0,0 +1,124 @@
1
+ {
2
+ "total_entries": 2,
3
+ "_links": {
4
+ "self": {
5
+ "href": "/api/v2/articles?page=1&per_page=30",
6
+ "class": "page"
7
+ },
8
+ "first": {
9
+ "href": "/api/v2/articles?page=1&per_page=30",
10
+ "class": "page"
11
+ },
12
+ "last": {
13
+ "href": "/api/v2/articles?page=1&per_page=30",
14
+ "class": "page"
15
+ },
16
+ "next": null,
17
+ "previous": null
18
+ },
19
+ "_embedded": {
20
+ "entries": [
21
+ {
22
+ "subject": "Awesome Subject",
23
+ "body": "<p>Awesome apples</p>",
24
+ "body_email": "Email for Awesome apples",
25
+ "body_email_auto": false,
26
+ "body_chat": "Awesome apples",
27
+ "body_chat_auto": true,
28
+ "body_web_callback": "<p>Awesome Apples</p>",
29
+ "body_web_callback_auto": false,
30
+ "body_twitter": "Awesome apples",
31
+ "body_twitter_auto": true,
32
+ "body_qna": "Awesome apples",
33
+ "body_qna_auto": true,
34
+ "body_phone": "Awesome apples",
35
+ "body_phone_auto": true,
36
+ "body_facebook": "Awesome apples",
37
+ "body_facebook_auto": true,
38
+ "rating": 75,
39
+ "rating_count": 4,
40
+ "rating_score": 3,
41
+ "position": 1,
42
+ "quickcode": "AWESOME",
43
+ "in_support_center": true,
44
+ "internal_notes": "Notes to the agent here",
45
+ "publish_at": "2013-11-22T22:54:20Z",
46
+ "created_at": "2013-11-22T22:49:20Z",
47
+ "updated_at": "2013-11-22T22:54:20Z",
48
+ "_links": {
49
+ "self": {
50
+ "href": "/api/v2/articles/1",
51
+ "class": "article"
52
+ },
53
+ "topic": {
54
+ "href": "/api/v2/topics/1",
55
+ "class": "topic"
56
+ },
57
+ "translations": {
58
+ "href": "/api/v2/articles/1/translations",
59
+ "class": "article_translation"
60
+ },
61
+ "created_by": {
62
+ "href": "/api/v2/users/1",
63
+ "class": "user"
64
+ },
65
+ "updated_by": {
66
+ "href": "/api/v2/users/1",
67
+ "class": "user"
68
+ }
69
+ }
70
+ },
71
+ {
72
+ "subject": "How to make your customers happy",
73
+ "body": "<strong>Use Desk.com</strong>",
74
+ "body_email": "Email just doesn't cut it",
75
+ "body_email_auto": false,
76
+ "body_chat": "Use Desk.com",
77
+ "body_chat_auto": true,
78
+ "body_web_callback": "<strong>Use Desk.com</strong>",
79
+ "body_web_callback_auto": false,
80
+ "body_twitter": "Use Desk.com in 140 chars or less",
81
+ "body_twitter_auto": false,
82
+ "body_qna": "Use Desk.com",
83
+ "body_qna_auto": true,
84
+ "body_phone": "Use Desk.com",
85
+ "body_phone_auto": true,
86
+ "body_facebook": "Use Desk.com",
87
+ "body_facebook_auto": true,
88
+ "rating": 75,
89
+ "rating_count": 4,
90
+ "rating_score": 3,
91
+ "position": 1,
92
+ "quickcode": "AWESOME",
93
+ "in_support_center": true,
94
+ "internal_notes": "Notes to the agent here",
95
+ "publish_at": "2013-11-22T22:54:20Z",
96
+ "created_at": "2013-11-22T22:49:20Z",
97
+ "updated_at": "2013-11-22T22:54:20Z",
98
+ "_links": {
99
+ "self": {
100
+ "href": "/api/v2/articles/1",
101
+ "class": "article"
102
+ },
103
+ "topic": {
104
+ "href": "/api/v2/topics/1",
105
+ "class": "topic"
106
+ },
107
+ "translations": {
108
+ "href": "/api/v2/articles/1/translations",
109
+ "class": "article_translation"
110
+ },
111
+ "created_by": {
112
+ "href": "/api/v2/users/1",
113
+ "class": "user"
114
+ },
115
+ "updated_by": {
116
+ "href": "/api/v2/users/1",
117
+ "class": "user"
118
+ }
119
+ },
120
+ "body_text": "Use Desk.com"
121
+ }
122
+ ]
123
+ }
124
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "name": "Desk.com",
3
+ "created_at": "2013-11-22T22:49:20Z",
4
+ "updated_at": "2013-11-22T22:49:20Z",
5
+ "_links": {
6
+ "self": {
7
+ "href": "/api/v2/brands/1",
8
+ "class": "brand"
9
+ }
10
+ }
11
+ }
@@ -0,0 +1,45 @@
1
+ {
2
+ "total_entries": 2,
3
+ "_links": {
4
+ "self": {
5
+ "href": "/api/v2/brands?page=1&per_page=30",
6
+ "class": "page"
7
+ },
8
+ "first": {
9
+ "href": "/api/v2/brands?page=1&per_page=30",
10
+ "class": "page"
11
+ },
12
+ "last": {
13
+ "href": "/api/v2/brands?page=1&per_page=30",
14
+ "class": "page"
15
+ },
16
+ "next": null,
17
+ "previous": null
18
+ },
19
+ "_embedded": {
20
+ "entries": [
21
+ {
22
+ "name": "Desk.com",
23
+ "created_at": "2013-11-22T22:49:20Z",
24
+ "updated_at": "2013-11-22T22:49:20Z",
25
+ "_links": {
26
+ "self": {
27
+ "href": "/api/v2/brands/1",
28
+ "class": "brand"
29
+ }
30
+ }
31
+ },
32
+ {
33
+ "name": "Alpha Inc",
34
+ "created_at": "2013-11-22T22:49:20Z",
35
+ "updated_at": "2013-11-22T22:49:20Z",
36
+ "_links": {
37
+ "self": {
38
+ "href": "/api/v2/brands/2",
39
+ "class": "brand"
40
+ }
41
+ }
42
+ }
43
+ ]
44
+ }
45
+ }
@@ -0,0 +1,44 @@
1
+ {
2
+ "external_id": null,
3
+ "subject": "Welcome",
4
+ "priority": 5,
5
+ "locked_until": null,
6
+ "description": null,
7
+ "status": "new",
8
+ "type": "email",
9
+ "language": "en_us",
10
+ "created_at": "2013-11-22T22:49:20Z",
11
+ "updated_at": "2013-11-22T22:54:20Z",
12
+ "active_at": "2013-11-22T22:54:20Z",
13
+ "received_at": "2013-11-22T22:49:20Z",
14
+ "first_opened_at": "2013-11-22T22:50:20Z",
15
+ "opened_at": "2013-11-22T22:51:20Z",
16
+ "first_resolved_at": "2013-11-22T22:54:20Z",
17
+ "resolved_at": "2013-11-22T22:54:20Z",
18
+ "custom_fields": {
19
+ "level": "vip"
20
+ },
21
+ "_links": {
22
+ "self": {
23
+ "href": "/api/v2/cases/1",
24
+ "class": "case"
25
+ },
26
+ "message": {
27
+ "href": "/api/v2/cases/1/message",
28
+ "class": "message"
29
+ },
30
+ "customer": {
31
+ "href": "/api/v2/customers/1",
32
+ "class": "customer"
33
+ },
34
+ "assigned_user": {
35
+ "href": "/api/v2/users/2",
36
+ "class": "user"
37
+ },
38
+ "assigned_group": {
39
+ "href": "/api/v2/groups/1",
40
+ "class": "group"
41
+ },
42
+ "locked_by": null
43
+ }
44
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "file_name": "awesome_pic.png",
3
+ "content_type": "image/png",
4
+ "size": "500",
5
+ "url": "http://example.com/short_lived_link_to_the_file_content",
6
+ "erased_at": null,
7
+ "created_at": "2013-11-22T22:49:20Z",
8
+ "updated_at": "2013-11-22T22:49:20Z",
9
+ "_links": {
10
+ "self": {
11
+ "href": "/api/v2/cases/1/attachments/1",
12
+ "class": "attachment"
13
+ },
14
+ "case": {
15
+ "href": "/api/v2/cases/1",
16
+ "class": "case"
17
+ }
18
+ }
19
+ }
@@ -0,0 +1,19 @@
1
+ {
2
+ "file_name": "awesome_pic.png",
3
+ "content_type": "image/png",
4
+ "size": "500",
5
+ "url": "http://example.com/short_lived_link_to_the_file_content",
6
+ "erased_at": null,
7
+ "created_at": "2013-11-22T22:49:20Z",
8
+ "updated_at": "2013-11-22T22:49:20Z",
9
+ "_links": {
10
+ "self": {
11
+ "href": "/api/v2/cases/1/attachments/1",
12
+ "class": "attachment"
13
+ },
14
+ "case": {
15
+ "href": "/api/v2/cases/1",
16
+ "class": "case"
17
+ }
18
+ }
19
+ }
@@ -0,0 +1,61 @@
1
+ {
2
+ "total_entries": 2,
3
+ "_links": {
4
+ "self": {
5
+ "href": "/api/v2/cases/1/attachments?page=1&per_page=50",
6
+ "class": "page"
7
+ },
8
+ "first": {
9
+ "href": "/api/v2/cases/1/attachments?page=1&per_page=50",
10
+ "class": "page"
11
+ },
12
+ "last": {
13
+ "href": "/api/v2/cases/1/attachments?page=1&per_page=50",
14
+ "class": "page"
15
+ },
16
+ "next": null,
17
+ "previous": null
18
+ },
19
+ "_embedded": {
20
+ "entries": [
21
+ {
22
+ "file_name": "awesome_pic.png",
23
+ "content_type": "image/png",
24
+ "size": "500",
25
+ "url": "http://example.com/short_lived_link_to_the_file_content",
26
+ "erased_at": null,
27
+ "created_at": "2013-11-22T22:49:20Z",
28
+ "updated_at": "2013-11-22T22:49:20Z",
29
+ "_links": {
30
+ "self": {
31
+ "href": "/api/v2/cases/1/attachments/1",
32
+ "class": "attachment"
33
+ },
34
+ "case": {
35
+ "href": "/api/v2/cases/1",
36
+ "class": "case"
37
+ }
38
+ }
39
+ },
40
+ {
41
+ "file_name": "another_awesome_pic.png",
42
+ "content_type": "image/png",
43
+ "size": "500",
44
+ "url": "http://example.com/short_lived_link_to_the_file_content",
45
+ "erased_at": null,
46
+ "created_at": "2013-11-22T22:49:20Z",
47
+ "updated_at": "2013-11-22T22:49:20Z",
48
+ "_links": {
49
+ "self": {
50
+ "href": "/api/v2/cases/1/attachments/2",
51
+ "class": "attachment"
52
+ },
53
+ "case": {
54
+ "href": "/api/v2/cases/2",
55
+ "class": "case"
56
+ }
57
+ }
58
+ }
59
+ ]
60
+ }
61
+ }