proctorserv-api 1.1.0 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -43,16 +43,29 @@ The workflow involves
43
43
 
44
44
  - createSessionEvent
45
45
 
46
- Creating a severity-defined session event based on regular and irregular session activity such as irregular eye movement, checking into a session, etc. A list of session events can be found in SessionEvent.php.
46
+ Creating a severity-defined session event based on regular and irregular session activity such as irregular eye movement, checking into a session, etc. A list of session events can be found
47
+ [here](https://github.com/ProctorCam/web-integration/wiki/Create-Session-Event#event-types)
47
48
 
48
49
  Session events are documented by the proctor and can be seen in the web interface after logging in with one's customer account.
49
50
 
50
51
 
51
- - ####Reviewing the sesison
52
+ - ####Reviewing the session
52
53
 
53
54
  - generateSecureReviewUrl
54
55
 
55
- Generating a secure URL that grants temporary customer access to the review screen of one of their users' sessions. The review screen consists of the exam taker's audio, video, and desktop activity as recorded by ProctorApp. It can be accessed live or after the session has ended.
56
+ Generating a secure URL that grants temporary customer access to the review screen of one of their users' sessions. The review screen consists of the exam taker's audio, video, and desktop activity as recorded by ProctorApp. It can be accessed live or after the session has ended.
57
+
58
+ - ####Obtaining session details
59
+
60
+ - dataRetrievals
61
+
62
+ Will return data associated with a list of sessions. Users can find such information as the url to review a past session, url to download the video of a past session, url to download the photo of the id provided by the sessions test taker, a url to download the photo of test taker and a list of all session activity.
63
+
64
+ - ####Deleting sessions
65
+
66
+ - dataDeletions
67
+
68
+ Will delete all identifying data associated with a set of sessions
56
69
 
57
70
 
58
71
  ### Example workflow
@@ -98,6 +111,16 @@ An exam taker in the integrating system is searching for a time to schedule a se
98
111
  - The integrating system makes an API request to generate a secure review URL for the customer
99
112
  - The secure review URL can be loaded into an iframe or a new window
100
113
 
114
+ #####*Obtaining information about a list of sessions* (dataRetrievals)
115
+ - A customer wants to get information about a list of sessions
116
+ - The integrating system makes an API request retrieve the information requested
117
+ - The integrating system gets sent a list of all data available based on the information requested for those sessions.
118
+
119
+ #####*Deleting a session* (sessionDeletion)
120
+ - A customer wants to delete a list of sessions
121
+ - The integrating system makes an API request to delete a list of sessions and all associated data
122
+ - The integrating system gets sent a list of all sessions that were sucessfully deleted
123
+
101
124
  #### Installation
102
125
 
103
126
  The Client API requires Ruby version >= 1.9.2. To find out what your verions is, use:
@@ -158,8 +181,11 @@ proctorserv_api.cancel_reservation
158
181
  proctorserv_api.generate_jsonp_token
159
182
  proctorserv_api.generate_secure_review_url
160
183
  proctorserv_api.create_session_event
184
+ proctorserv_api.data_deletions
185
+ proctorserv_api.data_retrievals
161
186
  ```
162
187
 
188
+
163
189
  ### Full Documentation
164
190
 
165
- Further documentation for these methods can be found [here](http://rubydoc.info/github/ProctorCam/proctorserv-api-rb/master/frames)
191
+ Complete documentation can be found in our online developers guide [located here](http://guide.proctorcam.com/developers/). You will be able to find complete details regarding our api's, concepts, and getting started code recipes.
@@ -3,6 +3,7 @@ require 'proctorserv_api/exceptions/invalid_client_exception'
3
3
  require 'proctorserv_api/exceptions/invalid_ip_exception'
4
4
  require 'proctorserv_api/exceptions/invalid_signature_exception'
5
5
  require 'proctorserv_api/exceptions/missing_required_parameter_exception'
6
+ require 'proctorserv_api/version'
6
7
 
7
8
  #
8
9
  # proctorserv_api.rb
@@ -28,8 +29,6 @@ require 'proctorserv_api/exceptions/missing_required_parameter_exception'
28
29
  module ProctorCam
29
30
  module Proctorserv
30
31
  class ProctorservApi
31
-
32
- VERSION = "1.1.0"
33
32
 
34
33
  def initialize(api_identifier, shared_secret, service_protocol = "https", service_url = "service.proctorcam.com")
35
34
  @service_protocol = service_protocol
@@ -149,6 +148,44 @@ module ProctorCam
149
148
  parsed_response
150
149
  end
151
150
 
151
+ # get_access_code
152
+ # Will return a hash containing access code and its expiration date time based
153
+ # on a session ID provided in the request
154
+ #
155
+ # required parameters:
156
+ # - session_id Integer
157
+ #
158
+ def get_access_code(options)
159
+ requires_of options, [:session_id]
160
+ url = "#{@service_protocol}://#{@service_url}/api/access_code/#{__method__}"
161
+ response = RestRequestClient.new.make_post_request url, @api_identifier, @shared_secret, options
162
+
163
+ parsed_response = JSON.parse response.body
164
+ raise_exception_if_necessary(parsed_response) if response.code != 200
165
+
166
+ return parsed_response["message"] if parsed_response["message"]
167
+ parsed_response["access_code"]
168
+ end
169
+
170
+ # reset_access_code
171
+ # Will return a hash containing new access code for a session
172
+ # based on a session ID provided in the request
173
+ #
174
+ # required parameters:
175
+ # - session_id Integer
176
+ #
177
+ def reset_access_code(options)
178
+ requires_of options, [:session_id]
179
+ url = "#{@service_protocol}://#{@service_url}/api/access_code/#{__method__}"
180
+ response = RestRequestClient.new.make_post_request url, @api_identifier, @shared_secret, options
181
+
182
+ parsed_response = JSON.parse response.body
183
+ raise_exception_if_necessary(parsed_response) if response.code != 200
184
+
185
+ return parsed_response if parsed_response["message"]
186
+ parsed_response["access_code"]
187
+ end
188
+
152
189
  ## dataDeletions
153
190
  #
154
191
  # Will delete all identifying data associated with a set of sessions
@@ -37,7 +37,7 @@ module ProctorCam
37
37
 
38
38
  def make_post_request(url, customer_identifier, shared_secret, params)
39
39
  HashedAuthenticator.apply_reverse_guid_and_sign(params, customer_identifier, shared_secret)
40
- return RestClient.post url, params, :accept => :json, :content_type => :json do |response, request, result, &block|
40
+ return RestClient.post url, params.to_json, :accept => :json, :content_type => :json do |response, request, result, &block|
41
41
  return response
42
42
  end
43
43
  end
@@ -0,0 +1,28 @@
1
+ #
2
+ # version.rb
3
+ # ProctorservApi
4
+ #
5
+ # Copyright 2013 ProctorCam, Inc
6
+ #
7
+ # Licensed under the Apache License, Version 2.0 (the "License");
8
+ # you may not use this file except in compliance with the License.
9
+ # You may obtain a copy of the License at
10
+ #
11
+ # http://www.apache.org/licenses/LICENSE-2.0
12
+ #
13
+ # Unless required by applicable law or agreed to in writing, software
14
+ # distributed under the License is distributed on an "AS IS" BASIS,
15
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ # See the License for the specific language governing permissions and
17
+ # limitations under the License.
18
+ #
19
+ # Created by Max Lahey on 4/7/14.
20
+ #
21
+
22
+ module ProctorCam
23
+ module Proctorserv
24
+ class ProctorservApi
25
+ VERSION = "1.4.0"
26
+ end
27
+ end
28
+ end
@@ -75,6 +75,47 @@ describe ProctorCam::Proctorserv::ProctorservApi do
75
75
 
76
76
  end
77
77
 
78
+
79
+ describe "get_access_code" do
80
+
81
+ it "raises missing_required_parameter_exception when not passed sesison_id in options hash" do
82
+ expect{@proctorserv_api.get_access_code({:wrong => 10})}.to raise_error ProctorCam::Proctorserv::MissingRequiredParameterException
83
+ end
84
+
85
+ it "returns an error message stating session id doesn't exist if improper session id is provided" do
86
+ options = {:session_id => 2}
87
+ response = @proctorserv_api.get_access_code(options)
88
+ expect(response).to eql("Session id does not exist")
89
+ end
90
+
91
+ it "returns an access code and expiration date time" do
92
+ options = {:session_id => 1700}
93
+ response = @proctorserv_api.get_access_code(options)
94
+ puts response
95
+ expect(response["code"].to_s.size).to eql(9)
96
+ end
97
+ end
98
+
99
+ describe "reset_access_code" do
100
+
101
+ it "raises missing_required_parameter_exception when not passed sesison_id in options hash" do
102
+ expect{@proctorserv_api.reset_access_code({:wrong => 10})}.to raise_error ProctorCam::Proctorserv::MissingRequiredParameterException
103
+ end
104
+
105
+ it "returns an error message stating session id doesn't exist if improper session id is provided" do
106
+ options = {:session_id => 582309823907}
107
+ response = @proctorserv_api.reset_access_code(options)
108
+ expect(response["message"]).to eql("Session id does not exist")
109
+ end
110
+
111
+ it "returns an access code and expiration date time" do
112
+ options = {:session_id => 57}
113
+ response = @proctorserv_api.reset_access_code(options)
114
+
115
+ expect(response["new_access_code"].to_s.size).to eql(9)
116
+ end
117
+ end
118
+
78
119
  describe "get_available_timeslots_around" do
79
120
 
80
121
  it "raises missing_required_parameter_exception when not passed time, num_slots, and session_duration in options hash" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: proctorserv-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.4.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-11-25 00:00:00.000000000 Z
12
+ date: 2014-04-07 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rest-client
@@ -57,6 +57,7 @@ files:
57
57
  - lib/proctorserv_api/exceptions/missing_required_parameter_exception.rb
58
58
  - lib/proctorserv_api/hashed_authenticator.rb
59
59
  - lib/proctorserv_api/rest_request_client.rb
60
+ - lib/proctorserv_api/version.rb
60
61
  - lib/proctorserv_api.rb
61
62
  - LICENSE
62
63
  - README.md