webex_api 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.travis.yml +4 -0
- data/CODE_OF_CONDUCT.md +49 -0
- data/Gemfile +4 -0
- data/LICENSE.txt +21 -0
- data/README.md +83 -0
- data/Rakefile +10 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/lib/webex_api/client.rb +61 -0
- data/lib/webex_api/meeting.rb +92 -0
- data/lib/webex_api/meeting_request.rb +135 -0
- data/lib/webex_api/request.rb +51 -0
- data/lib/webex_api/version.rb +3 -0
- data/lib/webex_api/webex_error.rb +13 -0
- data/lib/webex_api.rb +14 -0
- data/webex_api.gemspec +30 -0
- metadata +117 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: da76bd8e6b71525c2e4b203135730fbbfaf5cd49
|
4
|
+
data.tar.gz: 6c05641b964297cf527d39770e21c3b96de79f8e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f27ff6a8a61e5838c5b6ff233f6dcebb32dd51686e0a246a4cd8e2bc5d75ca3e7ab2422ce680c220dd88dc86bae5e8769033b44896457dd3a2661bbf9a1c87ca
|
7
|
+
data.tar.gz: 6420ad90da05bf4de689960f86de63fcb8dd8d2ca276139f0b8b69abc937efb62d9338895999db2393486c3a5bfdaadf2430478a09d6b01173bc5b300353f941
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/CODE_OF_CONDUCT.md
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
# Contributor Code of Conduct
|
2
|
+
|
3
|
+
As contributors and maintainers of this project, and in the interest of
|
4
|
+
fostering an open and welcoming community, we pledge to respect all people who
|
5
|
+
contribute through reporting issues, posting feature requests, updating
|
6
|
+
documentation, submitting pull requests or patches, and other activities.
|
7
|
+
|
8
|
+
We are committed to making participation in this project a harassment-free
|
9
|
+
experience for everyone, regardless of level of experience, gender, gender
|
10
|
+
identity and expression, sexual orientation, disability, personal appearance,
|
11
|
+
body size, race, ethnicity, age, religion, or nationality.
|
12
|
+
|
13
|
+
Examples of unacceptable behavior by participants include:
|
14
|
+
|
15
|
+
* The use of sexualized language or imagery
|
16
|
+
* Personal attacks
|
17
|
+
* Trolling or insulting/derogatory comments
|
18
|
+
* Public or private harassment
|
19
|
+
* Publishing other's private information, such as physical or electronic
|
20
|
+
addresses, without explicit permission
|
21
|
+
* Other unethical or unprofessional conduct
|
22
|
+
|
23
|
+
Project maintainers have the right and responsibility to remove, edit, or
|
24
|
+
reject comments, commits, code, wiki edits, issues, and other contributions
|
25
|
+
that are not aligned to this Code of Conduct, or to ban temporarily or
|
26
|
+
permanently any contributor for other behaviors that they deem inappropriate,
|
27
|
+
threatening, offensive, or harmful.
|
28
|
+
|
29
|
+
By adopting this Code of Conduct, project maintainers commit themselves to
|
30
|
+
fairly and consistently applying these principles to every aspect of managing
|
31
|
+
this project. Project maintainers who do not follow or enforce the Code of
|
32
|
+
Conduct may be permanently removed from the project team.
|
33
|
+
|
34
|
+
This code of conduct applies both within project spaces and in public spaces
|
35
|
+
when an individual is representing the project or its community.
|
36
|
+
|
37
|
+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
38
|
+
reported by contacting a project maintainer at amardaxini@gmail.com. All
|
39
|
+
complaints will be reviewed and investigated and will result in a response that
|
40
|
+
is deemed necessary and appropriate to the circumstances. Maintainers are
|
41
|
+
obligated to maintain confidentiality with regard to the reporter of an
|
42
|
+
incident.
|
43
|
+
|
44
|
+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
|
45
|
+
version 1.3.0, available at
|
46
|
+
[http://contributor-covenant.org/version/1/3/0/][version]
|
47
|
+
|
48
|
+
[homepage]: http://contributor-covenant.org
|
49
|
+
[version]: http://contributor-covenant.org/version/1/3/0/
|
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2016 amardaxini
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in
|
13
|
+
all copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
21
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,83 @@
|
|
1
|
+
# WebexApi
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/webex_api`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'webex_api'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install webex_api
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
client = WebexApi::Client.new("webex_username","webex_password","site_id","site_name","partner_id","webex_email")
|
26
|
+
|
27
|
+
##### Create Meeting
|
28
|
+
|
29
|
+
options = {
|
30
|
+
duration: 10,
|
31
|
+
emails: [] ,
|
32
|
+
scheduled_date: Date with time
|
33
|
+
meeting_password: "admin123"
|
34
|
+
time_zone: Time.zone
|
35
|
+
}
|
36
|
+
meeting_key = client.create_meeting(meeting_name,options)
|
37
|
+
|
38
|
+
##### Meeting Info
|
39
|
+
client.get_meeting(meeting_key)
|
40
|
+
|
41
|
+
##### Meeting Host Url
|
42
|
+
client.get_meeting_host_url(meeting_key)
|
43
|
+
|
44
|
+
##### Meeting Join Url
|
45
|
+
client.get_meeting_join_url(meeting_key)
|
46
|
+
|
47
|
+
##### Delete meeting
|
48
|
+
client.delete_meeting(meeting_key)
|
49
|
+
|
50
|
+
##### Add Attendee to meeting
|
51
|
+
options = {
|
52
|
+
:name=>"",
|
53
|
+
:address_type=>"PERSONAL",
|
54
|
+
:role=>"ATTENDEE or PRESENTER or HOST"
|
55
|
+
}
|
56
|
+
|
57
|
+
client.add_attendee_to_meeting(meeting_key,"email,options)
|
58
|
+
|
59
|
+
##### Remove Attendee from meeting
|
60
|
+
client.delete_attendee_from_meeting(meeting_key,"amardaxini@gmail.com")
|
61
|
+
|
62
|
+
##### List Attendee for meeting
|
63
|
+
client.list_attendee_for_meeting(meeting_key)
|
64
|
+
|
65
|
+
## TODO
|
66
|
+
Add Event API
|
67
|
+
|
68
|
+
|
69
|
+
## Development
|
70
|
+
|
71
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
72
|
+
|
73
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
74
|
+
|
75
|
+
## Contributing
|
76
|
+
|
77
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/webex_api. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
|
78
|
+
|
79
|
+
|
80
|
+
## License
|
81
|
+
|
82
|
+
The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
|
83
|
+
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "webex_api"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
require 'webex_api/webex_error'
|
2
|
+
require 'webex_api/request'
|
3
|
+
require 'webex_api/meeting_request'
|
4
|
+
require 'webex_api/meeting'
|
5
|
+
|
6
|
+
module WebexApi
|
7
|
+
class Client
|
8
|
+
attr_accessor :webex_id,:webex_password,:site_id,:site_name,:partner_id,:webex_email
|
9
|
+
def initialize(webex_id,webex_password,site_id,site_name,partner_id=nil,webex_email=nil)
|
10
|
+
@webex_id = webex_id
|
11
|
+
@webex_password = webex_password
|
12
|
+
@site_id = site_id
|
13
|
+
@site_name = site_name
|
14
|
+
@partner_id = partner_id
|
15
|
+
@webex_email = webex_email
|
16
|
+
|
17
|
+
end
|
18
|
+
|
19
|
+
def create_meeting(name,options={})
|
20
|
+
meeting = WebexApi::Meeting.create_meeting(self,name,options)
|
21
|
+
end
|
22
|
+
|
23
|
+
def get_meeting(meeting_key)
|
24
|
+
meeting = WebexApi::Meeting.new(meeting_key,self)
|
25
|
+
meeting.get_meeting
|
26
|
+
meeting
|
27
|
+
end
|
28
|
+
|
29
|
+
def get_meeting_host_url(meeting_key,user_email=nil)
|
30
|
+
meeting = WebexApi::Meeting.new(meeting_key,self)
|
31
|
+
meeting.get_host_url(user_email)
|
32
|
+
|
33
|
+
end
|
34
|
+
|
35
|
+
def get_meeting_join_url(meeting_key,user_email=nil)
|
36
|
+
meeting = WebexApi::Meeting.new(meeting_key,self)
|
37
|
+
meeting.get_join_url(user_email)
|
38
|
+
|
39
|
+
end
|
40
|
+
|
41
|
+
def delete_meeting(meeting_key)
|
42
|
+
meeting = WebexApi::Meeting.new(meeting_key,self)
|
43
|
+
meeting.delete_meeting
|
44
|
+
end
|
45
|
+
# option {:name=>"ss",:address_type=>"PERSONAL or GLOBAL",:role=>"ATTENDEE or PRESENTER or HOST"}
|
46
|
+
def add_attendee_to_meeting(meeting_key,user_email,options={})
|
47
|
+
meeting = WebexApi::Meeting.new(meeting_key,self)
|
48
|
+
meeting.add_attendee(user_email,options)
|
49
|
+
end
|
50
|
+
|
51
|
+
def delete_attendee_from_meeting(meeting_key,user_email)
|
52
|
+
meeting = WebexApi::Meeting.new(meeting_key,self)
|
53
|
+
meeting.delete_attendee(user_email)
|
54
|
+
end
|
55
|
+
def list_attendee_for_meeting(meeting_key)
|
56
|
+
meeting = WebexApi::Meeting.new(meeting_key,self)
|
57
|
+
meeting.list_attendees
|
58
|
+
end
|
59
|
+
|
60
|
+
end
|
61
|
+
end
|
@@ -0,0 +1,92 @@
|
|
1
|
+
module WebexApi
|
2
|
+
class Meeting
|
3
|
+
attr_reader :xml
|
4
|
+
MEETING_ATTRIBUTES = [:conf_name,:start_date,:host_joined,:status]
|
5
|
+
|
6
|
+
def initialize(meeting_key,client)
|
7
|
+
@meeting_key= meeting_key
|
8
|
+
@email = email
|
9
|
+
@client = client
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.create_meeting(client,name,options={})
|
13
|
+
meeting_key = nil
|
14
|
+
meeting_request = WebexApi::MeetingRequest.new(client)
|
15
|
+
meeting_request.create_meeting(name,options)
|
16
|
+
if meeting_request.xml_response.at_xpath('//meetingkey')
|
17
|
+
meeting_key = meeting_request.xml_response.at_xpath('//meetingkey').text
|
18
|
+
end
|
19
|
+
meeting_key
|
20
|
+
end
|
21
|
+
|
22
|
+
def get_meeting
|
23
|
+
meeting_info = WebexApi::MeetingRequest.new(@client)
|
24
|
+
meeting_info.get_meeting(@meeting_key)
|
25
|
+
@xml = meeting_info.xml_response
|
26
|
+
end
|
27
|
+
|
28
|
+
def delete_meeting
|
29
|
+
meeting_request = WebexApi::MeetingRequest.new(@client)
|
30
|
+
meeting_request.delete_meeting(@meeting_key)
|
31
|
+
meeting_request.success
|
32
|
+
end
|
33
|
+
|
34
|
+
|
35
|
+
def get_host_url(email=nil)
|
36
|
+
meeting_request = WebexApi::MeetingRequest.new(@client)
|
37
|
+
meeting_request.get_host_meeting_url(@meeting_key)
|
38
|
+
if meeting_request.xml_response.at_xpath('hostMeetingURL')
|
39
|
+
meeting_request.xml_response.at_xpath('hostMeetingURL').text
|
40
|
+
else
|
41
|
+
nil
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
def get_join_url(email=nil)
|
46
|
+
meeting_request = WebexApi::MeetingRequest.new(@client)
|
47
|
+
meeting_request.get_join_meeting_url(@meeting_key)
|
48
|
+
if meeting_request.xml_response.at_xpath('joinMeetingURL')
|
49
|
+
meeting_request.xml_response.at_xpath('joinMeetingURL').text
|
50
|
+
else
|
51
|
+
nil
|
52
|
+
end
|
53
|
+
end
|
54
|
+
|
55
|
+
def add_attendee(user_email,user_info={})
|
56
|
+
meeting_request = WebexApi::MeetingRequest.new(@client)
|
57
|
+
meeting_request.add_attendee(@meeting_key,user_email,user_info)
|
58
|
+
meeting_request.success
|
59
|
+
end
|
60
|
+
|
61
|
+
def delete_attendee(user_email)
|
62
|
+
meeting_request = WebexApi::MeetingRequest.new(@client)
|
63
|
+
meeting_request.delete_attendee(@meeting_key,user_email)
|
64
|
+
|
65
|
+
meeting_request.success
|
66
|
+
end
|
67
|
+
def list_attendees
|
68
|
+
meeting_request = WebexApi::MeetingRequest.new(@client)
|
69
|
+
meeting_request.list_attendees(@meeting_key)
|
70
|
+
@xml = meeting_request.xml_response
|
71
|
+
end
|
72
|
+
def method_missing(meth, *args, &block)
|
73
|
+
if MEETING_ATTRIBUTES.include?(meth)
|
74
|
+
if @meeting_attr[meth]
|
75
|
+
@meeting_attr[meth]
|
76
|
+
else
|
77
|
+
if @xml.at_xpath("//*[contains(translate(name(),'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz'), '#{meth.to_s.camelcase(:lower).downcase}')]")
|
78
|
+
@meeting_attr[meth] = @xml.at_xpath("//*[contains(translate(name(),'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz'), '#{meth.to_s.camelcase(:lower).downcase}')]").text
|
79
|
+
else
|
80
|
+
@meeting_attr[meth] = nil
|
81
|
+
end
|
82
|
+
|
83
|
+
end
|
84
|
+
|
85
|
+
@meeting_attr[meth] ||= @xml.at_xpath("//*[contains(translate(name(),'ABCDEFGHIJKLMNOPQRSTUVWXYZ','abcdefghijklmnopqrstuvwxyz'), '#{meth.to_s.camelcase(:lower).downcase}')]")
|
86
|
+
end
|
87
|
+
end
|
88
|
+
|
89
|
+
|
90
|
+
|
91
|
+
end
|
92
|
+
end
|
@@ -0,0 +1,135 @@
|
|
1
|
+
module WebexApi
|
2
|
+
class MeetingRequest < WebexApi::Request
|
3
|
+
|
4
|
+
def initialize(client)
|
5
|
+
super(client)
|
6
|
+
|
7
|
+
end
|
8
|
+
def create_meeting(conf_name,options={})
|
9
|
+
body = webex_xml_request(@client.webex_email) do |xml|
|
10
|
+
xml.bodyContent('xsi:type' =>'java:com.webex.service.binding.meeting.CreateMeeting'){
|
11
|
+
xml.metaData{
|
12
|
+
xml.confName conf_name
|
13
|
+
}
|
14
|
+
if options[:meeting_password] != nil && options[:meeting_password].strip != ''
|
15
|
+
xml.accessControl{
|
16
|
+
xml.meetingPassword options[:meeting_password]
|
17
|
+
}
|
18
|
+
end
|
19
|
+
xml.schedule{
|
20
|
+
if options[:scheduled_date]
|
21
|
+
xml.startDate options[:scheduled_date].utc.strftime("%m/%d/%Y %T") rescue nil
|
22
|
+
# xml.timeZoneID 4
|
23
|
+
else
|
24
|
+
xml.startDate
|
25
|
+
end
|
26
|
+
xml.duration(options[:duration].to_i)
|
27
|
+
}
|
28
|
+
if options[:emails]
|
29
|
+
xml.participants{
|
30
|
+
xml.attendees{
|
31
|
+
options[:emails].each do |email|
|
32
|
+
xml.attendee {
|
33
|
+
xml.emailInvitations true
|
34
|
+
xml.person {
|
35
|
+
xml.email email
|
36
|
+
}
|
37
|
+
}
|
38
|
+
end
|
39
|
+
}
|
40
|
+
}
|
41
|
+
end
|
42
|
+
}
|
43
|
+
end
|
44
|
+
perform_request(body)
|
45
|
+
|
46
|
+
end
|
47
|
+
|
48
|
+
def get_meeting(meeting_key)
|
49
|
+
body = webex_xml_request(@client.webex_email) do |xml|
|
50
|
+
xml.bodyContent('xsi:type' => 'java:com.webex.service.binding.meeting.GetMeeting'){
|
51
|
+
xml.meetingKey meeting_key
|
52
|
+
}
|
53
|
+
end
|
54
|
+
begin
|
55
|
+
perform_request(body)
|
56
|
+
rescue WebexApi::WebexError
|
57
|
+
nil
|
58
|
+
end
|
59
|
+
end
|
60
|
+
|
61
|
+
def get_host_meeting_url(meeting_key)
|
62
|
+
body = webex_xml_request(@client.webex_email) do |xml|
|
63
|
+
xml.bodyContent('xsi:type' => 'java:com.webex.service.binding.meeting.GethosturlMeeting'){
|
64
|
+
xml.sessionKey meeting_key
|
65
|
+
}
|
66
|
+
end
|
67
|
+
perform_request(body)
|
68
|
+
end
|
69
|
+
|
70
|
+
def get_join_meeting_url(meeting_key)
|
71
|
+
body = webex_xml_request(@client.webex_email) do |xml|
|
72
|
+
xml.bodyContent('xsi:type' => 'java:com.webex.service.binding.meeting.GetjoinurlMeeting'){
|
73
|
+
xml.sessionKey meeting_key
|
74
|
+
}
|
75
|
+
end
|
76
|
+
perform_request(body)
|
77
|
+
end
|
78
|
+
|
79
|
+
def delete_meeting(meeting_key)
|
80
|
+
body = webex_xml_request(@client.webex_email) do |xml|
|
81
|
+
xml.bodyContent('xsi:type' => 'java:com.webex.service.binding.meeting.DelMeeting'){
|
82
|
+
xml.meetingKey meeting_key
|
83
|
+
}
|
84
|
+
end
|
85
|
+
perform_request(body)
|
86
|
+
|
87
|
+
end
|
88
|
+
|
89
|
+
def add_attendee(meeting_key,email,options={})
|
90
|
+
body = webex_xml_request(@client.webex_email) do |xml|
|
91
|
+
xml.bodyContent('xsi:type' =>'java:com.webex.service.binding.attendee.CreateMeetingAttendee'){
|
92
|
+
xml.person{
|
93
|
+
if options[:name]
|
94
|
+
xml.name options[:name]
|
95
|
+
end
|
96
|
+
|
97
|
+
xml.address {
|
98
|
+
xml.addressType options[:address_type] || "PERSONAL"
|
99
|
+
}
|
100
|
+
|
101
|
+
xml.email email
|
102
|
+
xml.type options[:type] || "VISITOR"
|
103
|
+
}
|
104
|
+
xml.role options[:role] || "ATTENDEE"
|
105
|
+
xml.sessionKey meeting_key
|
106
|
+
}
|
107
|
+
end
|
108
|
+
perform_request(body)
|
109
|
+
end
|
110
|
+
|
111
|
+
def delete_attendee(meeting_key,email)
|
112
|
+
body = webex_xml_request(@client.webex_email) do |xml|
|
113
|
+
xml.bodyContent('xsi:type' =>'java:com.webex.service.binding.attendee.DelMeetingAttendee'){
|
114
|
+
xml.attendeeEmail {
|
115
|
+
xml.email email
|
116
|
+
xml.sessionKey meeting_key
|
117
|
+
}
|
118
|
+
}
|
119
|
+
end
|
120
|
+
perform_request(body)
|
121
|
+
end
|
122
|
+
|
123
|
+
def list_attendees(meeting_key)
|
124
|
+
|
125
|
+
body = webex_xml_request(@client.webex_email) do |xml|
|
126
|
+
xml.bodyContent('xsi:type' =>'java:com.webex.service.binding.attendee.LstMeetingAttendee'){
|
127
|
+
xml.meetingKey meeting_key
|
128
|
+
|
129
|
+
}
|
130
|
+
end
|
131
|
+
perform_request(body)
|
132
|
+
end
|
133
|
+
|
134
|
+
end
|
135
|
+
end
|
@@ -0,0 +1,51 @@
|
|
1
|
+
module WebexApi
|
2
|
+
class Request
|
3
|
+
attr_accessor :xml_response ,:error,:success,:client
|
4
|
+
def initialize(client)
|
5
|
+
@client = client
|
6
|
+
@success = false
|
7
|
+
|
8
|
+
end
|
9
|
+
def webex_xml_request(email=nil)
|
10
|
+
Nokogiri::XML::Builder.new(:encoding => 'UTF-8') do |xml|
|
11
|
+
xml.message('xmlns:xsi' => "http://www.w3.org/2001/XMLSchema-instance",
|
12
|
+
'xmlns:serv' => "http://www.webex.com/schemas/2002/06/service",
|
13
|
+
'xsi:schemaLocation' => "http://www.webex.com/schemas/2002/06/service"){
|
14
|
+
xml.parent.namespace = xml.parent.namespace_definitions.find{|ns|ns.prefix=="serv"}
|
15
|
+
xml.header{
|
16
|
+
xml.parent.namespace = xml.parent.namespace_definitions.first
|
17
|
+
xml.securityContext {
|
18
|
+
xml.webExID @client.webex_id
|
19
|
+
xml.password @client.webex_password
|
20
|
+
xml.siteID @client.site_id
|
21
|
+
xml.partnerID @client.partner_id if !!@client.partner_id
|
22
|
+
xml.email email if !!email
|
23
|
+
}
|
24
|
+
}
|
25
|
+
xml.body{
|
26
|
+
xml.parent.namespace = xml.parent.namespace_definitions.first
|
27
|
+
yield xml
|
28
|
+
}
|
29
|
+
}
|
30
|
+
end.to_xml
|
31
|
+
end
|
32
|
+
|
33
|
+
|
34
|
+
def perform_request(body)
|
35
|
+
|
36
|
+
uri = URI.parse("https://#{@client.site_name}.webex.com")
|
37
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
38
|
+
http.use_ssl = true
|
39
|
+
response = http.post('/WBXService/XMLService', body)
|
40
|
+
xml_data = Nokogiri::XML(response.body).remove_namespaces!
|
41
|
+
if xml_data.at_xpath('/message/header/response/result') && xml_data.at_xpath('/message/header/response/result').text == 'SUCCESS'
|
42
|
+
@success = true
|
43
|
+
@xml_response = xml_data.at_xpath('/message/body/bodyContent')
|
44
|
+
else
|
45
|
+
@error = xml_data.at_xpath('/message/header/response/reason').text rescue "error"
|
46
|
+
raise WebexApi::WebexError.new(@error)
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
end
|
51
|
+
end
|
data/lib/webex_api.rb
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
require "webex_api/version"
|
2
|
+
require "webex_api/client"
|
3
|
+
require "webex_api/webex_error"
|
4
|
+
require "webex_api/request"
|
5
|
+
require "webex_api/meeting_request"
|
6
|
+
require "webex_api/meeting"
|
7
|
+
require "webex_api/client"
|
8
|
+
require "nokogiri"
|
9
|
+
require "uri"
|
10
|
+
require "net/http"
|
11
|
+
|
12
|
+
module WebexApi
|
13
|
+
# Your code goes here...
|
14
|
+
end
|
data/webex_api.gemspec
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'webex_api/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "webex_api"
|
8
|
+
spec.version = WebexApi::VERSION
|
9
|
+
spec.authors = ["amardaxini"]
|
10
|
+
spec.email = ["amardaxini@gmail.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{Webex Api for meeting.}
|
13
|
+
spec.description = %q{Webex Api for managing meeting and event}
|
14
|
+
spec.homepage = "https://github.com/amardaxini/webex_api"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
# Prevent pushing this gem to RubyGems.org by setting 'allowed_push_host', or
|
18
|
+
# delete this section to allow pushing this gem to any host.
|
19
|
+
|
20
|
+
|
21
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
22
|
+
spec.bindir = "exe"
|
23
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
24
|
+
spec.require_paths = ["lib"]
|
25
|
+
|
26
|
+
spec.add_development_dependency "bundler", "~> 1.11"
|
27
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
28
|
+
spec.add_development_dependency "minitest", "~> 5.0"
|
29
|
+
spec.add_development_dependency "nokogiri"
|
30
|
+
end
|
metadata
ADDED
@@ -0,0 +1,117 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: webex_api
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- amardaxini
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-02-01 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.11'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.11'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: minitest
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '5.0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '5.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: nokogiri
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
description: Webex Api for managing meeting and event
|
70
|
+
email:
|
71
|
+
- amardaxini@gmail.com
|
72
|
+
executables: []
|
73
|
+
extensions: []
|
74
|
+
extra_rdoc_files: []
|
75
|
+
files:
|
76
|
+
- ".gitignore"
|
77
|
+
- ".travis.yml"
|
78
|
+
- CODE_OF_CONDUCT.md
|
79
|
+
- Gemfile
|
80
|
+
- LICENSE.txt
|
81
|
+
- README.md
|
82
|
+
- Rakefile
|
83
|
+
- bin/console
|
84
|
+
- bin/setup
|
85
|
+
- lib/webex_api.rb
|
86
|
+
- lib/webex_api/client.rb
|
87
|
+
- lib/webex_api/meeting.rb
|
88
|
+
- lib/webex_api/meeting_request.rb
|
89
|
+
- lib/webex_api/request.rb
|
90
|
+
- lib/webex_api/version.rb
|
91
|
+
- lib/webex_api/webex_error.rb
|
92
|
+
- webex_api.gemspec
|
93
|
+
homepage: https://github.com/amardaxini/webex_api
|
94
|
+
licenses:
|
95
|
+
- MIT
|
96
|
+
metadata: {}
|
97
|
+
post_install_message:
|
98
|
+
rdoc_options: []
|
99
|
+
require_paths:
|
100
|
+
- lib
|
101
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
102
|
+
requirements:
|
103
|
+
- - ">="
|
104
|
+
- !ruby/object:Gem::Version
|
105
|
+
version: '0'
|
106
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - ">="
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: '0'
|
111
|
+
requirements: []
|
112
|
+
rubyforge_project:
|
113
|
+
rubygems_version: 2.4.8
|
114
|
+
signing_key:
|
115
|
+
specification_version: 4
|
116
|
+
summary: Webex Api for meeting.
|
117
|
+
test_files: []
|