typetalk 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +23 -0
  3. data/.rspec +4 -0
  4. data/Gemfile +4 -0
  5. data/LICENSE.txt +22 -0
  6. data/README.md +215 -0
  7. data/Rakefile +7 -0
  8. data/lib/typetalk.rb +36 -0
  9. data/lib/typetalk/api.rb +49 -0
  10. data/lib/typetalk/api/auth.rb +43 -0
  11. data/lib/typetalk/api/mention.rb +28 -0
  12. data/lib/typetalk/api/message.rb +105 -0
  13. data/lib/typetalk/api/notification.rb +77 -0
  14. data/lib/typetalk/api/topic.rb +56 -0
  15. data/lib/typetalk/api/user.rb +17 -0
  16. data/lib/typetalk/connection.rb +31 -0
  17. data/lib/typetalk/error.rb +7 -0
  18. data/lib/typetalk/version.rb +3 -0
  19. data/spec/cassettes/Typetalk_Api_Auth/_get_access_token/should_get_the_correct_resource_by_authorization_code.yml +40 -0
  20. data/spec/cassettes/Typetalk_Api_Auth/_get_access_token/should_get_the_correct_resource_by_client_credentials.yml +40 -0
  21. data/spec/cassettes/Typetalk_Api_Auth/_get_access_token/should_get_the_correct_resource_by_client_credentials_when_scope_changed.yml +40 -0
  22. data/spec/cassettes/Typetalk_Api_Auth/_get_access_token/should_raise_error_when_authorization_code_is_wrong.yml +40 -0
  23. data/spec/cassettes/Typetalk_Api_Auth/_get_access_token/should_raise_error_when_client_id_is_wrong.yml +40 -0
  24. data/spec/cassettes/Typetalk_Api_Auth/_get_access_token/should_raise_error_when_client_secret_is_wrong.yml +40 -0
  25. data/spec/cassettes/Typetalk_Api_Auth/_get_access_token/should_raise_error_when_redirect_uri_mismatch.yml +40 -0
  26. data/spec/cassettes/Typetalk_Api_Mention/_get_mentions/should_get_the_correct_resource.yml +85 -0
  27. data/spec/cassettes/Typetalk_Api_Mention/_get_mentions/should_get_the_correct_resource_till_mention.yml +83 -0
  28. data/spec/cassettes/Typetalk_Api_Mention/_get_mentions/should_get_the_unread_resource.yml +83 -0
  29. data/spec/cassettes/Typetalk_Api_Mention/_read_mention/should_get_the_correct_resource.yml +83 -0
  30. data/spec/cassettes/Typetalk_Api_Mention/_read_mention/should_raise_error_when_mention_id_is_wrong.yml +73 -0
  31. data/spec/cassettes/Typetalk_Api_Message/_get_message/should_get_the_correct_resource.yml +129 -0
  32. data/spec/cassettes/Typetalk_Api_Message/_get_message/should_raise_error_when_post_id_is_wrong.yml +71 -0
  33. data/spec/cassettes/Typetalk_Api_Message/_get_message/should_raise_error_when_topic_id_is_wrong.yml +71 -0
  34. data/spec/cassettes/Typetalk_Api_Message/_like_message/should_get_the_correct_resource.yml +161 -0
  35. data/spec/cassettes/Typetalk_Api_Message/_like_message/should_raise_error_when_post_id_is_wrong.yml +73 -0
  36. data/spec/cassettes/Typetalk_Api_Message/_post_message/should_get_the_correct_resource.yml +85 -0
  37. data/spec/cassettes/Typetalk_Api_Message/_post_message/should_get_the_correct_resource_for_attachments.yml +536 -0
  38. data/spec/cassettes/Typetalk_Api_Message/_post_message/should_get_the_correct_resource_for_reply.yml +130 -0
  39. data/spec/cassettes/Typetalk_Api_Message/_post_message/should_get_the_correct_resource_for_talks.yml +88 -0
  40. data/spec/cassettes/Typetalk_Api_Message/_post_message/should_raise_error_when_topic_id_is_wrong.yml +73 -0
  41. data/spec/cassettes/Typetalk_Api_Message/_read_message/should_get_the_correct_resource.yml +171 -0
  42. data/spec/cassettes/Typetalk_Api_Message/_read_message/should_get_the_correct_resource_till_post.yml +171 -0
  43. data/spec/cassettes/Typetalk_Api_Message/_read_message/should_raise_error_when_post_id_is_wrong.yml +73 -0
  44. data/spec/cassettes/Typetalk_Api_Message/_remove_message/should_get_the_correct_resource.yml +199 -0
  45. data/spec/cassettes/Typetalk_Api_Message/_remove_message/should_raise_error_when_post_id_is_wrong.yml +71 -0
  46. data/spec/cassettes/Typetalk_Api_Message/_unlike_message/should_get_the_correct_resource.yml +200 -0
  47. data/spec/cassettes/Typetalk_Api_Message/_unlike_message/should_raise_error_when_post_id_is_wrong.yml +71 -0
  48. data/spec/cassettes/Typetalk_Api_Message/_upload_attachment/should_get_the_correct_resource.yml +258 -0
  49. data/spec/cassettes/Typetalk_Api_Message/_upload_attachment/should_raise_error_when_topic_id_is_wrong.yml +250 -0
  50. data/spec/cassettes/Typetalk_Api_Notification/_accept_team/should_get_the_correct_resource.yml +119 -0
  51. data/spec/cassettes/Typetalk_Api_Notification/_accept_team/should_raise_error_when_invite_team_id_is_wrong.yml +73 -0
  52. data/spec/cassettes/Typetalk_Api_Notification/_accept_team/should_raise_error_when_team_id_is_wrong.yml +73 -0
  53. data/spec/cassettes/Typetalk_Api_Notification/_accept_topic/should_get_the_correct_resource.yml +120 -0
  54. data/spec/cassettes/Typetalk_Api_Notification/_accept_topic/should_raise_error_when_invite_topic_id_is_wrong.yml +73 -0
  55. data/spec/cassettes/Typetalk_Api_Notification/_accept_topic/should_raise_error_when_topic_id_is_wrong.yml +73 -0
  56. data/spec/cassettes/Typetalk_Api_Notification/_decline_team/should_get_the_correct_resource.yml +118 -0
  57. data/spec/cassettes/Typetalk_Api_Notification/_decline_team/should_raise_error_when_invite_team_id_is_wrong.yml +73 -0
  58. data/spec/cassettes/Typetalk_Api_Notification/_decline_team/should_raise_error_when_team_id_is_wrong.yml +73 -0
  59. data/spec/cassettes/Typetalk_Api_Notification/_decline_topic/should_get_the_correct_resource.yml +120 -0
  60. data/spec/cassettes/Typetalk_Api_Notification/_decline_topic/should_raise_error_when_invite_topic_id_is_wrong.yml +73 -0
  61. data/spec/cassettes/Typetalk_Api_Notification/_decline_topic/should_raise_error_when_topic_id_is_wrong.yml +73 -0
  62. data/spec/cassettes/Typetalk_Api_Notification/_get_notifications/should_get_the_correct_resource.yml +101 -0
  63. data/spec/cassettes/Typetalk_Api_Notification/_get_notifications_status/should_get_the_correct_resource.yml +79 -0
  64. data/spec/cassettes/Typetalk_Api_Notification/_read_notifications/should_get_the_correct_resource.yml +81 -0
  65. data/spec/cassettes/Typetalk_Api_Topic/_favorite_topic/should_get_the_correct_resource.yml +82 -0
  66. data/spec/cassettes/Typetalk_Api_Topic/_favorite_topic/should_raise_error_when_topic_id_is_wrong.yml +73 -0
  67. data/spec/cassettes/Typetalk_Api_Topic/_get_topic/should_get_the_correct_backward_resource.yml +85 -0
  68. data/spec/cassettes/Typetalk_Api_Topic/_get_topic/should_get_the_correct_forward_resource.yml +84 -0
  69. data/spec/cassettes/Typetalk_Api_Topic/_get_topic/should_get_the_correct_resource.yml +88 -0
  70. data/spec/cassettes/Typetalk_Api_Topic/_get_topic/should_raise_error_when_topic_id_is_wrong.yml +71 -0
  71. data/spec/cassettes/Typetalk_Api_Topic/_get_topic_members/should_get_the_correct_resource.yml +81 -0
  72. data/spec/cassettes/Typetalk_Api_Topic/_get_topic_members/should_raise_error_when_topic_id_is_wrong.yml +71 -0
  73. data/spec/cassettes/Typetalk_Api_Topic/_get_topics/should_get_the_correct_resource.yml +83 -0
  74. data/spec/cassettes/Typetalk_Api_Topic/_unfavorite_topic/should_get_the_correct_resource.yml +80 -0
  75. data/spec/cassettes/Typetalk_Api_Topic/_unfavorite_topic/should_raise_error_when_topic_id_is_wrong.yml +71 -0
  76. data/spec/cassettes/Typetalk_Api_User/_get_profile/should_get_the_correct_resource.yml +81 -0
  77. data/spec/cassettes/Typetalk_Api_User/_get_profile/should_raise_error_when_access_token_is_wrong.yml +73 -0
  78. data/spec/cassettes/Typetalk_Api_User/_get_profile/should_raise_error_when_scope_is_wrong.yml +73 -0
  79. data/spec/fixtures/attachments/logo_cacoo.jpg +0 -0
  80. data/spec/fixtures/attachments/logo_typetalk.jpg +0 -0
  81. data/spec/spec_helper.rb +36 -0
  82. data/spec/typetalk/api/auth_spec.rb +81 -0
  83. data/spec/typetalk/api/mention_spec.rb +73 -0
  84. data/spec/typetalk/api/message_spec.rb +232 -0
  85. data/spec/typetalk/api/notification_spec.rb +200 -0
  86. data/spec/typetalk/api/topic_spec.rb +150 -0
  87. data/spec/typetalk/api/user_spec.rb +27 -0
  88. data/typetalk.gemspec +33 -0
  89. metadata +326 -0
