zendesk_help_center_api 0.0.1 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +22 -5
- data/lib/zendesk_api/help_center.rb +0 -20
- metadata +12 -12
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ca7d3413375d112a0224327c5db52463278ca0b
|
4
|
+
data.tar.gz: 933e9a3114ca7362b22528404ae244b725633a95
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 32f5bb063e9feb8e5a5b30eab5930902e3d5ca625db4bd78940a9b7b85ba2999fdd44b64e033a026584a525029ae0c4346d10e2cef4a56a7c93f24e7ee2c7ae1
|
7
|
+
data.tar.gz: 51a54db71caca21ae82d579436b9bcd67a745908be23fa7619c321b892ab730ebde9c6bcb787699d527f5e3135d393d8ffed61f18db615191eb31760dd02d4b6
|
data/README.md
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
# Zendesk HelpCenter API Client
|
2
2
|
|
3
|
-
This gem added support for
|
3
|
+
This gem added support for [Zendesk Help Center](https://developer.zendesk.com/rest_api/docs/help_center/introduction) methods under [ZendeskAPI::Client](https://github.com/zendesk/zendesk_api_client_rb) gem.
|
4
4
|
|
5
5
|
To experiment with that code, run `bin/console` for an interactive prompt.
|
6
6
|
|
@@ -30,6 +30,15 @@ $ gem install zendesk_help_center_api
|
|
30
30
|
```ruby
|
31
31
|
require 'zendesk_api/help_center'
|
32
32
|
```
|
33
|
+
### Zendesk CLient
|
34
|
+
|
35
|
+
```ruby
|
36
|
+
client = ZendeskAPI::Client.new do |config|
|
37
|
+
config.url = "<- your-zendesk-url ->" # e.g. https://mydesk.zendesk.com/api/v2
|
38
|
+
config.username = "login.email@zendesk.com"
|
39
|
+
config.password = "your zendesk password"
|
40
|
+
end
|
41
|
+
```
|
33
42
|
|
34
43
|
### Help Center
|
35
44
|
|
@@ -56,23 +65,25 @@ category.update(name: 'This is a test')
|
|
56
65
|
```ruby
|
57
66
|
articles = section.articles
|
58
67
|
articles.build(title: 'Test Article')
|
59
|
-
category.update(
|
68
|
+
category.update(body: 'This is a test')
|
60
69
|
article.destroy
|
61
70
|
```
|
62
71
|
|
63
72
|
### Help Center Translations
|
64
73
|
|
74
|
+
Translations represent the content in all supported languages of a `Help Center` item such as an `article` or a `section`. The default language is also included in the translations.
|
75
|
+
|
65
76
|
```ruby
|
66
77
|
categories_tr = category.translations
|
67
|
-
category_tr = categories_tr.build(locale: 'uk',
|
78
|
+
category_tr = categories_tr.build(locale: 'uk', title: 'Тестова Стаття', body: '')
|
68
79
|
category_tr.save
|
69
80
|
|
70
81
|
sections_tr = sections.translations
|
71
|
-
section_tr = article_tr.build(locale: 'uk',
|
82
|
+
section_tr = article_tr.build(locale: 'uk', title: 'Це тест', body: '')
|
72
83
|
section_tr.save
|
73
84
|
|
74
85
|
articles_tr = article.translations
|
75
|
-
article_tr = article_translations.build(locale: 'uk', title: 'Тестова Стаття')
|
86
|
+
article_tr = article_translations.build(locale: 'uk', title: 'Тестова Стаття', body: '')
|
76
87
|
article_tr.save
|
77
88
|
```
|
78
89
|
|
@@ -89,3 +100,9 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
89
100
|
3. Commit your changes (`git commit -am 'Add some feature'`)
|
90
101
|
4. Push to the branch (`git push origin my-new-feature`)
|
91
102
|
5. Create a new Pull Request
|
103
|
+
|
104
|
+
## License and Author
|
105
|
+
|
106
|
+
Copyright: 2015-2017 [Anton Maminov](anton.maminov@gmail.com)
|
107
|
+
|
108
|
+
This project is licensed under the Apache License, a copy of which can be found in the LICENSE file.
|
@@ -44,19 +44,6 @@ module ZendeskAPI
|
|
44
44
|
super
|
45
45
|
end
|
46
46
|
|
47
|
-
# Categorues and sections have the mandatory keys 'name' and 'description'. But in translations used 'title' and 'body' keys.
|
48
|
-
# Here we replace this keys:
|
49
|
-
#
|
50
|
-
# More info:
|
51
|
-
# https://support.zendesk.com/hc/communities/public/posts/204262967-Error-when-creating-new-translation-for-the-section-via-Rest-API
|
52
|
-
#
|
53
|
-
def attributes_for_save
|
54
|
-
attributes[:title] ||= attributes.delete(:name)
|
55
|
-
attributes[:body] ||= attributes.delete(:description)
|
56
|
-
|
57
|
-
attributes
|
58
|
-
end
|
59
|
-
|
60
47
|
def destroy!
|
61
48
|
super do |req|
|
62
49
|
req.path = @client.config.url + "/help_center/translations/" + id.to_s
|
@@ -81,13 +68,6 @@ module ZendeskAPI
|
|
81
68
|
super
|
82
69
|
end
|
83
70
|
|
84
|
-
def attributes_for_save
|
85
|
-
attributes[:title] ||= attributes.delete(:name)
|
86
|
-
attributes[:body] ||= attributes.delete(:description)
|
87
|
-
|
88
|
-
attributes
|
89
|
-
end
|
90
|
-
|
91
71
|
def destroy!
|
92
72
|
super do |req|
|
93
73
|
req.path = @client.config.url + "/help_center/translations/" + id.to_s
|
metadata
CHANGED
@@ -1,27 +1,27 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zendesk_help_center_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 0.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Anton Maminov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2017-03-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: zendesk_api
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
@@ -30,40 +30,40 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: rake
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: byebug
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0'
|
69
69
|
description: Ruby wrapper for the REST API at http://www.zendesk.com. Documentation
|
@@ -78,7 +78,7 @@ files:
|
|
78
78
|
- lib/zendesk_api/help_center.rb
|
79
79
|
homepage: https://github.com/mamantoha/zendesk_help_center_api_client_rb
|
80
80
|
licenses:
|
81
|
-
- Apache
|
81
|
+
- Apache-2.0
|
82
82
|
metadata: {}
|
83
83
|
post_install_message:
|
84
84
|
rdoc_options: []
|
@@ -96,7 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
96
96
|
version: '0'
|
97
97
|
requirements: []
|
98
98
|
rubyforge_project:
|
99
|
-
rubygems_version: 2.
|
99
|
+
rubygems_version: 2.6.8
|
100
100
|
signing_key:
|
101
101
|
specification_version: 4
|
102
102
|
summary: Zendesk Help Center REST API Client
|