crisp-api 1.1.3 → 1.1.4
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/README.md +5 -1
- data/crisp-api.gemspec +1 -1
- data/lib/crisp-api.rb +7 -1
- data/lib/resources/website.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 53c7728a4e3a7dfd54454fda7525cdaf6ba0b6fa51e722b7a9c9d5d289dd0236
|
4
|
+
data.tar.gz: 8e35a4746ca4e8279b6cee485abd2a9a9411efae6a02358a7f5d6d17fd3905f0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 54a6816c31343e8edabf31b24653eaec00d97cefaea05863b9e30bec1a781452cdd90a9b4b57168f434fbdbfe2353d2a66f0a5951374d381bb079e5588af58ed
|
7
|
+
data.tar.gz: 2b7b0ce22ce1f4eeb5471e800735f70926e50909260606644badca667c1d678bb288f297fe3b3ef393882b23e7d37f18f96666bb13f69edf1e3a850c9cfefcbb
|
data/README.md
CHANGED
@@ -12,7 +12,7 @@ Copyright 2019 Crisp IM SARL. See LICENSE for copying information.
|
|
12
12
|
Add the library to your `Gemfile`:
|
13
13
|
|
14
14
|
```bash
|
15
|
-
gem "crisp-api", "~> 1.1.
|
15
|
+
gem "crisp-api", "~> 1.1.4"
|
16
16
|
```
|
17
17
|
|
18
18
|
Then, import it:
|
@@ -42,6 +42,10 @@ Then, add authentication parameters to your `client` instance right after you cr
|
|
42
42
|
```ruby
|
43
43
|
client = Crisp::Client.new
|
44
44
|
|
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
|
+
|
45
49
|
# Authenticate to API (identifier, key)
|
46
50
|
# eg. client.authenticate("5c0595b2-9381-4a76-a2e0-04aa00c1ede7", "3bdb0812d0f5352bf68901ddc731434dade419b98507971905acdd2f967df61c")
|
47
51
|
client.authenticate(identifier, key)
|
data/crisp-api.gemspec
CHANGED
data/lib/crisp-api.rb
CHANGED
@@ -22,6 +22,7 @@ module Crisp
|
|
22
22
|
|
23
23
|
def initialize()
|
24
24
|
@auth = {}
|
25
|
+
@tier = "user"
|
25
26
|
|
26
27
|
@bucket = Crisp::BucketResource.new(self)
|
27
28
|
@website = Crisp::WebsiteResource.new(self)
|
@@ -34,6 +35,10 @@ module Crisp
|
|
34
35
|
@auth["key"] = key
|
35
36
|
end
|
36
37
|
|
38
|
+
def set_tier(tier)
|
39
|
+
@tier = tier
|
40
|
+
end
|
41
|
+
|
37
42
|
def rest_host
|
38
43
|
@rest_host || "https://api.crisp.chat"
|
39
44
|
end
|
@@ -86,9 +91,10 @@ module Crisp
|
|
86
91
|
:payload => (data ? data.to_json : nil),
|
87
92
|
|
88
93
|
:headers => {
|
89
|
-
:user_agent => "ruby-crisp-api/1.1.
|
94
|
+
:user_agent => "ruby-crisp-api/1.1.4",
|
90
95
|
:accept => :json,
|
91
96
|
:content_type => :json,
|
97
|
+
"X-Crisp-Tier" => @tier,
|
92
98
|
:params => query
|
93
99
|
}
|
94
100
|
)
|
data/lib/resources/website.rb
CHANGED
@@ -99,7 +99,7 @@ module Crisp
|
|
99
99
|
return @parent.get(self._url_website(website_id, "/visitors/list/%d" % page_number))
|
100
100
|
end
|
101
101
|
|
102
|
-
def search_conversations(website_id, page_number =
|
102
|
+
def search_conversations(website_id, page_number = 1, 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 = "")
|
103
103
|
resource_url = ""
|
104
104
|
query_parameters = []
|
105
105
|
|
@@ -120,7 +120,7 @@ module Crisp
|
|
120
120
|
return @parent.get(resource_url)
|
121
121
|
end
|
122
122
|
|
123
|
-
def list_conversations(website_id, page_number =
|
123
|
+
def list_conversations(website_id, page_number = 1)
|
124
124
|
return self.search_conversations(website_id, page_number)
|
125
125
|
end
|
126
126
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: crisp-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Valerian Saliou
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|