liblynx-api 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +3 -0
- data/Gemfile.lock +53 -0
- data/LICENSE +21 -0
- data/README.md +33 -0
- data/Rakefile +35 -0
- data/api.md +713 -0
- data/config.json +7 -0
- data/config/config.rb +13 -0
- data/lib/liblynx-api.rb +22 -0
- data/lib/liblynx-api/client.rb +1153 -0
- data/lib/liblynx-api/version.rb +5 -0
- data/liblynx-api.gemspec +27 -0
- data/meta.json +11 -0
- data/schema.json +905 -0
- data/schemata/account.json +429 -0
- data/schemata/identification.json +239 -0
- data/schemata/samlidps.json +140 -0
- data/schemata/token.json +68 -0
- data/spec/client_spec.rb +110 -0
- metadata +162 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 0fe4d72c4727a875b22339767d341ddad10d4ea67c7d696f197e958bc047cfa9
|
4
|
+
data.tar.gz: d78d47e1de2396924105918a335667928e37d7b33463fcc605d8f49b2cbbcc05
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f9e1097852ad4a367f0c9c661307c9145aaac7b84ccf99eb026aa170529eaa51c266442decbac36d7cda52622f47a9a79332082db9ff61360a44310b50a0a5d5
|
7
|
+
data.tar.gz: 6981696e13fa5ff3fb251287545982cd585b655f3828bcd9c4895fca46cfe805a40d9048d232edce81f66aa22f5266b820326ec35cb1fd5a39ee9ffa15ecd9b7
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
liblynx-api (1.0.0)
|
5
|
+
heroics
|
6
|
+
moneta
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
diff-lcs (1.3)
|
12
|
+
erubis (2.7.0)
|
13
|
+
excon (0.60.0)
|
14
|
+
heroics (0.0.24)
|
15
|
+
erubis (~> 2.0)
|
16
|
+
excon
|
17
|
+
moneta
|
18
|
+
multi_json (>= 1.9.2)
|
19
|
+
json_schema (0.17.0)
|
20
|
+
moneta (1.0.0)
|
21
|
+
multi_json (1.13.1)
|
22
|
+
prmd (0.13.0)
|
23
|
+
erubis (~> 2.7)
|
24
|
+
json_schema (~> 0.3, >= 0.3.1)
|
25
|
+
rake (10.5.0)
|
26
|
+
rspec (3.7.0)
|
27
|
+
rspec-core (~> 3.7.0)
|
28
|
+
rspec-expectations (~> 3.7.0)
|
29
|
+
rspec-mocks (~> 3.7.0)
|
30
|
+
rspec-core (3.7.1)
|
31
|
+
rspec-support (~> 3.7.0)
|
32
|
+
rspec-expectations (3.7.0)
|
33
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
34
|
+
rspec-support (~> 3.7.0)
|
35
|
+
rspec-mocks (3.7.0)
|
36
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
37
|
+
rspec-support (~> 3.7.0)
|
38
|
+
rspec-support (3.7.0)
|
39
|
+
yard (0.9.12)
|
40
|
+
|
41
|
+
PLATFORMS
|
42
|
+
ruby
|
43
|
+
|
44
|
+
DEPENDENCIES
|
45
|
+
bundler
|
46
|
+
liblynx-api!
|
47
|
+
prmd
|
48
|
+
rake (< 11.0)
|
49
|
+
rspec
|
50
|
+
yard
|
51
|
+
|
52
|
+
BUNDLED WITH
|
53
|
+
1.16.1
|
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2018 Denis Sablic
|
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 all
|
13
|
+
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 THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,33 @@
|
|
1
|
+
# LibLynx API
|
2
|
+
|
3
|
+
Ruby HTTP client for the LibLynx API.
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
```
|
10
|
+
gem 'liblynx-api'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
```
|
16
|
+
bundle
|
17
|
+
```
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
```
|
22
|
+
gem install liblynx-api
|
23
|
+
```
|
24
|
+
|
25
|
+
## Usage example
|
26
|
+
|
27
|
+
```ruby
|
28
|
+
require 'liblynx-api'
|
29
|
+
|
30
|
+
client = LibLynxAPI.connect_oauth2(CLIENT_ID, CLIENT_SECRET)
|
31
|
+
# print account resources
|
32
|
+
pp client.account.list
|
33
|
+
```
|
data/Rakefile
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
require 'bundler/gem_tasks'
|
2
|
+
require 'prmd/rake_tasks/combine'
|
3
|
+
require 'prmd/rake_tasks/verify'
|
4
|
+
require 'prmd/rake_tasks/doc'
|
5
|
+
|
6
|
+
namespace :schema do
|
7
|
+
Prmd::RakeTasks::Combine.new do |t|
|
8
|
+
t.options[:meta] = 'meta.json'
|
9
|
+
t.paths << 'schemata'
|
10
|
+
t.output_file = 'schema.json'
|
11
|
+
end
|
12
|
+
|
13
|
+
Prmd::RakeTasks::Verify.new do |t|
|
14
|
+
t.files << 'schema.json'
|
15
|
+
end
|
16
|
+
|
17
|
+
Prmd::RakeTasks::Doc.new do |t|
|
18
|
+
t.options[:settings] = 'config.json'
|
19
|
+
t.files = { 'schema.json' => 'api.md' }
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
23
|
+
desc 'Build the client'
|
24
|
+
task :client do
|
25
|
+
sh 'bundle exec heroics-generate ./config/config.rb > lib/liblynx-api/client.rb'
|
26
|
+
end
|
27
|
+
|
28
|
+
task build: ['schema:combine', 'schema:verify', 'schema:doc', 'client']
|
29
|
+
|
30
|
+
begin
|
31
|
+
require 'rspec/core/rake_task'
|
32
|
+
RSpec::Core::RakeTask.new(:spec)
|
33
|
+
task default: [:spec]
|
34
|
+
rescue LoadError
|
35
|
+
end
|
data/api.md
ADDED
@@ -0,0 +1,713 @@
|
|
1
|
+
|
2
|
+
## <a name="resource-account">Account</a>
|
3
|
+
|
4
|
+
Stability: `production`
|
5
|
+
|
6
|
+
|
7
|
+
|
8
|
+
### Attributes
|
9
|
+
|
10
|
+
| Name | Type | Description | Example |
|
11
|
+
| ------- | ------- | ------- | ------- |
|
12
|
+
| **active** | *boolean* | active | `true` |
|
13
|
+
| **created_at** | *date-time* | when account was created | `"2015-01-01T12:00:00Z"` |
|
14
|
+
| **email_domains** | *string* | cr separated email domains | `"*.somedomain.com\nalt.somedomain2.com"` |
|
15
|
+
| **enable_archimed** | *boolean* | enable archimed | `true` |
|
16
|
+
| **enable_individual** | *boolean* | enable individual | `true` |
|
17
|
+
| **enable_ip** | *boolean* | enable ip | `true` |
|
18
|
+
| **enable_lib_portal_stats** | *boolean* | enable lib portal stats | `true` |
|
19
|
+
| **enable_library_card** | *boolean* | enable library card | `true` |
|
20
|
+
| **enable_open_athens** | *boolean* | enable open athens | `true` |
|
21
|
+
| **enable_pass_code** | *boolean* | enable pass code | `true` |
|
22
|
+
| **enable_referrer** | *boolean* | enable referrer | `true` |
|
23
|
+
| **enable_saml** | *boolean* | enable saml | `true` |
|
24
|
+
| **enable_self_registration** | *boolean* | enable self registration | `true` |
|
25
|
+
| **enable_shibboleth** | *boolean* | enable shibboleth | `true` |
|
26
|
+
| **id** | *integer* | unique identifier of account | `42` |
|
27
|
+
| **individual** | *boolean* | individual | `true` |
|
28
|
+
| **individual_limit** | *integer* | individual limit | `42` |
|
29
|
+
| **name** | *string* | unique name of account | `"example"` |
|
30
|
+
| **publisher_reference** | *string* | publisher reference | `"example"` |
|
31
|
+
| **shibboleth_entity_id** | *uri* | shibboleth entity id | |
|
32
|
+
| **type** | *string* | type | `"example"` |
|
33
|
+
| **updated_at** | *date-time* | when account was updated | `"2015-01-01T12:00:00Z"` |
|
34
|
+
|
35
|
+
### <a name="link-POST-account-/api/accounts">Account Create</a>
|
36
|
+
|
37
|
+
Create a new account.
|
38
|
+
|
39
|
+
```
|
40
|
+
POST /api/accounts
|
41
|
+
```
|
42
|
+
|
43
|
+
#### Required Parameters
|
44
|
+
|
45
|
+
| Name | Type | Description | Example |
|
46
|
+
| ------- | ------- | ------- | ------- |
|
47
|
+
| **account_name** | *string* | unique name of account | `"example"` |
|
48
|
+
|
49
|
+
|
50
|
+
#### Optional Parameters
|
51
|
+
|
52
|
+
| Name | Type | Description | Example |
|
53
|
+
| ------- | ------- | ------- | ------- |
|
54
|
+
| **active** | *boolean* | active | `true` |
|
55
|
+
| **email_domains** | *string* | cr separated email domains | `"*.somedomain.com\nalt.somedomain2.com"` |
|
56
|
+
| **enable_archimed** | *boolean* | enable archimed | `true` |
|
57
|
+
| **enable_individual** | *boolean* | enable individual | `true` |
|
58
|
+
| **enable_ip** | *boolean* | enable ip | `true` |
|
59
|
+
| **enable_lib_portal_stats** | *boolean* | enable lib portal stats | `true` |
|
60
|
+
| **enable_library_card** | *boolean* | enable library card | `true` |
|
61
|
+
| **enable_open_athens** | *boolean* | enable open athens | `true` |
|
62
|
+
| **enable_pass_code** | *boolean* | enable pass code | `true` |
|
63
|
+
| **enable_referrer** | *boolean* | enable referrer | `true` |
|
64
|
+
| **enable_saml** | *boolean* | enable saml | `true` |
|
65
|
+
| **enable_self_registration** | *boolean* | enable self registration | `true` |
|
66
|
+
| **enable_shibboleth** | *boolean* | enable shibboleth | `true` |
|
67
|
+
| **individual** | *boolean* | individual | `true` |
|
68
|
+
| **individual_limit** | *integer* | individual limit | `42` |
|
69
|
+
| **publisher_reference** | *string* | publisher reference | `"example"` |
|
70
|
+
| **shibboleth_entity_id** | *uri* | shibboleth entity id | |
|
71
|
+
| **type** | *string* | type | `"example"` |
|
72
|
+
|
73
|
+
|
74
|
+
#### Curl Example
|
75
|
+
|
76
|
+
```bash
|
77
|
+
$ curl -n -X POST https://connect.liblynx.com/api/accounts \
|
78
|
+
-d '{
|
79
|
+
"account_name": "example",
|
80
|
+
"publisher_reference": "example",
|
81
|
+
"email_domains": "*.somedomain.com\nalt.somedomain2.com",
|
82
|
+
"enable_saml": true,
|
83
|
+
"enable_shibboleth": true,
|
84
|
+
"shibboleth_entity_id": "example",
|
85
|
+
"enable_ip": true,
|
86
|
+
"enable_pass_code": true,
|
87
|
+
"enable_referrer": true,
|
88
|
+
"enable_library_card": true,
|
89
|
+
"enable_individual": true,
|
90
|
+
"enable_open_athens": true,
|
91
|
+
"enable_archimed": true,
|
92
|
+
"active": true,
|
93
|
+
"enable_self_registration": true,
|
94
|
+
"enable_lib_portal_stats": true,
|
95
|
+
"individual_limit": 42,
|
96
|
+
"individual": true,
|
97
|
+
"type": "example"
|
98
|
+
}' \
|
99
|
+
-H "Content-Type: application/json"
|
100
|
+
```
|
101
|
+
|
102
|
+
|
103
|
+
#### Response Example
|
104
|
+
|
105
|
+
```
|
106
|
+
HTTP/1.1 201 Created
|
107
|
+
```
|
108
|
+
|
109
|
+
```json
|
110
|
+
{
|
111
|
+
"created_at": "2015-01-01T12:00:00Z",
|
112
|
+
"id": 42,
|
113
|
+
"name": "example",
|
114
|
+
"publisher_reference": "example",
|
115
|
+
"enable_saml": true,
|
116
|
+
"enable_shibboleth": true,
|
117
|
+
"email_domains": "*.somedomain.com\nalt.somedomain2.com",
|
118
|
+
"updated_at": "2015-01-01T12:00:00Z",
|
119
|
+
"shibboleth_entity_id": "example",
|
120
|
+
"enable_ip": true,
|
121
|
+
"enable_pass_code": true,
|
122
|
+
"enable_referrer": true,
|
123
|
+
"enable_library_card": true,
|
124
|
+
"enable_individual": true,
|
125
|
+
"enable_open_athens": true,
|
126
|
+
"enable_archimed": true,
|
127
|
+
"active": true,
|
128
|
+
"enable_self_registration": true,
|
129
|
+
"enable_lib_portal_stats": true,
|
130
|
+
"individual_limit": 42,
|
131
|
+
"individual": true,
|
132
|
+
"type": "example"
|
133
|
+
}
|
134
|
+
```
|
135
|
+
|
136
|
+
### <a name="link-DELETE-account-/api/accounts/{(%23%2Fdefinitions%2Faccount%2Fdefinitions%2Fidentity)}">Account Delete</a>
|
137
|
+
|
138
|
+
Delete an existing account.
|
139
|
+
|
140
|
+
```
|
141
|
+
DELETE /api/accounts/{account_id}
|
142
|
+
```
|
143
|
+
|
144
|
+
|
145
|
+
#### Curl Example
|
146
|
+
|
147
|
+
```bash
|
148
|
+
$ curl -n -X DELETE https://connect.liblynx.com/api/accounts/$ACCOUNT_ID \
|
149
|
+
-H "Content-Type: application/json"
|
150
|
+
```
|
151
|
+
|
152
|
+
|
153
|
+
#### Response Example
|
154
|
+
|
155
|
+
```
|
156
|
+
HTTP/1.1 200 OK
|
157
|
+
```
|
158
|
+
|
159
|
+
```json
|
160
|
+
null
|
161
|
+
```
|
162
|
+
|
163
|
+
### <a name="link-GET-account-/api/accounts/{(%23%2Fdefinitions%2Faccount%2Fdefinitions%2Fidentity)}">Account Info</a>
|
164
|
+
|
165
|
+
Info for existing account.
|
166
|
+
|
167
|
+
```
|
168
|
+
GET /api/accounts/{account_id}
|
169
|
+
```
|
170
|
+
|
171
|
+
|
172
|
+
#### Curl Example
|
173
|
+
|
174
|
+
```bash
|
175
|
+
$ curl -n https://connect.liblynx.com/api/accounts/$ACCOUNT_ID
|
176
|
+
```
|
177
|
+
|
178
|
+
|
179
|
+
#### Response Example
|
180
|
+
|
181
|
+
```
|
182
|
+
HTTP/1.1 200 OK
|
183
|
+
```
|
184
|
+
|
185
|
+
```json
|
186
|
+
{
|
187
|
+
"created_at": "2015-01-01T12:00:00Z",
|
188
|
+
"id": 42,
|
189
|
+
"name": "example",
|
190
|
+
"publisher_reference": "example",
|
191
|
+
"enable_saml": true,
|
192
|
+
"enable_shibboleth": true,
|
193
|
+
"email_domains": "*.somedomain.com\nalt.somedomain2.com",
|
194
|
+
"updated_at": "2015-01-01T12:00:00Z",
|
195
|
+
"shibboleth_entity_id": "example",
|
196
|
+
"enable_ip": true,
|
197
|
+
"enable_pass_code": true,
|
198
|
+
"enable_referrer": true,
|
199
|
+
"enable_library_card": true,
|
200
|
+
"enable_individual": true,
|
201
|
+
"enable_open_athens": true,
|
202
|
+
"enable_archimed": true,
|
203
|
+
"active": true,
|
204
|
+
"enable_self_registration": true,
|
205
|
+
"enable_lib_portal_stats": true,
|
206
|
+
"individual_limit": 42,
|
207
|
+
"individual": true,
|
208
|
+
"type": "example"
|
209
|
+
}
|
210
|
+
```
|
211
|
+
|
212
|
+
### <a name="link-GET-account-/api/accounts">Account List</a>
|
213
|
+
|
214
|
+
List existing accounts.
|
215
|
+
|
216
|
+
```
|
217
|
+
GET /api/accounts
|
218
|
+
```
|
219
|
+
|
220
|
+
|
221
|
+
#### Curl Example
|
222
|
+
|
223
|
+
```bash
|
224
|
+
$ curl -n https://connect.liblynx.com/api/accounts
|
225
|
+
```
|
226
|
+
|
227
|
+
|
228
|
+
#### Response Example
|
229
|
+
|
230
|
+
```
|
231
|
+
HTTP/1.1 200 OK
|
232
|
+
```
|
233
|
+
|
234
|
+
```json
|
235
|
+
{
|
236
|
+
"accounts": [
|
237
|
+
{
|
238
|
+
"id": 42,
|
239
|
+
"account_name": "example",
|
240
|
+
"individual": true,
|
241
|
+
"active": true,
|
242
|
+
"publisher_reference": "example",
|
243
|
+
"type": "example",
|
244
|
+
"modified_date": "2015-01-01T12:00:00Z",
|
245
|
+
"creation_date": "2015-01-01T12:00:00Z"
|
246
|
+
}
|
247
|
+
]
|
248
|
+
}
|
249
|
+
```
|
250
|
+
|
251
|
+
### <a name="link-PUT-account-/api/accounts/{(%23%2Fdefinitions%2Faccount%2Fdefinitions%2Fidentity)}">Account Update</a>
|
252
|
+
|
253
|
+
Update an existing account.
|
254
|
+
|
255
|
+
```
|
256
|
+
PUT /api/accounts/{account_id}
|
257
|
+
```
|
258
|
+
|
259
|
+
#### Optional Parameters
|
260
|
+
|
261
|
+
| Name | Type | Description | Example |
|
262
|
+
| ------- | ------- | ------- | ------- |
|
263
|
+
| **account_name** | *string* | unique name of account | `"example"` |
|
264
|
+
| **active** | *boolean* | active | `true` |
|
265
|
+
| **email_domains** | *string* | cr separated email domains | `"*.somedomain.com\nalt.somedomain2.com"` |
|
266
|
+
| **enable_archimed** | *boolean* | enable archimed | `true` |
|
267
|
+
| **enable_individual** | *boolean* | enable individual | `true` |
|
268
|
+
| **enable_ip** | *boolean* | enable ip | `true` |
|
269
|
+
| **enable_lib_portal_stats** | *boolean* | enable lib portal stats | `true` |
|
270
|
+
| **enable_library_card** | *boolean* | enable library card | `true` |
|
271
|
+
| **enable_open_athens** | *boolean* | enable open athens | `true` |
|
272
|
+
| **enable_pass_code** | *boolean* | enable pass code | `true` |
|
273
|
+
| **enable_referrer** | *boolean* | enable referrer | `true` |
|
274
|
+
| **enable_saml** | *boolean* | enable saml | `true` |
|
275
|
+
| **enable_self_registration** | *boolean* | enable self registration | `true` |
|
276
|
+
| **enable_shibboleth** | *boolean* | enable shibboleth | `true` |
|
277
|
+
| **individual** | *boolean* | individual | `true` |
|
278
|
+
| **individual_limit** | *integer* | individual limit | `42` |
|
279
|
+
| **publisher_reference** | *string* | publisher reference | `"example"` |
|
280
|
+
| **shibboleth_entity_id** | *uri* | shibboleth entity id | |
|
281
|
+
| **type** | *string* | type | `"example"` |
|
282
|
+
|
283
|
+
|
284
|
+
#### Curl Example
|
285
|
+
|
286
|
+
```bash
|
287
|
+
$ curl -n -X PUT https://connect.liblynx.com/api/accounts/$ACCOUNT_ID \
|
288
|
+
-d '{
|
289
|
+
"account_name": "example",
|
290
|
+
"publisher_reference": "example",
|
291
|
+
"email_domains": "*.somedomain.com\nalt.somedomain2.com",
|
292
|
+
"enable_saml": true,
|
293
|
+
"enable_shibboleth": true,
|
294
|
+
"shibboleth_entity_id": "example",
|
295
|
+
"enable_ip": true,
|
296
|
+
"enable_pass_code": true,
|
297
|
+
"enable_referrer": true,
|
298
|
+
"enable_library_card": true,
|
299
|
+
"enable_individual": true,
|
300
|
+
"enable_open_athens": true,
|
301
|
+
"enable_archimed": true,
|
302
|
+
"active": true,
|
303
|
+
"enable_self_registration": true,
|
304
|
+
"enable_lib_portal_stats": true,
|
305
|
+
"individual_limit": 42,
|
306
|
+
"individual": true,
|
307
|
+
"type": "example"
|
308
|
+
}' \
|
309
|
+
-H "Content-Type: application/json"
|
310
|
+
```
|
311
|
+
|
312
|
+
|
313
|
+
#### Response Example
|
314
|
+
|
315
|
+
```
|
316
|
+
HTTP/1.1 200 OK
|
317
|
+
```
|
318
|
+
|
319
|
+
```json
|
320
|
+
{
|
321
|
+
"created_at": "2015-01-01T12:00:00Z",
|
322
|
+
"id": 42,
|
323
|
+
"name": "example",
|
324
|
+
"publisher_reference": "example",
|
325
|
+
"enable_saml": true,
|
326
|
+
"enable_shibboleth": true,
|
327
|
+
"email_domains": "*.somedomain.com\nalt.somedomain2.com",
|
328
|
+
"updated_at": "2015-01-01T12:00:00Z",
|
329
|
+
"shibboleth_entity_id": "example",
|
330
|
+
"enable_ip": true,
|
331
|
+
"enable_pass_code": true,
|
332
|
+
"enable_referrer": true,
|
333
|
+
"enable_library_card": true,
|
334
|
+
"enable_individual": true,
|
335
|
+
"enable_open_athens": true,
|
336
|
+
"enable_archimed": true,
|
337
|
+
"active": true,
|
338
|
+
"enable_self_registration": true,
|
339
|
+
"enable_lib_portal_stats": true,
|
340
|
+
"individual_limit": 42,
|
341
|
+
"individual": true,
|
342
|
+
"type": "example"
|
343
|
+
}
|
344
|
+
```
|
345
|
+
|
346
|
+
|
347
|
+
## <a name="resource-identification">Identification</a>
|
348
|
+
|
349
|
+
Stability: `production`
|
350
|
+
|
351
|
+
|
352
|
+
|
353
|
+
### Attributes
|
354
|
+
|
355
|
+
| Name | Type | Description | Example |
|
356
|
+
| ------- | ------- | ------- | ------- |
|
357
|
+
| **authorizations** | *array* | authorizations | |
|
358
|
+
| **created** | *date-time* | when identification was created | `"2015-01-01T12:00:00Z"` |
|
359
|
+
| **id** | *uuid* | unique identifier of identification | `"01234567-89ab-cdef-0123-456789abcdef"` |
|
360
|
+
| **ip** | *ipv4* | ip address | `"192.0.2.1"` |
|
361
|
+
| **publisher:id** | *integer* | | `42` |
|
362
|
+
| **publisher:publisher_name** | *string* | | `"example"` |
|
363
|
+
| **status** | *string* | status | `"example"` |
|
364
|
+
| **target_account:account_name** | *string* | | `"example"` |
|
365
|
+
| **target_account:id** | *integer* | | `42` |
|
366
|
+
| **target_account:individual** | *boolean* | | `true` |
|
367
|
+
| **target_account:publisher_reference** | *string* | | `"example"` |
|
368
|
+
| **target_account:type** | *string* | | `"example"` |
|
369
|
+
| **terms** | *string* | terms | `"example"` |
|
370
|
+
| **unit_requests** | *array* | unit requests | |
|
371
|
+
| **url** | *uri* | callback url | |
|
372
|
+
| **user_agent** | *string* | user agent | `"example"` |
|
373
|
+
| **user_institution:account_name** | *string* | | `"example"` |
|
374
|
+
| **user_institution:country_code** | *string* | | `"example"` |
|
375
|
+
| **user_institution:id** | *integer* | | `42` |
|
376
|
+
| **user_institution:type** | *string* | | `"example"` |
|
377
|
+
|
378
|
+
### <a name="link-POST-identification-/api/identifications">Identification Create</a>
|
379
|
+
|
380
|
+
create a new identification resource to try and identify an account to link a new session with
|
381
|
+
|
382
|
+
```
|
383
|
+
POST /api/identifications
|
384
|
+
```
|
385
|
+
|
386
|
+
#### Required Parameters
|
387
|
+
|
388
|
+
| Name | Type | Description | Example |
|
389
|
+
| ------- | ------- | ------- | ------- |
|
390
|
+
| **ip** | *ipv4* | ip address | `"192.0.2.1"` |
|
391
|
+
| **url** | *uri* | callback url | |
|
392
|
+
| **user_agent** | *string* | user agent | `"example"` |
|
393
|
+
|
394
|
+
|
395
|
+
#### Optional Parameters
|
396
|
+
|
397
|
+
| Name | Type | Description | Example |
|
398
|
+
| ------- | ------- | ------- | ------- |
|
399
|
+
| **email** | *email* | user email address | `"username@example.com"` |
|
400
|
+
|
401
|
+
|
402
|
+
#### Curl Example
|
403
|
+
|
404
|
+
```bash
|
405
|
+
$ curl -n -X POST https://connect.liblynx.com/api/identifications \
|
406
|
+
-d '{
|
407
|
+
"email": "username@example.com",
|
408
|
+
"ip": "192.0.2.1",
|
409
|
+
"user_agent": "example",
|
410
|
+
"url": "example"
|
411
|
+
}' \
|
412
|
+
-H "Content-Type: application/json"
|
413
|
+
```
|
414
|
+
|
415
|
+
|
416
|
+
#### Response Example
|
417
|
+
|
418
|
+
```
|
419
|
+
HTTP/1.1 201 Created
|
420
|
+
```
|
421
|
+
|
422
|
+
```json
|
423
|
+
{
|
424
|
+
"created": "2015-01-01T12:00:00Z",
|
425
|
+
"id": "01234567-89ab-cdef-0123-456789abcdef",
|
426
|
+
"url": "example",
|
427
|
+
"ip": "192.0.2.1",
|
428
|
+
"status": "example",
|
429
|
+
"terms": "example",
|
430
|
+
"authorizations": null,
|
431
|
+
"unit_requests": null,
|
432
|
+
"publisher": {
|
433
|
+
"id": 42,
|
434
|
+
"publisher_name": "example"
|
435
|
+
},
|
436
|
+
"user_agent": "example",
|
437
|
+
"user_institution": {
|
438
|
+
"id": 42,
|
439
|
+
"account_name": "example",
|
440
|
+
"country_code": "example",
|
441
|
+
"type": "example"
|
442
|
+
},
|
443
|
+
"target_account": {
|
444
|
+
"id": 42,
|
445
|
+
"account_name": "example",
|
446
|
+
"individual": true,
|
447
|
+
"type": "example",
|
448
|
+
"publisher_reference": "example"
|
449
|
+
}
|
450
|
+
}
|
451
|
+
```
|
452
|
+
|
453
|
+
### <a name="link-GET-identification-/api/identifications/{(%23%2Fdefinitions%2Fidentification%2Fdefinitions%2Fidentity)}">Identification Info</a>
|
454
|
+
|
455
|
+
retrieve a single identification object
|
456
|
+
|
457
|
+
```
|
458
|
+
GET /api/identifications/{identification_id}
|
459
|
+
```
|
460
|
+
|
461
|
+
|
462
|
+
#### Curl Example
|
463
|
+
|
464
|
+
```bash
|
465
|
+
$ curl -n https://connect.liblynx.com/api/identifications/$IDENTIFICATION_ID
|
466
|
+
```
|
467
|
+
|
468
|
+
|
469
|
+
#### Response Example
|
470
|
+
|
471
|
+
```
|
472
|
+
HTTP/1.1 200 OK
|
473
|
+
```
|
474
|
+
|
475
|
+
```json
|
476
|
+
{
|
477
|
+
"created": "2015-01-01T12:00:00Z",
|
478
|
+
"id": "01234567-89ab-cdef-0123-456789abcdef",
|
479
|
+
"url": "example",
|
480
|
+
"ip": "192.0.2.1",
|
481
|
+
"status": "example",
|
482
|
+
"terms": "example",
|
483
|
+
"authorizations": null,
|
484
|
+
"unit_requests": null,
|
485
|
+
"publisher": {
|
486
|
+
"id": 42,
|
487
|
+
"publisher_name": "example"
|
488
|
+
},
|
489
|
+
"user_agent": "example",
|
490
|
+
"user_institution": {
|
491
|
+
"id": 42,
|
492
|
+
"account_name": "example",
|
493
|
+
"country_code": "example",
|
494
|
+
"type": "example"
|
495
|
+
},
|
496
|
+
"target_account": {
|
497
|
+
"id": 42,
|
498
|
+
"account_name": "example",
|
499
|
+
"individual": true,
|
500
|
+
"type": "example",
|
501
|
+
"publisher_reference": "example"
|
502
|
+
}
|
503
|
+
}
|
504
|
+
```
|
505
|
+
|
506
|
+
|
507
|
+
## <a name="resource-samlidp">Samlidp</a>
|
508
|
+
|
509
|
+
Stability: `production`
|
510
|
+
|
511
|
+
|
512
|
+
|
513
|
+
### Attributes
|
514
|
+
|
515
|
+
| Name | Type | Description | Example |
|
516
|
+
| ------- | ------- | ------- | ------- |
|
517
|
+
| **descriptor_url** | *string* | saml descriptor url | `"example"` |
|
518
|
+
| **entity_id** | *string* | entity_id | `"example"` |
|
519
|
+
| **id** | *integer* | unique identifier of samlidp | `42` |
|
520
|
+
| **type** | *string* | type | `"example"` |
|
521
|
+
| **xml_descriptor** | *string* | xml descriptor | `"example"` |
|
522
|
+
|
523
|
+
### <a name="link-POST-samlidp-/api/accounts/{(%23%2Fdefinitions%2Faccount%2Fdefinitions%2Fidentity)}/samlidps">Samlidp Create</a>
|
524
|
+
|
525
|
+
Create a new samlidp.
|
526
|
+
|
527
|
+
```
|
528
|
+
POST /api/accounts/{account_id}/samlidps
|
529
|
+
```
|
530
|
+
|
531
|
+
#### Required Parameters
|
532
|
+
|
533
|
+
| Name | Type | Description | Example |
|
534
|
+
| ------- | ------- | ------- | ------- |
|
535
|
+
| **descriptor_url** | *string* | saml descriptor url | `"example"` |
|
536
|
+
|
537
|
+
|
538
|
+
|
539
|
+
#### Curl Example
|
540
|
+
|
541
|
+
```bash
|
542
|
+
$ curl -n -X POST https://connect.liblynx.com/api/accounts/$ACCOUNT_ID/samlidps \
|
543
|
+
-d '{
|
544
|
+
"descriptor_url": "example"
|
545
|
+
}' \
|
546
|
+
-H "Content-Type: application/json"
|
547
|
+
```
|
548
|
+
|
549
|
+
|
550
|
+
#### Response Example
|
551
|
+
|
552
|
+
```
|
553
|
+
HTTP/1.1 201 Created
|
554
|
+
```
|
555
|
+
|
556
|
+
```json
|
557
|
+
{
|
558
|
+
"id": 42,
|
559
|
+
"descriptor_url": "example",
|
560
|
+
"xml_descriptor": "example",
|
561
|
+
"type": "example",
|
562
|
+
"entity_id": "example"
|
563
|
+
}
|
564
|
+
```
|
565
|
+
|
566
|
+
### <a name="link-DELETE-samlidp-/api/accounts/{(%23%2Fdefinitions%2Faccount%2Fdefinitions%2Fidentity)}/samlidps/{(%23%2Fdefinitions%2Fsamlidp%2Fdefinitions%2Fidentity)}">Samlidp Delete</a>
|
567
|
+
|
568
|
+
Delete an existing samlidp.
|
569
|
+
|
570
|
+
```
|
571
|
+
DELETE /api/accounts/{account_id}/samlidps/{samlidp_id}
|
572
|
+
```
|
573
|
+
|
574
|
+
|
575
|
+
#### Curl Example
|
576
|
+
|
577
|
+
```bash
|
578
|
+
$ curl -n -X DELETE https://connect.liblynx.com/api/accounts/$ACCOUNT_ID/samlidps/$SAMLIDP_ID \
|
579
|
+
-H "Content-Type: application/json"
|
580
|
+
```
|
581
|
+
|
582
|
+
|
583
|
+
#### Response Example
|
584
|
+
|
585
|
+
```
|
586
|
+
HTTP/1.1 200 OK
|
587
|
+
```
|
588
|
+
|
589
|
+
```json
|
590
|
+
null
|
591
|
+
```
|
592
|
+
|
593
|
+
### <a name="link-GET-samlidp-/api/accounts/{(%23%2Fdefinitions%2Faccount%2Fdefinitions%2Fidentity)}/samlidps/{(%23%2Fdefinitions%2Fsamlidp%2Fdefinitions%2Fidentity)}">Samlidp Info</a>
|
594
|
+
|
595
|
+
Info for existing samlidp.
|
596
|
+
|
597
|
+
```
|
598
|
+
GET /api/accounts/{account_id}/samlidps/{samlidp_id}
|
599
|
+
```
|
600
|
+
|
601
|
+
|
602
|
+
#### Curl Example
|
603
|
+
|
604
|
+
```bash
|
605
|
+
$ curl -n https://connect.liblynx.com/api/accounts/$ACCOUNT_ID/samlidps/$SAMLIDP_ID
|
606
|
+
```
|
607
|
+
|
608
|
+
|
609
|
+
#### Response Example
|
610
|
+
|
611
|
+
```
|
612
|
+
HTTP/1.1 200 OK
|
613
|
+
```
|
614
|
+
|
615
|
+
```json
|
616
|
+
{
|
617
|
+
"id": 42,
|
618
|
+
"descriptor_url": "example",
|
619
|
+
"xml_descriptor": "example",
|
620
|
+
"type": "example",
|
621
|
+
"entity_id": "example"
|
622
|
+
}
|
623
|
+
```
|
624
|
+
|
625
|
+
### <a name="link-GET-samlidp-/api/accounts/{(%23%2Fdefinitions%2Faccount%2Fdefinitions%2Fidentity)}/samlidps">Samlidp List</a>
|
626
|
+
|
627
|
+
List existing samlidps.
|
628
|
+
|
629
|
+
```
|
630
|
+
GET /api/accounts/{account_id}/samlidps
|
631
|
+
```
|
632
|
+
|
633
|
+
|
634
|
+
#### Curl Example
|
635
|
+
|
636
|
+
```bash
|
637
|
+
$ curl -n https://connect.liblynx.com/api/accounts/$ACCOUNT_ID/samlidps
|
638
|
+
```
|
639
|
+
|
640
|
+
|
641
|
+
#### Response Example
|
642
|
+
|
643
|
+
```
|
644
|
+
HTTP/1.1 200 OK
|
645
|
+
```
|
646
|
+
|
647
|
+
```json
|
648
|
+
{
|
649
|
+
"samlidps": [
|
650
|
+
{
|
651
|
+
"id": 42,
|
652
|
+
"descriptor_url": "example",
|
653
|
+
"xml_descriptor": "example",
|
654
|
+
"type": "example",
|
655
|
+
"entity_id": "example"
|
656
|
+
}
|
657
|
+
]
|
658
|
+
}
|
659
|
+
```
|
660
|
+
|
661
|
+
|
662
|
+
## <a name="resource-token">OAuth2 token</a>
|
663
|
+
|
664
|
+
Stability: `production`
|
665
|
+
|
666
|
+
|
667
|
+
|
668
|
+
### Attributes
|
669
|
+
|
670
|
+
| Name | Type | Description | Example |
|
671
|
+
| ------- | ------- | ------- | ------- |
|
672
|
+
| **account_token** | *string* | unique identifier of identification | `"example"` |
|
673
|
+
|
674
|
+
### <a name="link-POST-token-/oauth/v2/token">OAuth2 token Create</a>
|
675
|
+
|
676
|
+
Create a new oauth2 token
|
677
|
+
|
678
|
+
```
|
679
|
+
POST /oauth/v2/token
|
680
|
+
```
|
681
|
+
|
682
|
+
#### Required Parameters
|
683
|
+
|
684
|
+
| Name | Type | Description | Example |
|
685
|
+
| ------- | ------- | ------- | ------- |
|
686
|
+
| **grant_type** | *string* | grant_type | `"client_credentials"` |
|
687
|
+
|
688
|
+
|
689
|
+
|
690
|
+
#### Curl Example
|
691
|
+
|
692
|
+
```bash
|
693
|
+
$ curl -n -X POST https://connect.liblynx.com/oauth/v2/token \
|
694
|
+
-d '{
|
695
|
+
"grant_type": "client_credentials"
|
696
|
+
}' \
|
697
|
+
-H "Content-Type: application/json"
|
698
|
+
```
|
699
|
+
|
700
|
+
|
701
|
+
#### Response Example
|
702
|
+
|
703
|
+
```
|
704
|
+
HTTP/1.1 201 Created
|
705
|
+
```
|
706
|
+
|
707
|
+
```json
|
708
|
+
{
|
709
|
+
"account_token": "example"
|
710
|
+
}
|
711
|
+
```
|
712
|
+
|
713
|
+
|