@@ -0,0 +1,171 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://typetalk.in/oauth2/access_token
6
+ body:
7
+ encoding: UTF-8
8
+ string: client_id=(CLIENT_ID)&client_secret=(CLIENT_SECRET)&grant_type=client_credentials&scope=topic.read%2Ctopic.post%2Cmy
9
+ headers:
10
+ Accept:
11
+ - application/json; charset=utf-8
12
+ User-Agent:
13
+ - Typetalk Rubygem 0.0.1
14
+ Content-Type:
15
+ - application/x-www-form-urlencoded
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Server:
24
+ - nginx
25
+ Date:
26
+ - Thu, 15 May 2014 12:26:03 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Connection:
32
+ - keep-alive
33
+ Strict-Transport-Security:
34
+ - max-age=2592000
35
+ body:
36
+ encoding: UTF-8
37
+ string: '{"access_token":"(ACCESS_TOKEN)","expires_in":3600,"scope":"topic.read,topic.post,my","refresh_token":"(REFRESH_TOKEN)","token_type":"Bearer"}'
38
+ http_version:
39
+ recorded_at: Thu, 15 May 2014 12:26:03 GMT
40
+ - request:
41
+ method: post
42
+ uri: https://typetalk.in/api/v1/topics/5148?access_token=(ACCESS_TOKEN)
43
+ body:
44
+ encoding: UTF-8
45
+ string: message=Test+Message+2+-+12
46
+ headers:
47
+ Accept:
48
+ - application/json; charset=utf-8
49
+ User-Agent:
50
+ - Typetalk Rubygem 0.0.1
51
+ Content-Type:
52
+ - application/x-www-form-urlencoded
53
+ Accept-Encoding:
54
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
55
+ response:
56
+ status:
57
+ code: 200
58
+ message: OK
59
+ headers:
60
+ Server:
61
+ - nginx
62
+ Date:
63
+ - Thu, 15 May 2014 12:26:04 GMT
64
+ Content-Type:
65
+ - application/json; charset=utf-8
66
+ Transfer-Encoding:
67
+ - chunked
68
+ Connection:
69
+ - keep-alive
70
+ Cache-Control:
71
+ - no-cache
72
+ Etag:
73
+ - W/"651245fb7c063e0fb1635c7a398b895f"
74
+ Strict-Transport-Security:
75
+ - max-age=2592000
76
+ body:
77
+ encoding: UTF-8
78
+ string: '{"topic":{"name":"Test Topic 2","updatedAt":"2014-05-15T07:49:56Z","description":null,"id":5148,"lastPostedAt":"2014-05-15T12:26:04Z","createdAt":"2014-05-15T07:45:57Z","suggestion":"Test
79
+ Topic 2"},"post":{"updatedAt":"2014-05-15T12:26:04Z","talks":[],"replyTo":null,"url":"https://typetalk.in/topics/5148/posts/279113","topicId":5148,"likes":[],"links":[],"id":279113,"mention":null,"createdAt":"2014-05-15T12:26:04Z","message":"Test
80
+ Message 2 - 12","account":{"name":"typetalk-rubygem-tester","updatedAt":"2014-05-15T00:36:03Z","fullName":"Rubygem
81
+ Tester","id":3865,"createdAt":"2014-05-14T09:09:44Z","suggestion":"Rubygem
82
+ Tester","imageUrl":"https://typetalk.in/accounts/3865/profile_image.png?t=1400114163838"},"attachments":[]}}'
83
+ http_version:
84
+ recorded_at: Thu, 15 May 2014 12:26:04 GMT
85
+ - request:
86
+ method: post
87
+ uri: https://typetalk.in/api/v1/topics/5148?access_token=(ACCESS_TOKEN)
88
+ body:
89
+ encoding: UTF-8
90
+ string: message=Test+Message+2+-+13
91
+ headers:
92
+ Accept:
93
+ - application/json; charset=utf-8
94
+ User-Agent:
95
+ - Typetalk Rubygem 0.0.1
96
+ Content-Type:
97
+ - application/x-www-form-urlencoded
98
+ Accept-Encoding:
99
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
100
+ response:
101
+ status:
102
+ code: 200
103
+ message: OK
104
+ headers:
105
+ Server:
106
+ - nginx
107
+ Date:
108
+ - Thu, 15 May 2014 12:26:04 GMT
109
+ Content-Type:
110
+ - application/json; charset=utf-8
111
+ Transfer-Encoding:
112
+ - chunked
113
+ Connection:
114
+ - keep-alive
115
+ Cache-Control:
116
+ - no-cache
117
+ Etag:
118
+ - W/"2bb44a81a85849462dd2c94032ed5077"
119
+ Strict-Transport-Security:
120
+ - max-age=2592000
121
+ body:
122
+ encoding: UTF-8
123
+ string: '{"topic":{"name":"Test Topic 2","updatedAt":"2014-05-15T07:49:56Z","description":null,"id":5148,"lastPostedAt":"2014-05-15T12:26:04Z","createdAt":"2014-05-15T07:45:57Z","suggestion":"Test
124
+ Topic 2"},"post":{"updatedAt":"2014-05-15T12:26:04Z","talks":[],"replyTo":null,"url":"https://typetalk.in/topics/5148/posts/279114","topicId":5148,"likes":[],"links":[],"id":279114,"mention":null,"createdAt":"2014-05-15T12:26:04Z","message":"Test
125
+ Message 2 - 13","account":{"name":"typetalk-rubygem-tester","updatedAt":"2014-05-15T00:36:03Z","fullName":"Rubygem
126
+ Tester","id":3865,"createdAt":"2014-05-14T09:09:44Z","suggestion":"Rubygem
127
+ Tester","imageUrl":"https://typetalk.in/accounts/3865/profile_image.png?t=1400114163838"},"attachments":[]}}'
128
+ http_version:
129
+ recorded_at: Thu, 15 May 2014 12:26:04 GMT
130
+ - request:
131
+ method: post
132
+ uri: https://typetalk.in/api/v1/bookmark/save?access_token=(ACCESS_TOKEN)
133
+ body:
134
+ encoding: UTF-8
135
+ string: postId=279113&topicId=5148
136
+ headers:
137
+ Accept:
138
+ - application/json; charset=utf-8
139
+ User-Agent:
140
+ - Typetalk Rubygem 0.0.1
141
+ Content-Type:
142
+ - application/x-www-form-urlencoded
143
+ Accept-Encoding:
144
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
145
+ response:
146
+ status:
147
+ code: 200
148
+ message: OK
149
+ headers:
150
+ Server:
151
+ - nginx
152
+ Date:
153
+ - Thu, 15 May 2014 12:26:05 GMT
154
+ Content-Type:
155
+ - application/json; charset=utf-8
156
+ Transfer-Encoding:
157
+ - chunked
158
+ Connection:
159
+ - keep-alive
160
+ Cache-Control:
161
+ - no-cache
162
+ Etag:
163
+ - W/"495e5c175f7c4e62024160f01763b747"
164
+ Strict-Transport-Security:
165
+ - max-age=2592000
166
+ body:
167
+ encoding: UTF-8
168
+ string: '{"unread":{"topicId":5148,"postId":279113,"count":1}}'
169
+ http_version:
170
+ recorded_at: Thu, 15 May 2014 12:26:05 GMT
171
+ recorded_with: VCR 2.9.0
@@ -0,0 +1,73 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://typetalk.in/oauth2/access_token
6
+ body:
7
+ encoding: UTF-8
8
+ string: client_id=(CLIENT_ID)&client_secret=(CLIENT_SECRET)&grant_type=client_credentials&scope=topic.read%2Ctopic.post%2Cmy
9
+ headers:
10
+ Accept:
11
+ - application/json; charset=utf-8
12
+ User-Agent:
13
+ - Typetalk Rubygem 0.0.1
14
+ Content-Type:
15
+ - application/x-www-form-urlencoded
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Server:
24
+ - nginx
25
+ Date:
26
+ - Thu, 15 May 2014 12:19:16 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Connection:
32
+ - keep-alive
33
+ Strict-Transport-Security:
34
+ - max-age=2592000
35
+ body:
36
+ encoding: UTF-8
37
+ string: '{"access_token":"(ACCESS_TOKEN)","expires_in":3600,"scope":"topic.read,topic.post,my","refresh_token":"(REFRESH_TOKEN)","token_type":"Bearer"}'
38
+ http_version:
39
+ recorded_at: Thu, 15 May 2014 12:19:16 GMT
40
+ - request:
41
+ method: post
42
+ uri: https://typetalk.in/api/v1/bookmark/save?access_token=(ACCESS_TOKEN)
43
+ body:
44
+ encoding: UTF-8
45
+ string: postId=dummy&topicId=5148
46
+ headers:
47
+ Accept:
48
+ - application/json; charset=utf-8
49
+ User-Agent:
50
+ - Typetalk Rubygem 0.0.1
51
+ Content-Type:
52
+ - application/x-www-form-urlencoded
53
+ Accept-Encoding:
54
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
55
+ response:
56
+ status:
57
+ code: 400
58
+ message: Bad Request
59
+ headers:
60
+ Server:
61
+ - nginx
62
+ Date:
63
+ - Thu, 15 May 2014 12:19:16 GMT
64
+ Content-Length:
65
+ - '0'
66
+ Connection:
67
+ - keep-alive
68
+ body:
69
+ encoding: UTF-8
70
+ string: ''
71
+ http_version:
72
+ recorded_at: Thu, 15 May 2014 12:19:16 GMT
73
+ recorded_with: VCR 2.9.0
@@ -0,0 +1,199 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://typetalk.in/oauth2/access_token
6
+ body:
7
+ encoding: UTF-8
8
+ string: client_id=(CLIENT_ID)&client_secret=(CLIENT_SECRET)&grant_type=client_credentials&scope=topic.read%2Ctopic.post%2Cmy
9
+ headers:
10
+ Accept:
11
+ - application/json; charset=utf-8
12
+ User-Agent:
13
+ - Typetalk Rubygem 0.0.1
14
+ Content-Type:
15
+ - application/x-www-form-urlencoded
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Server:
24
+ - nginx
25
+ Date:
26
+ - Thu, 15 May 2014 12:04:03 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Connection:
32
+ - keep-alive
33
+ Strict-Transport-Security:
34
+ - max-age=2592000
35
+ body:
36
+ encoding: UTF-8
37
+ string: '{"access_token":"(ACCESS_TOKEN)","expires_in":3600,"scope":"topic.read,topic.post,my","refresh_token":"(REFRESH_TOKEN)","token_type":"Bearer"}'
38
+ http_version:
39
+ recorded_at: Thu, 15 May 2014 12:04:03 GMT
40
+ - request:
41
+ method: post
42
+ uri: https://typetalk.in/api/v1/topics/5148?access_token=(ACCESS_TOKEN)
43
+ body:
44
+ encoding: UTF-8
45
+ string: message=Test+Message+2+-+7
46
+ headers:
47
+ Accept:
48
+ - application/json; charset=utf-8
49
+ User-Agent:
50
+ - Typetalk Rubygem 0.0.1
51
+ Content-Type:
52
+ - application/x-www-form-urlencoded
53
+ Accept-Encoding:
54
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
55
+ response:
56
+ status:
57
+ code: 200
58
+ message: OK
59
+ headers:
60
+ Server:
61
+ - nginx
62
+ Date:
63
+ - Thu, 15 May 2014 12:04:04 GMT
64
+ Content-Type:
65
+ - application/json; charset=utf-8
66
+ Transfer-Encoding:
67
+ - chunked
68
+ Connection:
69
+ - keep-alive
70
+ Cache-Control:
71
+ - no-cache
72
+ Etag:
73
+ - W/"2f79e364fbd9cb341389ca639fccf08e"
74
+ Strict-Transport-Security:
75
+ - max-age=2592000
76
+ body:
77
+ encoding: UTF-8
78
+ string: '{"topic":{"name":"Test Topic 2","updatedAt":"2014-05-15T07:49:56Z","description":null,"id":5148,"lastPostedAt":"2014-05-15T12:04:04Z","createdAt":"2014-05-15T07:45:57Z","suggestion":"Test
79
+ Topic 2"},"post":{"updatedAt":"2014-05-15T12:04:04Z","talks":[],"replyTo":null,"url":"https://typetalk.in/topics/5148/posts/279090","topicId":5148,"likes":[],"links":[],"id":279090,"mention":null,"createdAt":"2014-05-15T12:04:04Z","message":"Test
80
+ Message 2 - 7","account":{"name":"typetalk-rubygem-tester","updatedAt":"2014-05-15T00:36:03Z","fullName":"Rubygem
81
+ Tester","id":3865,"createdAt":"2014-05-14T09:09:44Z","suggestion":"Rubygem
82
+ Tester","imageUrl":"https://typetalk.in/accounts/3865/profile_image.png?t=1400114163838"},"attachments":[]}}'
83
+ http_version:
84
+ recorded_at: Thu, 15 May 2014 12:04:04 GMT
85
+ - request:
86
+ method: get
87
+ uri: https://typetalk.in/api/v1/topics/5148/posts/279090?access_token=(ACCESS_TOKEN)
88
+ body:
89
+ encoding: US-ASCII
90
+ string: ''
91
+ headers:
92
+ Accept:
93
+ - application/json; charset=utf-8
94
+ User-Agent:
95
+ - Typetalk Rubygem 0.0.1
96
+ Accept-Encoding:
97
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
98
+ response:
99
+ status:
100
+ code: 200
101
+ message: OK
102
+ headers:
103
+ Server:
104
+ - nginx
105
+ Date:
106
+ - Thu, 15 May 2014 12:04:04 GMT
107
+ Content-Type:
108
+ - application/json; charset=utf-8
109
+ Transfer-Encoding:
110
+ - chunked
111
+ Connection:
112
+ - keep-alive
113
+ Cache-Control:
114
+ - no-cache
115
+ Etag:
116
+ - W/"5e1b0e16b8c79d867342c369088b64a4"
117
+ Strict-Transport-Security:
118
+ - max-age=2592000
119
+ body:
120
+ encoding: UTF-8
121
+ string: '{"team":{"name":"Test Team 2","updatedAt":"2014-05-15T07:45:57Z","description":null,"id":1035,"createdAt":"2014-05-15T07:45:57Z","imageUrl":"https://typetalk.in/teams/1035/image.png?t=1400139957890"},"topic":{"name":"Test
122
+ Topic 2","updatedAt":"2014-05-15T07:49:56Z","description":null,"id":5148,"lastPostedAt":"2014-05-15T12:04:04Z","createdAt":"2014-05-15T07:45:57Z","suggestion":"Test
123
+ Topic 2"},"post":{"updatedAt":"2014-05-15T12:04:04Z","talks":[],"replyTo":null,"url":"https://typetalk.in/topics/5148/posts/279090","topicId":5148,"likes":[],"links":[],"id":279090,"mention":null,"createdAt":"2014-05-15T12:04:04Z","message":"Test
124
+ Message 2 - 7","account":{"name":"typetalk-rubygem-tester","updatedAt":"2014-05-15T00:36:03Z","fullName":"Rubygem
125
+ Tester","id":3865,"createdAt":"2014-05-14T09:09:44Z","suggestion":"Rubygem
126
+ Tester","imageUrl":"https://typetalk.in/accounts/3865/profile_image.png?t=1400114163838"},"attachments":[]},"replies":[]}'
127
+ http_version:
128
+ recorded_at: Thu, 15 May 2014 12:04:05 GMT
129
+ - request:
130
+ method: delete
131
+ uri: https://typetalk.in/api/v1/topics/5148/posts/279090?access_token=(ACCESS_TOKEN)
132
+ body:
133
+ encoding: US-ASCII
134
+ string: ''
135
+ headers:
136
+ Accept:
137
+ - application/json; charset=utf-8
138
+ User-Agent:
139
+ - Typetalk Rubygem 0.0.1
140
+ Accept-Encoding:
141
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
142
+ response:
143
+ status:
144
+ code: 200
145
+ message: OK
146
+ headers:
147
+ Server:
148
+ - nginx
149
+ Date:
150
+ - Thu, 15 May 2014 12:04:05 GMT
151
+ Content-Type:
152
+ - application/json; charset=utf-8
153
+ Content-Length:
154
+ - '2'
155
+ Connection:
156
+ - keep-alive
157
+ Cache-Control:
158
+ - no-cache
159
+ Etag:
160
+ - W/"9d4568c009d203ab10e33ea9953a0264"
161
+ Strict-Transport-Security:
162
+ - max-age=2592000
163
+ body:
164
+ encoding: UTF-8
165
+ string: '""'
166
+ http_version:
167
+ recorded_at: Thu, 15 May 2014 12:04:05 GMT
168
+ - request:
169
+ method: get
170
+ uri: https://typetalk.in/api/v1/topics/5148/posts/279090?access_token=(ACCESS_TOKEN)
171
+ body:
172
+ encoding: US-ASCII
173
+ string: ''
174
+ headers:
175
+ Accept:
176
+ - application/json; charset=utf-8
177
+ User-Agent:
178
+ - Typetalk Rubygem 0.0.1
179
+ Accept-Encoding:
180
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
181
+ response:
182
+ status:
183
+ code: 404
184
+ message: Not Found
185
+ headers:
186
+ Server:
187
+ - nginx
188
+ Date:
189
+ - Thu, 15 May 2014 12:04:06 GMT
190
+ Content-Length:
191
+ - '0'
192
+ Connection:
193
+ - keep-alive
194
+ body:
195
+ encoding: UTF-8
196
+ string: ''
197
+ http_version:
198
+ recorded_at: Thu, 15 May 2014 12:04:06 GMT
199
+ recorded_with: VCR 2.9.0
@@ -0,0 +1,71 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: post
5
+ uri: https://typetalk.in/oauth2/access_token
6
+ body:
7
+ encoding: UTF-8
8
+ string: client_id=(CLIENT_ID)&client_secret=(CLIENT_SECRET)&grant_type=client_credentials&scope=topic.read%2Ctopic.post%2Cmy
9
+ headers:
10
+ Accept:
11
+ - application/json; charset=utf-8
12
+ User-Agent:
13
+ - Typetalk Rubygem 0.0.1
14
+ Content-Type:
15
+ - application/x-www-form-urlencoded
16
+ Accept-Encoding:
17
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
18
+ response:
19
+ status:
20
+ code: 200
21
+ message: OK
22
+ headers:
23
+ Server:
24
+ - nginx
25
+ Date:
26
+ - Thu, 15 May 2014 11:58:32 GMT
27
+ Content-Type:
28
+ - application/json; charset=utf-8
29
+ Transfer-Encoding:
30
+ - chunked
31
+ Connection:
32
+ - keep-alive
33
+ Strict-Transport-Security:
34
+ - max-age=2592000
35
+ body:
36
+ encoding: UTF-8
37
+ string: '{"access_token":"(ACCESS_TOKEN)","expires_in":3600,"scope":"topic.read,topic.post,my","refresh_token":"(REFRESH_TOKEN)","token_type":"Bearer"}'
38
+ http_version:
39
+ recorded_at: Thu, 15 May 2014 11:58:32 GMT
40
+ - request:
41
+ method: delete
42
+ uri: https://typetalk.in/api/v1/topics/5148/posts/dummy?access_token=(ACCESS_TOKEN)
43
+ body:
44
+ encoding: US-ASCII
45
+ string: ''
46
+ headers:
47
+ Accept:
48
+ - application/json; charset=utf-8
49
+ User-Agent:
50
+ - Typetalk Rubygem 0.0.1
51
+ Accept-Encoding:
52
+ - gzip;q=1.0,deflate;q=0.6,identity;q=0.3
53
+ response:
54
+ status:
55
+ code: 400
56
+ message: Bad Request
57
+ headers:
58
+ Server:
59
+ - nginx
60
+ Date:
61
+ - Thu, 15 May 2014 11:58:33 GMT
62
+ Content-Length:
63
+ - '0'
64
+ Connection:
65
+ - keep-alive
66
+ body:
67
+ encoding: UTF-8
68
+ string: ''
69
+ http_version:
70
+ recorded_at: Thu, 15 May 2014 11:58:33 GMT
71
+ recorded_with: VCR 2.9.0