crisp-api 1.1.5 → 1.1.8

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.
data/README.md CHANGED
@@ -2,17 +2,19 @@
2
2
 
3
3
  The Crisp API Ruby wrapper. Authenticate, send messages, fetch conversations, access your agent accounts from your Ruby code.
4
4
 
5
- Copyright 2019 Crisp IM SARL. See LICENSE for copying information.
5
+ Copyright 2019 Crisp IM SAS. See LICENSE for copying information.
6
6
 
7
- * **📝 Implements**: [Crisp Platform - API ~ v1](https://docs.crisp.chat/api/v1/) at reference revision: 12/31/2017
7
+ * **📝 Implements**: [REST API Reference (V1)](https://docs.crisp.chat/references/rest-api/v1/) at revision: 12/31/2017
8
8
  * **😘 Maintainer**: [@valeriansaliou](https://github.com/valeriansaliou), [@eliottvincent](https://github.com/eliottvincent)
9
9
 
10
10
  ## Usage
11
11
 
12
+ You may follow the [REST API Quickstart](https://docs.crisp.chat/guides/rest-api/quickstart/) guide, which will get you running with the REST API in minutes.
13
+
12
14
  Add the library to your `Gemfile`:
13
15
 
14
16
  ```bash
15
- gem "crisp-api", "~> 1.1.5"
17
+ gem "crisp-api", "~> 1.1.8"
16
18
  ```
17
19
 
18
20
  Then, import it:
@@ -26,6 +28,7 @@ Build a new authenticated Crisp client with your `identifier` and `key` tokens.
26
28
  ```ruby
27
29
  client = Crisp::Client.new
28
30
 
31
+ client.set_tier("plugin")
29
32
  client.authenticate(identifier, key)
30
33
  ```
31
34
 
@@ -33,7 +36,7 @@ Then, your client is ready to be consumed!
33
36
 
34
37
  ## Authentication
35
38
 
36
- To authenticate against the API, generate your session identifier and session key **once** using the [Crisp token generation utility](https://go.crisp.chat/account/token/). You'll get a token keypair made of 2 values.
39
+ To authenticate against the API, obtain your authentication token keypair by following the [REST API Authentication](https://docs.crisp.chat/guides/rest-api/authentication/) guide. You'll get a token keypair made of 2 values.
37
40
 
38
41
  **Keep your token keypair values private, and store them safely for long-term use.**
39
42
 
@@ -42,24 +45,19 @@ Then, add authentication parameters to your `client` instance right after you cr
42
45
  ```ruby
43
46
  client = Crisp::Client.new
44
47
 
45
- # Make sure to use the correct tier if you are authenticating a plugin
46
- # eg. with a permanent token generated from Crisp Marketplace
47
- client.set_tier("plugin")
48
-
49
- # Authenticate to API (identifier, key)
48
+ # Authenticate to API with your plugin token (identifier, key)
50
49
  # eg. client.authenticate("5c0595b2-9381-4a76-a2e0-04aa00c1ede7", "3bdb0812d0f5352bf68901ddc731434dade419b98507971905acdd2f967df61c")
50
+ client.set_tier("plugin")
51
51
  client.authenticate(identifier, key)
52
52
 
53
53
  # Now, you can use authenticated API sections.
54
54
  ```
55
55
 
56
- **🔴 Important: Make sure to generate your token once, and use the same token keys in all your subsequent requests to the API. Do not generate too many tokens, as we may invalidate your older tokens to make room for newer tokens.**
57
-
58
56
  ## Resource Methods
59
57
 
60
- Most useful available Crisp API resources are implemented. **Programmatic methods names are named after their label name in the [API Reference](https://docs.crisp.chat/api/v1/)**.
58
+ Most useful available Crisp API resources are implemented. **Programmatic methods names are named after their label name in the [REST API Reference](https://docs.crisp.chat/references/rest-api/v1/)**.
61
59
 
62
- Thus, it is straightforward to look for them in the library while reading the [API Reference](https://docs.crisp.chat/api/v1/).
60
+ All methods that you will most likely need when building a Crisp integration are prefixed with a star symbol ().
63
61
 
64
62
  In the following method prototypes, `crisp` is to be replaced with your Crisp API instance. For example, instanciate `client = Crisp()` and then call eg: `client.website.list_conversations(website_id, 1)`.
65
63
 
@@ -74,89 +72,827 @@ client.website.send_message_in_conversation(
74
72
 
75
73
  {
76
74
  "type" => "text",
77
- "content" => "This message was sent from python-crisp-api! :)",
75
+ "content" => "This message was sent from ruby-crisp-api! :)",
78
76
  "from" => "operator",
79
77
  "origin" => "chat"
80
78
  }
81
79
  )
82
80
  ```
83
81
 
82
+ **⚠️ Note that, depending on your authentication token tier, which is either `user` or `plugin`, you may not be allowed to use all methods from the library. When in doubt, refer to the library method descriptions below. Most likely, you are using a `plugin` token.**
83
+
84
84
  ### Website
85
85
 
86
86
  * **Website Conversations**
87
- * **List Conversations**: `client.website.list_conversations(website_id, page_number)`
88
- * **Search Conversations**: `client.website.search_conversations(website_id, page_number, search_query, search_type, search_operator, include_empty, filter_unread, filter_resolved, filter_not_resolved, filter_mention, filter_assigned, filter_unassigned, filter_date_start, filter_date_end, order_date_created", order_date_updated)`
87
+ * **List Conversations** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#list-conversations)
88
+ * `client.website.list_conversations(website_id, page_number)`
89
+ * <details>
90
+ <summary>See Example</summary>
91
+
92
+ ```ruby
93
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
94
+ page_number = 1
95
+
96
+ client.website.list_conversations(website_id, page_number);
97
+ ```
98
+ </details>
99
+
100
+ * **Search Conversations** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#list-conversations)
101
+ * `client.website.search_conversations(website_id, page_number, search_query, search_type, search_operator, include_empty, filter_unread, filter_resolved, filter_not_resolved, filter_mention, filter_assigned, filter_unassigned, filter_date_start, filter_date_end, order_date_created", order_date_updated)`
102
+ * <details>
103
+ <summary>See Example</summary>
104
+
105
+ ```ruby
106
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
107
+ page_number = 1
108
+
109
+ client.website.list_conversations(website_id, page_number);
110
+ ```
111
+ </details>
112
+
89
113
 
90
114
  * **Website Conversation**
91
- * **Create A New Conversation**: `client.website.create_new_conversation(website_id)`
92
- * **Check If Conversation Exists**: `client.website.check_conversation_exists(website_id, session_id)`
93
- * **Get A Conversation**: `client.website.get_conversation(website_id, session_id)`
94
- * **Remove A Conversation**: `client.website.remove_conversation(website_id, session_id)`
95
- * **Initiate A Conversation With Existing Session**: `client.website.initiate_conversation_with_existing_session(website_id, session_id)`
96
- * **Get Messages In Conversation**: `client.website.get_messages_in_conversation(website_id, session_id, query)`
97
- * **Send A Message In Conversation**: `client.website.send_message_in_conversation(website_id, session_id, query)`
98
- * **Update A Message In Conversation**: `client.website.update_message_in_conversation(website_id, session_id, fingerprint, data)`
99
- * **Compose A Message In Conversation**: `client.website.compose_message_in_conversation(website_id, session_id, data)`
100
- * **Mark Messages As Read In Conversation**: `client.website.mark_messages_read_in_conversation(website_id, session_id, data)`
101
- * **Mark Messages As Delivered In Conversation**: `client.website.mark_messages_delivered_in_conversation(website_id, session_id, data)`
102
- * **Get Conversation Routing Assign**: `client.website.get_conversation_routing_assign(website_id, session_id)`
103
- * **Assign Conversation Routing**: `client.website.assign_conversation_routing(website_id, session_id, data)`
104
- * **Get Conversation Metas**: `client.website.get_conversation_metas(website_id, session_id)`
105
- * **Update Conversation Metas**: `client.website.update_conversation_metas(website_id, session_id, data)`
106
- * **List Conversation Pages**: `client.website.list_conversation_pages(website_id, session_id, page_number)`
107
- * **List Conversation Events**: `client.website.list_conversation_events(website_id, session_id, page_number)`
108
- * **Get Conversation State**: `client.website.get_conversation_state(website_id, session_id)`
109
- * **Change Conversation State**: `client.website.change_conversation_state(website_id, session_id, data)`
110
- * **Get Block Status For Conversation**: `client.website.get_block_status_for_conversation(website_id, session_id)`
111
- * **Block Incoming Messages For Conversation**: `client.website.block_incoming_messages_for_conversation(website_id, session_id, data)`
112
- * **Request Email Transcript For Conversation**: `client.website.request_email_transcript_for_conversation(website_id, session_id, data)`
113
-
114
- * **Website People**
115
- * **Get People Statistics**: `client.website.get_people_statistics(website_id)`
116
- * **List People Segments**: `client.website.list_people_segments(website_id, page_number)`
117
- * **List People Profiles**: `client.website.list_people_profiles(website_id, page_number)`
118
- * **Add New People Profile**: `client.website.add_new_people_profile(website_id, data)`
119
- * **Check If People Profile Exists**: `client.website.check_people_profile_exists(website_id, people_id)`
120
- * **Get People Profile**: `client.website.get_people_profile(website_id, people_id)`
121
- * **Save People Profile**: `client.website.save_people_profile(website_id, people_id, data)`
122
- * **Find People Profile By Email**: `client.website.find_people_profile_by_email(website_id, email)`
123
- * **Update People Profile**: `client.website.update_people_profile(website_id, people_id, data)`
124
- * **Remove People Profile**: `client.website.remove_people_profile(website_id, people_id)`
125
- * **List People Conversations**: `client.website.list_people_conversations(website_id, people_id, page_number)`
126
- + **Add A People Event**: `client.website.add_people_event(website_id, people_id, data)`
127
- + **List People Events**: `client.website.list_people_events(website_id, people_id, page_number)`
128
- + **Get People Data**: `client.website.get_people_data(website_id, people_id)`
129
- + **Save People Data**: `client.website.save_people_data(website_id, people_id, data)`
130
- + **Get People Subscription Status**: `client.website.get_people_subscription_status(website_id, people_id)`
131
- + **Update People Subscription Status**: `client.website.update_people_subscription_status(website_id, people_id, data)`
115
+ * **Create A New Conversation** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#create-a-new-conversation)
116
+ * `client.website.create_new_conversation(website_id)`
117
+ * <details>
118
+ <summary>See Example</summary>
119
+
120
+ ```ruby
121
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
122
+
123
+ client.website.create_new_conversation(website_id);
124
+ ```
125
+ </details>
126
+
127
+ * **Check If Conversation Exists** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#check-if-conversation-exists)
128
+ * `client.website.check_conversation_exists(website_id, session_id)`
129
+ * <details>
130
+ <summary>See Example</summary>
131
+
132
+ ```ruby
133
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
134
+ session_id = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
135
+
136
+ client.website.check_conversation_exists(website_id, session_id);
137
+ ```
138
+ </details>
139
+
140
+ * **Get A Conversation** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#get-a-conversation)
141
+ * `client.website.get_conversation(website_id, session_id)`
142
+ * <details>
143
+ <summary>See Example</summary>
144
+
145
+ ```ruby
146
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
147
+ session_id = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
148
+
149
+ client.website.get_conversation(website_id, session_id);
150
+ ```
151
+ </details>
152
+
153
+ * **Remove A Conversation** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#remove-a-conversation)
154
+ * `client.website.remove_conversation(website_id, session_id)`
155
+ * <details>
156
+ <summary>See Example</summary>
157
+
158
+ ```ruby
159
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
160
+ session_id = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
161
+
162
+ client.website.remove_conversation(website_id, session_id);
163
+ ```
164
+ </details>
165
+
166
+ * **Initiate A Conversation With Existing Session** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#initiate-a-conversation-with-existing-session)
167
+ * `client.website.initiate_conversation_with_existing_session(website_id, session_id)`
168
+ * <details>
169
+ <summary>See Example</summary>
170
+
171
+ ```ruby
172
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
173
+ session_id = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
174
+
175
+ client.website.initiate_conversation_with_existing_session(website_id, session_id);
176
+ ```
177
+ </details>
178
+
179
+ * ⭐ **Get Messages In Conversation** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#get-messages-in-conversation)
180
+ * `client.website.get_messages_in_conversation(website_id, session_id, query)`
181
+ * <details>
182
+ <summary>See Example</summary>
183
+
184
+ ```ruby
185
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
186
+ session_id = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
187
+
188
+ client.website.get_messages_in_conversation(website_id, session_id, query);
189
+ ```
190
+ </details>
191
+
192
+ * ⭐ **Send A Message In Conversation** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#send-a-message-in-conversation)
193
+ * `client.website.send_message_in_conversation(website_id, session_id, query)`
194
+ * <details>
195
+ <summary>See Example</summary>
196
+
197
+ ```ruby
198
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
199
+ session_id = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
200
+
201
+ query = [
202
+ "type" => "text",
203
+ "from" => "operator",
204
+ "origin" => "chat",
205
+ "content" => "Hey there! Need help?"
206
+ ]
207
+
208
+ client.website.send_message_in_conversation(website_id, session_id, query);
209
+ ```
210
+ </details>
211
+
212
+ * **Update A Message In Conversation** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#update-a-message-in-conversation)
213
+ * `client.website.update_message_in_conversation(website_id, session_id, fingerprint, data)`
214
+ * <details>
215
+ <summary>See Example</summary>
216
+
217
+ ```ruby
218
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
219
+ session_id = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
220
+ fingerprint = 524653764345
221
+
222
+ data = "Hey there! Need help?"
223
+
224
+ client.website.update_message_in_conversation(website_id, session_id, fingerprint, data);
225
+ ```
226
+ </details>
227
+
228
+ * **Compose A Message In Conversation** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#compose-a-message-in-conversation)
229
+ * `client.website.compose_message_in_conversation(website_id, session_id, data)`
230
+ * <details>
231
+ <summary>See Example</summary>
232
+
233
+ ```ruby
234
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
235
+ session_id = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
236
+
237
+ data = [
238
+ "type" => "start",
239
+ "from" => "operator"
240
+ ]
241
+
242
+ client.website.compose_message_in_conversation(website_id, session_id, data);
243
+ ```
244
+ </details>
245
+
246
+ * ⭐ **Mark Messages As Read In Conversation** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#mark-messages-as-read-in-conversation)
247
+ * `client.website.mark_messages_read_in_conversation(website_id, session_id, data)`
248
+ * <details>
249
+ <summary>See Example</summary>
250
+
251
+ ```ruby
252
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
253
+ session_id = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
254
+
255
+ data = [
256
+ "from" => "operator",
257
+ "origin" => "urn:crisp.im:slack:0",
258
+ "fingerprints" => [
259
+ "5719231201"
260
+ ]
261
+ ]
262
+
263
+ client.website.mark_messages_read_in_conversation(website_id, session_id, data);
264
+ ```
265
+ </details>
266
+
267
+ * ⭐ **Mark Messages As Delivered In Conversation** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#mark-messages-as-delivered-in-conversation)
268
+ * `client.website.mark_messages_delivered_in_conversation(website_id, session_id, data)`
269
+ * <details>
270
+ <summary>See Example</summary>
271
+
272
+ ```ruby
273
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
274
+ session_id = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
275
+
276
+ data = [
277
+ "from" => "operator",
278
+ "origin" => "urn:crisp.im:slack:0",
279
+ "fingerprints" => [
280
+ "5719231201"
281
+ ]
282
+ ]
283
+
284
+ client.website.mark_messages_delivered_in_conversation(website_id, session_id, data);
285
+ ```
286
+ </details>
287
+
288
+ * ⭐ **Get Conversation Routing Assign** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#get-conversation-routing-assign)
289
+ * `client.website.get_conversation_routing_assign(website_id, session_id)`
290
+ * <details>
291
+ <summary>See Example</summary>
292
+
293
+ ```ruby
294
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
295
+ session_id = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
296
+
297
+ client.website.get_conversation_routing_assign(website_id, session_id);
298
+ ```
299
+ </details>
300
+
301
+ * ⭐ **Assign Conversation Routing** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#assign-conversation-routing)
302
+ * `client.website.assign_conversation_routing(website_id, session_id, data)`
303
+ * <details>
304
+ <summary>See Example</summary>
305
+
306
+ ```ruby
307
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
308
+ session_id = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
309
+
310
+ data = [
311
+ "assigned" => [
312
+ "user_id" => "a4c32c68-be91-4e29-8a05-976e93abbe3f"
313
+ ]
314
+ ]
315
+
316
+ client.website.assign_conversation_routing(website_id, session_id, data);
317
+ ```
318
+ </details>
319
+
320
+ * ⭐ **Get Conversation Metas** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#get-conversation-metas)
321
+ * `client.website.get_conversation_metas(website_id, session_id)`
322
+ * <details>
323
+ <summary>See Example</summary>
324
+
325
+ ```ruby
326
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
327
+ session_id = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
328
+
329
+ client.website.get_conversation_metas(website_id, session_id);
330
+ ```
331
+ </details>
332
+
333
+ * ⭐ **Update Conversation Metas** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#update-conversation-metas)
334
+ * `client.website.update_conversation_metas(website_id, session_id, data)`
335
+ * <details>
336
+ <summary>See Example</summary>
337
+
338
+ ```ruby
339
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
340
+ session_id = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
341
+
342
+ data = [
343
+ "nickname" => "John Doe",
344
+ "email" => "john.doe@acme-inc.com",
345
+ "segments" => [
346
+ "happy",
347
+ "customer",
348
+ "love"
349
+ ],
350
+ "data" => [
351
+ "type" => "customer",
352
+ "signup" => "finished"
353
+ ]
354
+ ]
355
+
356
+ client.website.update_conversation_metas(website_id, session_id, data);
357
+ ```
358
+ </details>
359
+
360
+ * **List Conversation Pages** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#list-conversation-pages)
361
+ * `client.website.list_conversation_pages(website_id, session_id, page_number)`
362
+ * <details>
363
+ <summary>See Example</summary>
364
+
365
+ ```ruby
366
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
367
+ session_id = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
368
+ page_number = 1
369
+
370
+ client.website.list_conversation_pages(website_id, session_id, page_number);
371
+ ```
372
+ </details>
373
+
374
+ * **List Conversation Events** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#list-conversation-events)
375
+ * `client.website.list_conversation_events(website_id, session_id, page_number)`
376
+ * <details>
377
+ <summary>See Example</summary>
378
+
379
+ ```ruby
380
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
381
+ session_id = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
382
+ page_number = 1
383
+
384
+ client.website.list_conversation_events(website_id, session_id, page_number);
385
+ ```
386
+ </details>
387
+
388
+ * **Get Conversation State** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#get-conversation-state)
389
+ * `client.website.get_conversation_state(website_id, session_id)`
390
+ * <details>
391
+ <summary>See Example</summary>
392
+
393
+ ```ruby
394
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
395
+ session_id = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
396
+
397
+ client.website.get_conversation_state(website_id, session_id);
398
+ ```
399
+ </details>
400
+
401
+ * ⭐ **Change Conversation State** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#change-conversation-state)
402
+ * `client.website.change_conversation_state(website_id, session_id, data)`
403
+ * <details>
404
+ <summary>See Example</summary>
405
+
406
+ ```ruby
407
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
408
+ session_id = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
409
+
410
+ data = "unresolved"
411
+
412
+ client.website.change_conversation_state(website_id, session_id, data);
413
+ ```
414
+ </details>
415
+
416
+ * **Get Block Status For Conversation** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#get-block-status-for-conversation)
417
+ * `client.website.get_block_status_for_conversation(website_id, session_id)`
418
+ * <details>
419
+ <summary>See Example</summary>
420
+
421
+ ```ruby
422
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
423
+ session_id = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
424
+
425
+ client.website.get_block_status_for_conversation(website_id, session_id);
426
+ ```
427
+ </details>
428
+
429
+ * **Block Incoming Messages For Conversation** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#block-incoming-messages-for-conversation)
430
+ * `client.website.block_incoming_messages_for_conversation(website_id, session_id, data)`
431
+ * <details>
432
+ <summary>See Example</summary>
433
+
434
+ ```ruby
435
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
436
+ session_id = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
437
+
438
+ data = true
439
+
440
+ client.website.block_incoming_messages_for_conversation(website_id, session_id, data);
441
+ ```
442
+ </details>
443
+
444
+ * **Request Email Transcript For Conversation** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#request-email-transcript-for-conversation)
445
+ * `client.website.request_email_transcript_for_conversation(website_id, session_id, data)`
446
+ * <details>
447
+ <summary>See Example</summary>
448
+
449
+ ```ruby
450
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
451
+ session_id = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
452
+
453
+ data = [
454
+ "to" => "operator",
455
+ "email" => "valerian@crisp.chat"
456
+ ]
457
+
458
+ client.website.request_email_transcript_for_conversation(website_id, session_id, data);
459
+ ```
460
+ </details>
461
+
462
+
463
+ * **Website People** _(these are your end-users)_
464
+ * **Get People Statistics** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#get-people-statistics)
465
+ * `client.website.get_people_statistics(website_id)`
466
+ * <details>
467
+ <summary>See Example</summary>
468
+
469
+ ```ruby
470
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
471
+
472
+ client.website.get_people_statistics(website_id);
473
+ ```
474
+ </details>
475
+
476
+ * **List People Segments** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#list-suggested-people-segments)
477
+ * `client.website.list_people_segments(website_id, page_number)`
478
+ * <details>
479
+ <summary>See Example</summary>
480
+
481
+ ```ruby
482
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
483
+ page_number = 1
484
+
485
+ client.website.list_people_segments(website_id, page_number);
486
+ ```
487
+ </details>
488
+
489
+ * ⭐ **List People Profiles** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#list-people-profiles)
490
+ * `client.website.list_people_profiles(website_id, page_number)`
491
+ * <details>
492
+ <summary>See Example</summary>
493
+
494
+ ```ruby
495
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
496
+ page_number = 1
497
+
498
+ client.website.list_people_profiles(website_id, page_number);
499
+ ```
500
+ </details>
501
+
502
+ * ⭐ **Add New People Profile** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#add-new-people-profile)
503
+ * `client.website.add_new_people_profile(website_id, data)`
504
+ * <details>
505
+ <summary>See Example</summary>
506
+
507
+ ```ruby
508
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
509
+
510
+ data = [
511
+ "email" => "valerian@crisp.chat",
512
+ "person" => [
513
+ "nickname" => "Valerian Saliou"
514
+ ]
515
+ ]
516
+
517
+ client.website.add_new_people_profile(website_id, data);
518
+ ```
519
+ </details>
520
+
521
+ * ⭐ **Check If People Profile Exists** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#check-if-people-profile-exists)
522
+ * `client.website.check_people_profile_exists(website_id, people_id)`
523
+ * <details>
524
+ <summary>See Example</summary>
525
+
526
+ ```ruby
527
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
528
+ people_id = "c5a2f70c-f605-4648-b47f-8c39d4b03a50"
529
+
530
+ client.website.check_people_profile_exists(website_id, people_id);
531
+ ```
532
+ </details>
533
+
534
+ * ⭐ **Get People Profile** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#get-people-profile)
535
+ * `client.website.get_people_profile(website_id, people_id)`
536
+ * <details>
537
+ <summary>See Example</summary>
538
+
539
+ ```ruby
540
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
541
+ people_id = "c5a2f70c-f605-4648-b47f-8c39d4b03a50"
542
+
543
+ client.website.get_people_profile(website_id, people_id);
544
+ ```
545
+ </details>
546
+
547
+ * ⭐ **Save People Profile** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#save-people-profile)
548
+ * `client.website.save_people_profile(website_id, people_id, data)`
549
+ * <details>
550
+ <summary>See Example</summary>
551
+
552
+ ```ruby
553
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
554
+ people_id = "c5a2f70c-f605-4648-b47f-8c39d4b03a50"
555
+
556
+ data = [
557
+ "email" => "valerian@crisp.chat",
558
+ "person" => [
559
+ "nickname" => "Valerian Saliou"
560
+ ]
561
+ ]
562
+
563
+ client.website.save_people_profile(website_id, people_id, data);
564
+ ```
565
+ </details>
566
+
567
+ * **Find People Profile By Email** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#get-people-profile)
568
+ * `client.website.find_people_profile_by_email(website_id, email)`
569
+ * <details>
570
+ <summary>See Example</summary>
571
+
572
+ ```ruby
573
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
574
+ people_id = "c5a2f70c-f605-4648-b47f-8c39d4b03a50"
575
+
576
+ client.website.get_people_profile(website_id, people_id);
577
+ ```
578
+ </details>
579
+
580
+ * ⭐ **Update People Profile** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#update-people-profile)
581
+ * `client.website.update_people_profile(website_id, people_id, data)`
582
+ * <details>
583
+ <summary>See Example</summary>
584
+
585
+ ```ruby
586
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
587
+ people_id = "c5a2f70c-f605-4648-b47f-8c39d4b03a50"
588
+
589
+ data = [
590
+ "email" => "valerian@crisp.chat",
591
+ "person" => [
592
+ "nickname" => "Valerian Saliou"
593
+ ]
594
+ ]
595
+
596
+ client.website.update_people_profile(website_id, people_id, data);
597
+ ```
598
+ </details>
599
+
600
+ * ⭐ **Remove People Profile** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#remove-people-profile)
601
+ * `client.website.remove_people_profile(website_id, people_id)`
602
+ * <details>
603
+ <summary>See Example</summary>
604
+
605
+ ```ruby
606
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
607
+ people_id = "c5a2f70c-f605-4648-b47f-8c39d4b03a50"
608
+
609
+ client.website.remove_people_profile(website_id, people_id);
610
+ ```
611
+ </details>
612
+
613
+ * **List People Conversations** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#list-people-conversations)
614
+ * `client.website.list_people_conversations(website_id, people_id, page_number)`
615
+ * <details>
616
+ <summary>See Example</summary>
617
+
618
+ ```ruby
619
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
620
+ people_id = "c5a2f70c-f605-4648-b47f-8c39d4b03a50"
621
+ page_number = 1
622
+
623
+ client.website.list_people_conversations(website_id, people_id, page_number);
624
+ ```
625
+ </details>
626
+
627
+ + **Add A People Event** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#add-a-people-event)
628
+ * `client.website.add_people_event(website_id, people_id, data)`
629
+ + **List People Events** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#list-people-events)
630
+ * `client.website.list_people_events(website_id, people_id, page_number)`
631
+ + **Get People Data** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#get-people-data)
632
+ * `client.website.get_people_data(website_id, people_id)`
633
+ + **Save People Data** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#save-people-data)
634
+ * `client.website.save_people_data(website_id, people_id, data)`
635
+ + **Update People Data** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#update-people-data)
636
+ * `client.website.update_people_data(website_id, people_id, data)`
637
+ + **Get People Subscription Status** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#get-people-subscription-status)
638
+ * `client.website.get_people_subscription_status(website_id, people_id)`
639
+ + **Update People Subscription Status** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#update-people-subscription-status)
640
+ * `client.website.update_people_subscription_status(website_id, people_id, data)`
641
+
642
+ _👉 Notice: The `peopleID` argument can be an email or the `peopleID`._
132
643
 
133
644
  * **Website Base**
134
- * **Create Website**: `client.website.create_website(data)`
135
- * **Get A Website**: `client.website.get_website(website_id)`
136
- * **Delete A Website**: `client.website.delete_website(website_id)`
645
+ * **Create Website** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#create-website)
646
+ * `client.website.create_website(data)`
647
+ * <details>
648
+ <summary>See Example</summary>
649
+
650
+ ```ruby
651
+ client.website.create_website(data);
652
+ ```
653
+ </details>
654
+
655
+ * **Get A Website** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#get-a-website)
656
+ * `client.website.get_website(website_id)`
657
+ * <details>
658
+ <summary>See Example</summary>
659
+
660
+ ```ruby
661
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
662
+
663
+ client.website.get_website(website_id);
664
+ ```
665
+ </details>
666
+
667
+ * **Delete A Website** [`user`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#delete-a-website)
668
+ * `client.website.delete_website(website_id)`
669
+ * <details>
670
+ <summary>See Example</summary>
671
+
672
+ ```ruby
673
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
674
+
675
+ client.website.delete_website(website_id);
676
+ ```
677
+ </details>
678
+
137
679
 
138
680
  * **Website Batch**
139
- * **Batch Resolve Items**: `client.website.batch_resolve_items(website_id, data)`
140
- * **Batch Read Items**: `client.website.batch_read_items(website_id, data)`
141
- * **Batch Remove Items**: `client.website.batch_remove_items(website_id, data)`
681
+ * **Batch Resolve Items** [`user`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#batch-resolve-items)
682
+ * `client.website.batch_resolve_items(website_id, data)`
683
+ * <details>
684
+ <summary>See Example</summary>
685
+
686
+ ```ruby
687
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
688
+
689
+ client.website.batch_resolve_items(website_id, data);
690
+ ```
691
+ </details>
692
+
693
+ * **Batch Read Items** [`user`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#batch-read-items)
694
+ * `client.website.batch_read_items(website_id, data)`
695
+ * <details>
696
+ <summary>See Example</summary>
697
+
698
+ ```ruby
699
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
700
+
701
+ client.website.batch_read_items(website_id, data);
702
+ ```
703
+ </details>
704
+
705
+ * **Batch Remove Items** [`user`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#batch-remove-items)
706
+ * `client.website.batch_remove_items(website_id, data)`
707
+ * <details>
708
+ <summary>See Example</summary>
709
+
710
+ ```ruby
711
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
712
+
713
+ data = [
714
+ "session_19e5240f-0a8d-461e-a661-a3123fc6eec9",
715
+ "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
716
+ ]
717
+
718
+ client.website.batch_remove_items(website_id, data);
719
+ ```
720
+ </details>
721
+
142
722
 
143
723
  * **Website Availability**
144
- * **Get Website Availability Status**: `client.website.get_website_availability_status(website_id)`
724
+ * **Get Website Availability Status** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#get-website-availability-status)
725
+ * `client.website.get_website_availability_status(website_id)`
726
+ * <details>
727
+ <summary>See Example</summary>
728
+
729
+ ```ruby
730
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
731
+
732
+ client.website.get_website_availability_status(website_id);
733
+ ```
734
+ </details>
735
+
145
736
 
146
737
  * **Website Operator**
147
- * **List Website Operators**: `client.website.list_website_operators(website_id)`
148
- * **List Last Active Website Operators**: `client.website.list_last_active_website_operators(website_id)`
738
+ * **List Website Operators** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#list-website-operators)
739
+ * `client.website.list_website_operators(website_id)`
740
+ * <details>
741
+ <summary>See Example</summary>
742
+
743
+ ```ruby
744
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
745
+
746
+ client.website.list_website_operators(website_id);
747
+ ```
748
+ </details>
749
+
750
+ * **List Last Active Website Operators** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#list-last-active-website-operators)
751
+ * `client.website.list_last_active_website_operators(website_id)`
752
+ * <details>
753
+ <summary>See Example</summary>
754
+
755
+ ```ruby
756
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
757
+
758
+ client.website.list_last_active_website_operators(website_id);
759
+ ```
760
+ </details>
761
+
149
762
 
150
763
  * **Website Settings**
151
- * **Get Website Settings**: `client.website.get_website_settings(website_id)`
152
- * **Update Website Settings**: `client.website.update_website_settings(website_id, data)`
764
+ * **Get Website Settings** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#get-website-settings)
765
+ * `client.website.get_website_settings(website_id)`
766
+ * <details>
767
+ <summary>See Example</summary>
768
+
769
+ ```ruby
770
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
771
+
772
+ client.website.get_website_settings(website_id);
773
+ ```
774
+ </details>
775
+
776
+ * **Update Website Settings** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#update-website-settings)
777
+ * `client.website.update_website_settings(website_id, data)`
778
+ * <details>
779
+ <summary>See Example</summary>
780
+
781
+ ```ruby
782
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
783
+
784
+ data = [
785
+ "name" => "Crisp",
786
+ "domain" => "crisp.chat",
787
+ "logo" => "https://storage.crisp.chat/users/avatar/website/8c842203-7ed8-4e29-a608-7cf78a7d2fcc/b6c2948d-b061-405e-91a9-2fdf855d1cc0.png",
788
+ "contact" => [
789
+ "email" => "contact@crisp.chat",
790
+ "phone" => "+33757905447"
791
+ ],
792
+ "inbox" => [
793
+ "lock_removal" => false,
794
+ "force_operator_token" => false
795
+ ],
796
+ "emails" => [
797
+ "rating" => true,
798
+ "transcript" => true,
799
+ "enrich" => true,
800
+ "junk_filter" => true
801
+ ],
802
+ "chatbox" => [
803
+ "tile" => "default",
804
+ "wait_game" => false,
805
+ "last_operator_face" => false,
806
+ "ongoing_operator_face" => true,
807
+ "activity_metrics" => true,
808
+ "operator_privacy" => false,
809
+ "availability_tooltip" => true,
810
+ "hide_vacation" => false,
811
+ "hide_on_away" => false,
812
+ "hide_on_mobile" => false,
813
+ "position_reverse" => false,
814
+ "email_visitors" => false,
815
+ "phone_visitors" => false,
816
+ "force_identify" => false,
817
+ "ignore_privacy" => false,
818
+ "visitor_compose" => false,
819
+ "file_transfer" => true,
820
+ "helpdesk_link" => true,
821
+ "status_health_dead" => true,
822
+ "check_domain" => false,
823
+ "color_theme" => "blue",
824
+ "text_theme" => "default",
825
+ "welcome_message" => "default",
826
+ "locale" => "en",
827
+ "allowed_pages" => [],
828
+ "blocked_pages" => [
829
+ "status/*/",
830
+ "docs.crisp.chat/*",
831
+ "crisp.chat/terms/",
832
+ "https://crisp.chat/privacy/"
833
+ ],
834
+ "blocked_countries" => [
835
+ "IT"
836
+ ],
837
+ "blocked_locales" => [
838
+ "fa",
839
+ "he"
840
+ ],
841
+ "blocked_ips" => [
842
+ "8.8.8.8",
843
+ "2001:0db8:85a3:0000:0000:8a2e:0370:7334",
844
+ "192.168.1.1/24"
845
+ ]
846
+ ]
847
+ ]
848
+
849
+ client.website.update_website_settings(website_id, data);
850
+ ```
851
+ </details>
852
+
153
853
 
154
854
  * **Website Visitors**
155
- * **Count Visitors**: `client.website.count_visitors(website_id)`
156
- * **List Visitors**: `client.website.list_visitors(website_id, page_number)`
157
- * **Get Session ID**: `client.website.get_session_id_by_token(website_id, token)`
855
+ * **Count Visitors** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#count-visitors)
856
+ * `client.website.count_visitors(website_id)`
857
+ * <details>
858
+ <summary>See Example</summary>
859
+
860
+ ```ruby
861
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
862
+
863
+ client.website.count_visitors(website_id);
864
+ ```
865
+ </details>
866
+
867
+ * **List Visitors** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#list-visitors)
868
+ * `client.website.list_visitors(website_id, page_number)`
869
+ * <details>
870
+ <summary>See Example</summary>
871
+
872
+ ```ruby
873
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
874
+ page_number = 1
875
+
876
+ client.website.list_visitors(website_id, page_number);
877
+ ```
878
+ </details>
879
+
880
+ * **Get Session ID** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#get-session-identifier-from-token)
881
+ * `client.website.get_session_id_by_token(website_id, token)`
882
+ * <details>
883
+ <summary>See Example</summary>
884
+
885
+ ```ruby
886
+ session_id = "session_700c65e1-85e2-465a-b9ac-ecb5ec2c9881"
887
+ website_id = "8c842203-7ed8-4e29-a608-7cf78a7d2fcc"
888
+
889
+ client.website.get_session_id_by_token(website_id, token);
890
+ ```
891
+ </details>
892
+
158
893
 
159
894
  ### Bucket
160
895
 
161
896
  * **Bucket URL**
162
- * **Generate Bucket URL**: `client.bucket.generate_bucket_url(data)`
897
+ * **Generate Bucket URL** [`user`, `plugin`]: [Reference](https://docs.crisp.chat/references/rest-api/v1/#generate-bucket-url)
898
+ * `client.bucket.generate_bucket_url(data)`