pmp 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/example/permissions.rb +67 -14
- data/example/permissions_result.txt +1077 -0
- data/lib/pmp.rb +1 -0
- data/lib/pmp/client.rb +1 -1
- data/lib/pmp/collection_document.rb +18 -10
- data/lib/pmp/configuration.rb +14 -4
- data/lib/pmp/connection.rb +1 -1
- data/lib/pmp/credential.rb +1 -1
- data/lib/pmp/link.rb +2 -2
- data/lib/pmp/version.rb +1 -1
- data/spec/collection_document_spec.rb +1 -1
- data/spec/pmp_spec.rb +12 -0
- metadata +5 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 967b6fcc653a652190480ecf5adb50f25fdee49b
|
4
|
+
data.tar.gz: 7e41ed111ce829ad2b876f3dacc619fde4112250
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 864ccef40568b132f5da9da1def8c99a6d681348ddf213d4c5361d646c73a5f2609062b1a87a0457c75aeecd6756aef5fda926721c31b37caebfa8f98d0cab64
|
7
|
+
data.tar.gz: f3139d704838d3480da9003478458b3df76278eef5b08ff9a753514b41ad9d63dc1700d165e9c714b966e2619613d8ad95c7511514ed201605ad28e68c049d46
|
data/example/permissions.rb
CHANGED
@@ -1,8 +1,21 @@
|
|
1
1
|
#!/usr/bin/env ruby
|
2
|
+
# ruby version of https://github.com/APMG/pmp-sdk-perl/blob/master/t/002-authz.t
|
2
3
|
|
3
4
|
require 'rubygems'
|
4
5
|
require 'bundler/setup'
|
5
6
|
require 'pmp'
|
7
|
+
require 'json'
|
8
|
+
|
9
|
+
# some utility methods
|
10
|
+
def waiting(seconds, message="waiting")
|
11
|
+
print message
|
12
|
+
seconds.to_i.times{ print "."; sleep(1) }
|
13
|
+
print "\n"
|
14
|
+
end
|
15
|
+
|
16
|
+
def pretty_json(s)
|
17
|
+
JSON.pretty_generate(JSON.parse(s))
|
18
|
+
end
|
6
19
|
|
7
20
|
# ------------------------------------------------------------------------------
|
8
21
|
# Setup: Make sure you can make a client with id and secret
|
@@ -17,7 +30,15 @@ endpoint = 'https://api-sandbox.pmp.io/'
|
|
17
30
|
|
18
31
|
# make a new client, assume id and secret are in the env
|
19
32
|
pmp = PMP::Client.new(client_id: client_id, client_secret: client_secret, endpoint: endpoint)
|
33
|
+
puts "\n\nSetup complete: pmp client: #{pmp.inspect}\n\n"
|
20
34
|
|
35
|
+
# ------------------------------------------------------------------------------
|
36
|
+
# Step 0: Clean up any old data from prior runs
|
37
|
+
# ------------------------------------------------------------------------------
|
38
|
+
delete_count = 0
|
39
|
+
pmp.query["urn:pmp:query:docs"].where(tag: 'pmp_example_permissions', limit: 100).items.each{|i| i.delete; delete_count+=1 }
|
40
|
+
puts "\n\nStep 0 complete: deleted #{delete_count}\n\n"
|
41
|
+
exit 1 if ARGV[0] == 'delete-only'
|
21
42
|
|
22
43
|
# ------------------------------------------------------------------------------
|
23
44
|
# Step 1: Make 3 orgs that will end up with different permissions
|
@@ -36,8 +57,7 @@ organizations = (0..2).map do |index|
|
|
36
57
|
org.save
|
37
58
|
org
|
38
59
|
end
|
39
|
-
puts "
|
40
|
-
|
60
|
+
puts "\n\nStep 1 complete: organizations: #{pretty_json(organizations.to_json)}\n\n"
|
41
61
|
|
42
62
|
# ------------------------------------------------------------------------------
|
43
63
|
# Step 2: Make 4 permission groups, 0:[0,1], 1:[0], 2:[1], and an empty group 3:[]
|
@@ -47,44 +67,77 @@ permission_groups = group_orgs.collect do |orgs|
|
|
47
67
|
group = pmp.doc_of_type('group')
|
48
68
|
group.tags = ['pmp_example_permissions']
|
49
69
|
group.title = "pmp ruby example, permissions: permission group #{orgs.inspect}"
|
50
|
-
group.links['item'] = orgs.map{|o| PMP::Link(href:
|
70
|
+
group.links['item'] = orgs.map{|o| PMP::Link.new(href: organizations[o].href)} if (orgs.size > 0)
|
51
71
|
group.save
|
52
72
|
group
|
53
73
|
end
|
54
|
-
|
55
|
-
puts "Step 2 complete: permission_groups: #{permission_groups.to_json}\n\n"
|
74
|
+
puts "\n\nStep 2 complete: permission_groups: #{pretty_json(permission_groups.to_json)}\n\n"
|
56
75
|
|
57
76
|
# ------------------------------------------------------------------------------
|
58
77
|
# Step 3: Make docs to be protected
|
59
78
|
# ------------------------------------------------------------------------------
|
60
79
|
documents = (0..3).collect do |index|
|
61
80
|
doc = pmp.doc_of_type('story')
|
62
|
-
doc.tags = ['pmp_example_permissions']
|
81
|
+
doc.tags = ['pmp_example_permissions', 'pmp_example_permissions_test_doc']
|
63
82
|
doc.title = "pmp ruby example, permissions: story #{index}"
|
83
|
+
doc
|
64
84
|
end
|
65
85
|
|
66
|
-
documents[0].links['permission'] =
|
86
|
+
documents[0].links['permission'] = PMP::Link.new(href: permission_groups[0].href, operation: 'read')
|
67
87
|
|
68
88
|
documents[1].links['permission'] = [
|
69
|
-
|
89
|
+
PMP::Link.new(
|
70
90
|
href: permission_groups[2].href,
|
71
91
|
operation: 'read',
|
72
92
|
blacklist: true
|
73
|
-
|
74
|
-
|
93
|
+
),
|
94
|
+
PMP::Link.new(
|
75
95
|
href: permission_groups[1].href,
|
76
96
|
operation: 'read'
|
77
|
-
|
97
|
+
),
|
78
98
|
]
|
79
99
|
|
80
|
-
documents[3].links['permission'] =
|
100
|
+
documents[3].links['permission'] = PMP::Link.new(href: permission_groups[3].href, operation: 'read')
|
81
101
|
|
82
102
|
documents.each{|d| d.save }
|
83
103
|
|
104
|
+
puts "\n\nStep 3 complete: documents: #{pretty_json(documents.to_json)}\n\n"
|
84
105
|
|
85
106
|
# ------------------------------------------------------------------------------
|
86
|
-
# Step 4: Make credentials for each org
|
107
|
+
# Step 4: Make credentials and clients for each org
|
87
108
|
# ------------------------------------------------------------------------------
|
88
109
|
credentials = organizations.map do |org|
|
89
|
-
|
110
|
+
puts "create credentials for org: #{org.auth}"
|
111
|
+
pmp.credentials(user: org.auth[:user], password: org.auth[:password]).create
|
112
|
+
end
|
113
|
+
|
114
|
+
waiting(5)
|
115
|
+
|
116
|
+
clients = credentials.map do |creds|
|
117
|
+
PMP::Client.new(client_id: creds['client_id'], client_secret: creds['client_secret'], endpoint: endpoint)
|
118
|
+
end
|
119
|
+
puts "\n\nStep 4 complete: credentials: #{pretty_json(credentials.to_json)}\n\n"
|
120
|
+
|
121
|
+
# ------------------------------------------------------------------------------
|
122
|
+
# Step 5: Test doc visibility!
|
123
|
+
# ------------------------------------------------------------------------------
|
124
|
+
puts "\n\nStep 5: TEST TIME!\n\n"
|
125
|
+
results = (0..2).collect do |index|
|
126
|
+
expected_size = (3 - index)
|
127
|
+
puts "org #{index} should retrieve #{expected_size} items"
|
128
|
+
|
129
|
+
puts "org #{index} got token: #{clients[index].token.token}"
|
130
|
+
waiting(5)
|
131
|
+
|
132
|
+
result = clients[index].query["urn:pmp:query:docs"].where(tag: 'pmp_example_permissions_test_doc').retrieve
|
133
|
+
actual_size = result.items.size
|
134
|
+
msg = (actual_size == expected_size) ? "SUCCESS" : "FAIL"
|
135
|
+
puts "#{msg}: org #{index} retrieved #{actual_size} items, expected #{expected_size}.\n"
|
136
|
+
puts "retrieved: #{pretty_json(result.to_json)}\n\n"
|
137
|
+
|
138
|
+
result
|
90
139
|
end
|
140
|
+
|
141
|
+
puts "\n\nStep 5 complete, all done!\n\n"
|
142
|
+
|
143
|
+
exit 1
|
@@ -0,0 +1,1077 @@
|
|
1
|
+
> bundle exec example/permissions.rb
|
2
|
+
|
3
|
+
|
4
|
+
Setup complete: pmp client: #<PMP::Client:0x007fb3848d8d28 @current_options={:user=>nil, :password=>nil, :client_id=>"REDACTED", :client_secret=>"REDACTED", :oauth_token=>nil, :adapter=>:excon, :endpoint=>"https://api-sandbox.pmp.io/", :user_agent=>"PMP Ruby Gem 0.2.1", :debug=>nil}, @user=nil, @password=nil, @client_id="REDACTED", @client_secret="REDACTED", @oauth_token=nil, @adapter=:excon, @endpoint="https://api-sandbox.pmp.io/", @user_agent="PMP Ruby Gem 0.2.1", @debug=nil>
|
5
|
+
|
6
|
+
|
7
|
+
|
8
|
+
Step 0 complete: deleted 0
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
Step 1 complete: organizations: [
|
13
|
+
{
|
14
|
+
"version": "1.0",
|
15
|
+
"links": {
|
16
|
+
"profile": [
|
17
|
+
{
|
18
|
+
"href": "https://api-sandbox.pmp.io/profiles/user",
|
19
|
+
"type": "application/vnd.pmp.collection.doc+json"
|
20
|
+
}
|
21
|
+
]
|
22
|
+
},
|
23
|
+
"attributes": {
|
24
|
+
"title": "pmp ruby example, permissions: org 0",
|
25
|
+
"tags": [
|
26
|
+
"pmp_example_permissions"
|
27
|
+
],
|
28
|
+
"auth": {
|
29
|
+
"user": "pmp_ruby_org_0",
|
30
|
+
"password": "bf9ba7a7-5a30-49bc-986e-ba4b44a1743e",
|
31
|
+
"scope": "write"
|
32
|
+
},
|
33
|
+
"guid": "57be0d5a-fd30-4dc0-8d6a-898fed13fcd5"
|
34
|
+
}
|
35
|
+
},
|
36
|
+
{
|
37
|
+
"version": "1.0",
|
38
|
+
"links": {
|
39
|
+
"profile": [
|
40
|
+
{
|
41
|
+
"href": "https://api-sandbox.pmp.io/profiles/user",
|
42
|
+
"type": "application/vnd.pmp.collection.doc+json"
|
43
|
+
}
|
44
|
+
]
|
45
|
+
},
|
46
|
+
"attributes": {
|
47
|
+
"title": "pmp ruby example, permissions: org 1",
|
48
|
+
"tags": [
|
49
|
+
"pmp_example_permissions"
|
50
|
+
],
|
51
|
+
"auth": {
|
52
|
+
"user": "pmp_ruby_org_1",
|
53
|
+
"password": "46c45522-a30e-449b-87e5-467c633c46c8",
|
54
|
+
"scope": "write"
|
55
|
+
},
|
56
|
+
"guid": "814bd758-5d3c-4ec9-b514-1d39f8d395d9"
|
57
|
+
}
|
58
|
+
},
|
59
|
+
{
|
60
|
+
"version": "1.0",
|
61
|
+
"links": {
|
62
|
+
"profile": [
|
63
|
+
{
|
64
|
+
"href": "https://api-sandbox.pmp.io/profiles/user",
|
65
|
+
"type": "application/vnd.pmp.collection.doc+json"
|
66
|
+
}
|
67
|
+
]
|
68
|
+
},
|
69
|
+
"attributes": {
|
70
|
+
"title": "pmp ruby example, permissions: org 2",
|
71
|
+
"tags": [
|
72
|
+
"pmp_example_permissions"
|
73
|
+
],
|
74
|
+
"auth": {
|
75
|
+
"user": "pmp_ruby_org_2",
|
76
|
+
"password": "924a0d05-0d83-4115-b305-fd4ab6274072",
|
77
|
+
"scope": "write"
|
78
|
+
},
|
79
|
+
"guid": "f267e7a9-747e-4870-8c6b-d33eeb284eb1"
|
80
|
+
}
|
81
|
+
}
|
82
|
+
]
|
83
|
+
|
84
|
+
|
85
|
+
|
86
|
+
Step 2 complete: permission_groups: [
|
87
|
+
{
|
88
|
+
"version": "1.0",
|
89
|
+
"links": {
|
90
|
+
"profile": [
|
91
|
+
{
|
92
|
+
"href": "https://api-sandbox.pmp.io/profiles/group",
|
93
|
+
"type": "application/vnd.pmp.collection.doc+json"
|
94
|
+
}
|
95
|
+
],
|
96
|
+
"item": [
|
97
|
+
{
|
98
|
+
"href": "https://api-sandbox.pmp.io/docs/57be0d5a-fd30-4dc0-8d6a-898fed13fcd5"
|
99
|
+
},
|
100
|
+
{
|
101
|
+
"href": "https://api-sandbox.pmp.io/docs/814bd758-5d3c-4ec9-b514-1d39f8d395d9"
|
102
|
+
}
|
103
|
+
]
|
104
|
+
},
|
105
|
+
"attributes": {
|
106
|
+
"tags": [
|
107
|
+
"pmp_example_permissions"
|
108
|
+
],
|
109
|
+
"title": "pmp ruby example, permissions: permission group [0, 1]",
|
110
|
+
"guid": "278d9749-7b83-4132-a521-e8b4d359c57a"
|
111
|
+
}
|
112
|
+
},
|
113
|
+
{
|
114
|
+
"version": "1.0",
|
115
|
+
"links": {
|
116
|
+
"profile": [
|
117
|
+
{
|
118
|
+
"href": "https://api-sandbox.pmp.io/profiles/group",
|
119
|
+
"type": "application/vnd.pmp.collection.doc+json"
|
120
|
+
}
|
121
|
+
],
|
122
|
+
"item": [
|
123
|
+
{
|
124
|
+
"href": "https://api-sandbox.pmp.io/docs/57be0d5a-fd30-4dc0-8d6a-898fed13fcd5"
|
125
|
+
}
|
126
|
+
]
|
127
|
+
},
|
128
|
+
"attributes": {
|
129
|
+
"tags": [
|
130
|
+
"pmp_example_permissions"
|
131
|
+
],
|
132
|
+
"title": "pmp ruby example, permissions: permission group [0]",
|
133
|
+
"guid": "d67a7b89-15e9-40db-8b80-8b0333663bec"
|
134
|
+
}
|
135
|
+
},
|
136
|
+
{
|
137
|
+
"version": "1.0",
|
138
|
+
"links": {
|
139
|
+
"profile": [
|
140
|
+
{
|
141
|
+
"href": "https://api-sandbox.pmp.io/profiles/group",
|
142
|
+
"type": "application/vnd.pmp.collection.doc+json"
|
143
|
+
}
|
144
|
+
],
|
145
|
+
"item": [
|
146
|
+
{
|
147
|
+
"href": "https://api-sandbox.pmp.io/docs/814bd758-5d3c-4ec9-b514-1d39f8d395d9"
|
148
|
+
}
|
149
|
+
]
|
150
|
+
},
|
151
|
+
"attributes": {
|
152
|
+
"tags": [
|
153
|
+
"pmp_example_permissions"
|
154
|
+
],
|
155
|
+
"title": "pmp ruby example, permissions: permission group [1]",
|
156
|
+
"guid": "4039c6d5-574c-4f03-a6e2-55b042c0c38c"
|
157
|
+
}
|
158
|
+
},
|
159
|
+
{
|
160
|
+
"version": "1.0",
|
161
|
+
"links": {
|
162
|
+
"profile": [
|
163
|
+
{
|
164
|
+
"href": "https://api-sandbox.pmp.io/profiles/group",
|
165
|
+
"type": "application/vnd.pmp.collection.doc+json"
|
166
|
+
}
|
167
|
+
]
|
168
|
+
},
|
169
|
+
"attributes": {
|
170
|
+
"tags": [
|
171
|
+
"pmp_example_permissions"
|
172
|
+
],
|
173
|
+
"title": "pmp ruby example, permissions: permission group []",
|
174
|
+
"guid": "e8209cb5-7d03-4a48-8195-7ec8afd30fbe"
|
175
|
+
}
|
176
|
+
}
|
177
|
+
]
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
Step 3 complete: documents: [
|
182
|
+
{
|
183
|
+
"version": "1.0",
|
184
|
+
"links": {
|
185
|
+
"profile": [
|
186
|
+
{
|
187
|
+
"href": "https://api-sandbox.pmp.io/profiles/story",
|
188
|
+
"type": "application/vnd.pmp.collection.doc+json"
|
189
|
+
}
|
190
|
+
],
|
191
|
+
"permission": [
|
192
|
+
{
|
193
|
+
"href": "https://api-sandbox.pmp.io/docs/278d9749-7b83-4132-a521-e8b4d359c57a",
|
194
|
+
"operation": "read"
|
195
|
+
}
|
196
|
+
]
|
197
|
+
},
|
198
|
+
"attributes": {
|
199
|
+
"tags": [
|
200
|
+
"pmp_example_permissions",
|
201
|
+
"pmp_example_permissions_test_doc"
|
202
|
+
],
|
203
|
+
"title": "pmp ruby example, permissions: story 0",
|
204
|
+
"guid": "458cfa66-79c5-4769-8e3d-e4540d59e8d9"
|
205
|
+
}
|
206
|
+
},
|
207
|
+
{
|
208
|
+
"version": "1.0",
|
209
|
+
"links": {
|
210
|
+
"profile": [
|
211
|
+
{
|
212
|
+
"href": "https://api-sandbox.pmp.io/profiles/story",
|
213
|
+
"type": "application/vnd.pmp.collection.doc+json"
|
214
|
+
}
|
215
|
+
],
|
216
|
+
"permission": [
|
217
|
+
{
|
218
|
+
"href": "https://api-sandbox.pmp.io/docs/4039c6d5-574c-4f03-a6e2-55b042c0c38c",
|
219
|
+
"operation": "read",
|
220
|
+
"blacklist": true
|
221
|
+
},
|
222
|
+
{
|
223
|
+
"href": "https://api-sandbox.pmp.io/docs/d67a7b89-15e9-40db-8b80-8b0333663bec",
|
224
|
+
"operation": "read"
|
225
|
+
}
|
226
|
+
]
|
227
|
+
},
|
228
|
+
"attributes": {
|
229
|
+
"tags": [
|
230
|
+
"pmp_example_permissions",
|
231
|
+
"pmp_example_permissions_test_doc"
|
232
|
+
],
|
233
|
+
"title": "pmp ruby example, permissions: story 1",
|
234
|
+
"guid": "4c41b1e6-ec3e-4fc8-848e-132445493cd8"
|
235
|
+
}
|
236
|
+
},
|
237
|
+
{
|
238
|
+
"version": "1.0",
|
239
|
+
"links": {
|
240
|
+
"profile": [
|
241
|
+
{
|
242
|
+
"href": "https://api-sandbox.pmp.io/profiles/story",
|
243
|
+
"type": "application/vnd.pmp.collection.doc+json"
|
244
|
+
}
|
245
|
+
]
|
246
|
+
},
|
247
|
+
"attributes": {
|
248
|
+
"tags": [
|
249
|
+
"pmp_example_permissions",
|
250
|
+
"pmp_example_permissions_test_doc"
|
251
|
+
],
|
252
|
+
"title": "pmp ruby example, permissions: story 2",
|
253
|
+
"guid": "17195f0a-e97f-46fd-8d20-3dff6743e961"
|
254
|
+
}
|
255
|
+
},
|
256
|
+
{
|
257
|
+
"version": "1.0",
|
258
|
+
"links": {
|
259
|
+
"profile": [
|
260
|
+
{
|
261
|
+
"href": "https://api-sandbox.pmp.io/profiles/story",
|
262
|
+
"type": "application/vnd.pmp.collection.doc+json"
|
263
|
+
}
|
264
|
+
],
|
265
|
+
"permission": [
|
266
|
+
{
|
267
|
+
"href": "https://api-sandbox.pmp.io/docs/e8209cb5-7d03-4a48-8195-7ec8afd30fbe",
|
268
|
+
"operation": "read"
|
269
|
+
}
|
270
|
+
]
|
271
|
+
},
|
272
|
+
"attributes": {
|
273
|
+
"tags": [
|
274
|
+
"pmp_example_permissions",
|
275
|
+
"pmp_example_permissions_test_doc"
|
276
|
+
],
|
277
|
+
"title": "pmp ruby example, permissions: story 3",
|
278
|
+
"guid": "740c2a8c-0c20-450a-8453-1a4279dd1451"
|
279
|
+
}
|
280
|
+
}
|
281
|
+
]
|
282
|
+
|
283
|
+
create credentials for org: {:user=>"pmp_ruby_org_0", :password=>"bf9ba7a7-5a30-49bc-986e-ba4b44a1743e", :scope=>"write"}
|
284
|
+
create credentials for org: {:user=>"pmp_ruby_org_1", :password=>"46c45522-a30e-449b-87e5-467c633c46c8", :scope=>"write"}
|
285
|
+
create credentials for org: {:user=>"pmp_ruby_org_2", :password=>"924a0d05-0d83-4115-b305-fd4ab6274072", :scope=>"write"}
|
286
|
+
waiting.....
|
287
|
+
|
288
|
+
|
289
|
+
Step 4 complete: credentials: [
|
290
|
+
{
|
291
|
+
"client_id": "9cb4a7ec-3298-416e-b455-af6e267f43f0",
|
292
|
+
"client_secret": "566dcb077a5feaa3a8cca12f",
|
293
|
+
"token_expires_in": "2592000",
|
294
|
+
"scope": "read",
|
295
|
+
"label": "pmp_ruby_org_0: 2013-10-25 12:06:30 -0400"
|
296
|
+
},
|
297
|
+
{
|
298
|
+
"client_id": "9e0ddd0d-55bb-4691-b362-35e0ea0ca440",
|
299
|
+
"client_secret": "9b3c449e623b4ae9cf5f307e",
|
300
|
+
"token_expires_in": "2592000",
|
301
|
+
"scope": "read",
|
302
|
+
"label": "pmp_ruby_org_1: 2013-10-25 12:06:30 -0400"
|
303
|
+
},
|
304
|
+
{
|
305
|
+
"client_id": "7d9a41d7-1a6e-4c91-afb8-8765610a09e4",
|
306
|
+
"client_secret": "babb90131f5078feea27eab6",
|
307
|
+
"token_expires_in": "2592000",
|
308
|
+
"scope": "read",
|
309
|
+
"label": "pmp_ruby_org_2: 2013-10-25 12:06:31 -0400"
|
310
|
+
}
|
311
|
+
]
|
312
|
+
|
313
|
+
|
314
|
+
|
315
|
+
Step 5: TEST TIME!
|
316
|
+
|
317
|
+
org 0 should retrieve 3 items
|
318
|
+
org 0 got token: 64c50e5b033524e289f0ff4d
|
319
|
+
waiting.....
|
320
|
+
SUCCESS: org 0 retrieved 3 items, expected 3.
|
321
|
+
retrieved: {
|
322
|
+
"version": "1.0",
|
323
|
+
"links": {
|
324
|
+
"item": [
|
325
|
+
{
|
326
|
+
"href": "https://api-sandbox.pmp.io/docs/17195f0a-e97f-46fd-8d20-3dff6743e961"
|
327
|
+
},
|
328
|
+
{
|
329
|
+
"href": "https://api-sandbox.pmp.io/docs/4c41b1e6-ec3e-4fc8-848e-132445493cd8"
|
330
|
+
},
|
331
|
+
{
|
332
|
+
"href": "https://api-sandbox.pmp.io/docs/458cfa66-79c5-4769-8e3d-e4540d59e8d9"
|
333
|
+
}
|
334
|
+
],
|
335
|
+
"navigation": [
|
336
|
+
{
|
337
|
+
"href": "https://api-sandbox.pmp.io/docs?tag=pmp_example_permissions_test_doc",
|
338
|
+
"rels": [
|
339
|
+
"urn:pmp:navigation:self"
|
340
|
+
],
|
341
|
+
"totalitems": 3,
|
342
|
+
"totalpages": 1,
|
343
|
+
"pagenum": 1
|
344
|
+
}
|
345
|
+
],
|
346
|
+
"query": [
|
347
|
+
{
|
348
|
+
"href-template": "https://api-sandbox.pmp.io/users{?limit,offset,tag,collection,text,searchsort,has}",
|
349
|
+
"title": "Query for users",
|
350
|
+
"rels": [
|
351
|
+
"urn:pmp:query:users"
|
352
|
+
],
|
353
|
+
"href-vars": {
|
354
|
+
"limit": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
355
|
+
"offset": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
356
|
+
"tag": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
357
|
+
"collection": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
358
|
+
"text": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
359
|
+
"searchsort": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
360
|
+
"has": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval"
|
361
|
+
},
|
362
|
+
"hints": {
|
363
|
+
"allow": [
|
364
|
+
"GET"
|
365
|
+
]
|
366
|
+
}
|
367
|
+
},
|
368
|
+
{
|
369
|
+
"href-template": "https://api-sandbox.pmp.io/groups{?limit,offset,tag,collection,text,searchsort,has}",
|
370
|
+
"title": "Query for groups",
|
371
|
+
"rels": [
|
372
|
+
"urn:pmp:query:groups"
|
373
|
+
],
|
374
|
+
"href-vars": {
|
375
|
+
"limit": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
376
|
+
"offset": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
377
|
+
"tag": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
378
|
+
"collection": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
379
|
+
"text": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
380
|
+
"searchsort": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval"
|
381
|
+
},
|
382
|
+
"hints": {
|
383
|
+
"allow": [
|
384
|
+
"GET"
|
385
|
+
]
|
386
|
+
}
|
387
|
+
},
|
388
|
+
{
|
389
|
+
"href-template": "https://api-sandbox.pmp.io/profiles{/guid}",
|
390
|
+
"title": "Access profiles",
|
391
|
+
"rels": [
|
392
|
+
"urn:pmp:hreftpl:profiles"
|
393
|
+
],
|
394
|
+
"href-vars": {
|
395
|
+
"guid": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval"
|
396
|
+
},
|
397
|
+
"hints": {
|
398
|
+
"allow": [
|
399
|
+
"GET"
|
400
|
+
]
|
401
|
+
}
|
402
|
+
},
|
403
|
+
{
|
404
|
+
"href-template": "https://api-sandbox.pmp.io/schemas{/guid}",
|
405
|
+
"title": "Access schemas",
|
406
|
+
"rels": [
|
407
|
+
"urn:pmp:hreftpl:schemas"
|
408
|
+
],
|
409
|
+
"href-vars": {
|
410
|
+
"guid": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval"
|
411
|
+
},
|
412
|
+
"hints": {
|
413
|
+
"allow": [
|
414
|
+
"GET"
|
415
|
+
]
|
416
|
+
},
|
417
|
+
"type": "application/schema+json"
|
418
|
+
},
|
419
|
+
{
|
420
|
+
"href-template": "https://api-sandbox.pmp.io/docs{/guid}{?limit,offset}",
|
421
|
+
"title": "Access documents",
|
422
|
+
"rels": [
|
423
|
+
"urn:pmp:hreftpl:docs"
|
424
|
+
],
|
425
|
+
"href-vars": {
|
426
|
+
"guid": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
427
|
+
"limit": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
428
|
+
"offset": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval"
|
429
|
+
},
|
430
|
+
"hints": {
|
431
|
+
"allow": [
|
432
|
+
"GET"
|
433
|
+
]
|
434
|
+
}
|
435
|
+
},
|
436
|
+
{
|
437
|
+
"href-template": "https://api-sandbox.pmp.io/docs{?limit,offset,tag,collection,text,searchsort,has,author,distributor,distributorgroup,startdate,enddate,profile,language}",
|
438
|
+
"title": "Query for documents",
|
439
|
+
"rels": [
|
440
|
+
"urn:pmp:query:docs"
|
441
|
+
],
|
442
|
+
"href-vars": {
|
443
|
+
"limit": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
444
|
+
"offset": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
445
|
+
"tag": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
446
|
+
"collection": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
447
|
+
"text": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
448
|
+
"searchsort": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
449
|
+
"has": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
450
|
+
"author": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
451
|
+
"distributor": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
452
|
+
"distributorgroup": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
453
|
+
"startdate": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
454
|
+
"enddate": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
455
|
+
"profile": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
456
|
+
"language": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval"
|
457
|
+
},
|
458
|
+
"hints": {
|
459
|
+
"allow": [
|
460
|
+
"GET"
|
461
|
+
]
|
462
|
+
}
|
463
|
+
},
|
464
|
+
{
|
465
|
+
"href": "https://api-sandbox.pmp.io/guids",
|
466
|
+
"title": "Generate guids",
|
467
|
+
"rels": [
|
468
|
+
"urn:pmp:query:guids"
|
469
|
+
],
|
470
|
+
"hints": {
|
471
|
+
"allow": [
|
472
|
+
"POST"
|
473
|
+
],
|
474
|
+
"accept-post": [
|
475
|
+
"application/x-www-form-urlencoded"
|
476
|
+
]
|
477
|
+
},
|
478
|
+
"type": "application/json"
|
479
|
+
}
|
480
|
+
],
|
481
|
+
"edit": [
|
482
|
+
{
|
483
|
+
"href-template": "https://publish-sandbox.pmp.io/docs{/guid}",
|
484
|
+
"title": "Document Save",
|
485
|
+
"rels": [
|
486
|
+
"urn:pmp:form:documentsave"
|
487
|
+
],
|
488
|
+
"href-vars": {
|
489
|
+
"guid": "https://github.com/publicmediaplatform/pmpdocs/wiki/Globaly-Unique-Identifiers-for-PMP-Documents"
|
490
|
+
},
|
491
|
+
"hints": {
|
492
|
+
"formats": [
|
493
|
+
"application/vnd.pmp.collection.doc+json"
|
494
|
+
],
|
495
|
+
"allow": [
|
496
|
+
"PUT",
|
497
|
+
"DELETE"
|
498
|
+
],
|
499
|
+
"docs": "https://github.com/publicmediaplatform/pmpdocs/wiki/Collection.doc-JSON-Media-Type"
|
500
|
+
}
|
501
|
+
},
|
502
|
+
{
|
503
|
+
"href-template": "https://publish-sandbox.pmp.io/profiles{/guid}",
|
504
|
+
"title": "Profile Save",
|
505
|
+
"rels": [
|
506
|
+
"urn:pmp:form:profilesave"
|
507
|
+
],
|
508
|
+
"href-vars": {
|
509
|
+
"guid": "https://github.com/publicmediaplatform/pmpdocs/wiki/Globaly-Unique-Identifiers-for-PMP-Documents"
|
510
|
+
},
|
511
|
+
"hints": {
|
512
|
+
"formats": [
|
513
|
+
"application/vnd.pmp.collection.doc+json"
|
514
|
+
],
|
515
|
+
"allow": [
|
516
|
+
"PUT",
|
517
|
+
"DELETE"
|
518
|
+
],
|
519
|
+
"docs": "https://github.com/publicmediaplatform/pmpdocs/wiki/Profile-profile"
|
520
|
+
}
|
521
|
+
},
|
522
|
+
{
|
523
|
+
"href-template": "https://publish-sandbox.pmp.io/schemas{/guid}",
|
524
|
+
"title": "Schema Save",
|
525
|
+
"rels": [
|
526
|
+
"urn:pmp:form:schemasave"
|
527
|
+
],
|
528
|
+
"href-vars": {
|
529
|
+
"guid": "https://github.com/publicmediaplatform/pmpdocs/wiki/Globaly-Unique-Identifiers-for-PMP-Documents"
|
530
|
+
},
|
531
|
+
"hints": {
|
532
|
+
"formats": [
|
533
|
+
"application/schema+json"
|
534
|
+
],
|
535
|
+
"allow": [
|
536
|
+
"PUT",
|
537
|
+
"DELETE"
|
538
|
+
],
|
539
|
+
"docs": "http://json-schema.org/"
|
540
|
+
}
|
541
|
+
},
|
542
|
+
{
|
543
|
+
"href": "https://publish-sandbox.pmp.io/files",
|
544
|
+
"title": "Upload a rich media file",
|
545
|
+
"rels": [
|
546
|
+
"urn:pmp:form:mediaupload"
|
547
|
+
],
|
548
|
+
"href-vars": {
|
549
|
+
"submission": "https://github.com/publicmediaplatform/pmpdocs/wiki/Media-File-Upload"
|
550
|
+
},
|
551
|
+
"hints": {
|
552
|
+
"allow": [
|
553
|
+
"POST"
|
554
|
+
],
|
555
|
+
"accept-post": [
|
556
|
+
"multipart/form-data"
|
557
|
+
]
|
558
|
+
}
|
559
|
+
}
|
560
|
+
]
|
561
|
+
},
|
562
|
+
"attributes": {
|
563
|
+
"valid": {
|
564
|
+
"from": "2013-10-25T16:06:38+00:00",
|
565
|
+
"to": "3013-10-25T16:06:38+00:00"
|
566
|
+
},
|
567
|
+
"created": "2013-10-25T16:06:38+00:00",
|
568
|
+
"modified": "2013-10-25T16:06:38+00:00"
|
569
|
+
}
|
570
|
+
}
|
571
|
+
|
572
|
+
org 1 should retrieve 2 items
|
573
|
+
org 1 got token: c7ee185495f4d4fe2a508fa1
|
574
|
+
waiting.....
|
575
|
+
SUCCESS: org 1 retrieved 2 items, expected 2.
|
576
|
+
retrieved: {
|
577
|
+
"version": "1.0",
|
578
|
+
"links": {
|
579
|
+
"item": [
|
580
|
+
{
|
581
|
+
"href": "https://api-sandbox.pmp.io/docs/17195f0a-e97f-46fd-8d20-3dff6743e961"
|
582
|
+
},
|
583
|
+
{
|
584
|
+
"href": "https://api-sandbox.pmp.io/docs/458cfa66-79c5-4769-8e3d-e4540d59e8d9"
|
585
|
+
}
|
586
|
+
],
|
587
|
+
"navigation": [
|
588
|
+
{
|
589
|
+
"href": "https://api-sandbox.pmp.io/docs?tag=pmp_example_permissions_test_doc",
|
590
|
+
"rels": [
|
591
|
+
"urn:pmp:navigation:self"
|
592
|
+
],
|
593
|
+
"totalitems": 2,
|
594
|
+
"totalpages": 1,
|
595
|
+
"pagenum": 1
|
596
|
+
}
|
597
|
+
],
|
598
|
+
"query": [
|
599
|
+
{
|
600
|
+
"href-template": "https://api-sandbox.pmp.io/users{?limit,offset,tag,collection,text,searchsort,has}",
|
601
|
+
"title": "Query for users",
|
602
|
+
"rels": [
|
603
|
+
"urn:pmp:query:users"
|
604
|
+
],
|
605
|
+
"href-vars": {
|
606
|
+
"limit": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
607
|
+
"offset": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
608
|
+
"tag": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
609
|
+
"collection": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
610
|
+
"text": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
611
|
+
"searchsort": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
612
|
+
"has": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval"
|
613
|
+
},
|
614
|
+
"hints": {
|
615
|
+
"allow": [
|
616
|
+
"GET"
|
617
|
+
]
|
618
|
+
}
|
619
|
+
},
|
620
|
+
{
|
621
|
+
"href-template": "https://api-sandbox.pmp.io/groups{?limit,offset,tag,collection,text,searchsort,has}",
|
622
|
+
"title": "Query for groups",
|
623
|
+
"rels": [
|
624
|
+
"urn:pmp:query:groups"
|
625
|
+
],
|
626
|
+
"href-vars": {
|
627
|
+
"limit": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
628
|
+
"offset": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
629
|
+
"tag": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
630
|
+
"collection": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
631
|
+
"text": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
632
|
+
"searchsort": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval"
|
633
|
+
},
|
634
|
+
"hints": {
|
635
|
+
"allow": [
|
636
|
+
"GET"
|
637
|
+
]
|
638
|
+
}
|
639
|
+
},
|
640
|
+
{
|
641
|
+
"href-template": "https://api-sandbox.pmp.io/profiles{/guid}",
|
642
|
+
"title": "Access profiles",
|
643
|
+
"rels": [
|
644
|
+
"urn:pmp:hreftpl:profiles"
|
645
|
+
],
|
646
|
+
"href-vars": {
|
647
|
+
"guid": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval"
|
648
|
+
},
|
649
|
+
"hints": {
|
650
|
+
"allow": [
|
651
|
+
"GET"
|
652
|
+
]
|
653
|
+
}
|
654
|
+
},
|
655
|
+
{
|
656
|
+
"href-template": "https://api-sandbox.pmp.io/schemas{/guid}",
|
657
|
+
"title": "Access schemas",
|
658
|
+
"rels": [
|
659
|
+
"urn:pmp:hreftpl:schemas"
|
660
|
+
],
|
661
|
+
"href-vars": {
|
662
|
+
"guid": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval"
|
663
|
+
},
|
664
|
+
"hints": {
|
665
|
+
"allow": [
|
666
|
+
"GET"
|
667
|
+
]
|
668
|
+
},
|
669
|
+
"type": "application/schema+json"
|
670
|
+
},
|
671
|
+
{
|
672
|
+
"href-template": "https://api-sandbox.pmp.io/docs{/guid}{?limit,offset}",
|
673
|
+
"title": "Access documents",
|
674
|
+
"rels": [
|
675
|
+
"urn:pmp:hreftpl:docs"
|
676
|
+
],
|
677
|
+
"href-vars": {
|
678
|
+
"guid": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
679
|
+
"limit": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
680
|
+
"offset": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval"
|
681
|
+
},
|
682
|
+
"hints": {
|
683
|
+
"allow": [
|
684
|
+
"GET"
|
685
|
+
]
|
686
|
+
}
|
687
|
+
},
|
688
|
+
{
|
689
|
+
"href-template": "https://api-sandbox.pmp.io/docs{?limit,offset,tag,collection,text,searchsort,has,author,distributor,distributorgroup,startdate,enddate,profile,language}",
|
690
|
+
"title": "Query for documents",
|
691
|
+
"rels": [
|
692
|
+
"urn:pmp:query:docs"
|
693
|
+
],
|
694
|
+
"href-vars": {
|
695
|
+
"limit": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
696
|
+
"offset": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
697
|
+
"tag": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
698
|
+
"collection": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
699
|
+
"text": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
700
|
+
"searchsort": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
701
|
+
"has": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
702
|
+
"author": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
703
|
+
"distributor": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
704
|
+
"distributorgroup": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
705
|
+
"startdate": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
706
|
+
"enddate": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
707
|
+
"profile": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
708
|
+
"language": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval"
|
709
|
+
},
|
710
|
+
"hints": {
|
711
|
+
"allow": [
|
712
|
+
"GET"
|
713
|
+
]
|
714
|
+
}
|
715
|
+
},
|
716
|
+
{
|
717
|
+
"href": "https://api-sandbox.pmp.io/guids",
|
718
|
+
"title": "Generate guids",
|
719
|
+
"rels": [
|
720
|
+
"urn:pmp:query:guids"
|
721
|
+
],
|
722
|
+
"hints": {
|
723
|
+
"allow": [
|
724
|
+
"POST"
|
725
|
+
],
|
726
|
+
"accept-post": [
|
727
|
+
"application/x-www-form-urlencoded"
|
728
|
+
]
|
729
|
+
},
|
730
|
+
"type": "application/json"
|
731
|
+
}
|
732
|
+
],
|
733
|
+
"edit": [
|
734
|
+
{
|
735
|
+
"href-template": "https://publish-sandbox.pmp.io/docs{/guid}",
|
736
|
+
"title": "Document Save",
|
737
|
+
"rels": [
|
738
|
+
"urn:pmp:form:documentsave"
|
739
|
+
],
|
740
|
+
"href-vars": {
|
741
|
+
"guid": "https://github.com/publicmediaplatform/pmpdocs/wiki/Globaly-Unique-Identifiers-for-PMP-Documents"
|
742
|
+
},
|
743
|
+
"hints": {
|
744
|
+
"formats": [
|
745
|
+
"application/vnd.pmp.collection.doc+json"
|
746
|
+
],
|
747
|
+
"allow": [
|
748
|
+
"PUT",
|
749
|
+
"DELETE"
|
750
|
+
],
|
751
|
+
"docs": "https://github.com/publicmediaplatform/pmpdocs/wiki/Collection.doc-JSON-Media-Type"
|
752
|
+
}
|
753
|
+
},
|
754
|
+
{
|
755
|
+
"href-template": "https://publish-sandbox.pmp.io/profiles{/guid}",
|
756
|
+
"title": "Profile Save",
|
757
|
+
"rels": [
|
758
|
+
"urn:pmp:form:profilesave"
|
759
|
+
],
|
760
|
+
"href-vars": {
|
761
|
+
"guid": "https://github.com/publicmediaplatform/pmpdocs/wiki/Globaly-Unique-Identifiers-for-PMP-Documents"
|
762
|
+
},
|
763
|
+
"hints": {
|
764
|
+
"formats": [
|
765
|
+
"application/vnd.pmp.collection.doc+json"
|
766
|
+
],
|
767
|
+
"allow": [
|
768
|
+
"PUT",
|
769
|
+
"DELETE"
|
770
|
+
],
|
771
|
+
"docs": "https://github.com/publicmediaplatform/pmpdocs/wiki/Profile-profile"
|
772
|
+
}
|
773
|
+
},
|
774
|
+
{
|
775
|
+
"href-template": "https://publish-sandbox.pmp.io/schemas{/guid}",
|
776
|
+
"title": "Schema Save",
|
777
|
+
"rels": [
|
778
|
+
"urn:pmp:form:schemasave"
|
779
|
+
],
|
780
|
+
"href-vars": {
|
781
|
+
"guid": "https://github.com/publicmediaplatform/pmpdocs/wiki/Globaly-Unique-Identifiers-for-PMP-Documents"
|
782
|
+
},
|
783
|
+
"hints": {
|
784
|
+
"formats": [
|
785
|
+
"application/schema+json"
|
786
|
+
],
|
787
|
+
"allow": [
|
788
|
+
"PUT",
|
789
|
+
"DELETE"
|
790
|
+
],
|
791
|
+
"docs": "http://json-schema.org/"
|
792
|
+
}
|
793
|
+
},
|
794
|
+
{
|
795
|
+
"href": "https://publish-sandbox.pmp.io/files",
|
796
|
+
"title": "Upload a rich media file",
|
797
|
+
"rels": [
|
798
|
+
"urn:pmp:form:mediaupload"
|
799
|
+
],
|
800
|
+
"href-vars": {
|
801
|
+
"submission": "https://github.com/publicmediaplatform/pmpdocs/wiki/Media-File-Upload"
|
802
|
+
},
|
803
|
+
"hints": {
|
804
|
+
"allow": [
|
805
|
+
"POST"
|
806
|
+
],
|
807
|
+
"accept-post": [
|
808
|
+
"multipart/form-data"
|
809
|
+
]
|
810
|
+
}
|
811
|
+
}
|
812
|
+
]
|
813
|
+
},
|
814
|
+
"attributes": {
|
815
|
+
"valid": {
|
816
|
+
"from": "2013-10-25T16:06:44+00:00",
|
817
|
+
"to": "3013-10-25T16:06:44+00:00"
|
818
|
+
},
|
819
|
+
"created": "2013-10-25T16:06:44+00:00",
|
820
|
+
"modified": "2013-10-25T16:06:44+00:00"
|
821
|
+
}
|
822
|
+
}
|
823
|
+
|
824
|
+
org 2 should retrieve 1 items
|
825
|
+
org 2 got token: 183ad3f013df12884e7e8d3f
|
826
|
+
waiting.....
|
827
|
+
SUCCESS: org 2 retrieved 1 items, expected 1.
|
828
|
+
retrieved: {
|
829
|
+
"version": "1.0",
|
830
|
+
"links": {
|
831
|
+
"item": [
|
832
|
+
{
|
833
|
+
"href": "https://api-sandbox.pmp.io/docs/17195f0a-e97f-46fd-8d20-3dff6743e961"
|
834
|
+
}
|
835
|
+
],
|
836
|
+
"navigation": [
|
837
|
+
{
|
838
|
+
"href": "https://api-sandbox.pmp.io/docs?tag=pmp_example_permissions_test_doc",
|
839
|
+
"rels": [
|
840
|
+
"urn:pmp:navigation:self"
|
841
|
+
],
|
842
|
+
"totalitems": 1,
|
843
|
+
"totalpages": 1,
|
844
|
+
"pagenum": 1
|
845
|
+
}
|
846
|
+
],
|
847
|
+
"query": [
|
848
|
+
{
|
849
|
+
"href-template": "https://api-sandbox.pmp.io/users{?limit,offset,tag,collection,text,searchsort,has}",
|
850
|
+
"title": "Query for users",
|
851
|
+
"rels": [
|
852
|
+
"urn:pmp:query:users"
|
853
|
+
],
|
854
|
+
"href-vars": {
|
855
|
+
"limit": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
856
|
+
"offset": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
857
|
+
"tag": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
858
|
+
"collection": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
859
|
+
"text": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
860
|
+
"searchsort": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
861
|
+
"has": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval"
|
862
|
+
},
|
863
|
+
"hints": {
|
864
|
+
"allow": [
|
865
|
+
"GET"
|
866
|
+
]
|
867
|
+
}
|
868
|
+
},
|
869
|
+
{
|
870
|
+
"href-template": "https://api-sandbox.pmp.io/groups{?limit,offset,tag,collection,text,searchsort,has}",
|
871
|
+
"title": "Query for groups",
|
872
|
+
"rels": [
|
873
|
+
"urn:pmp:query:groups"
|
874
|
+
],
|
875
|
+
"href-vars": {
|
876
|
+
"limit": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
877
|
+
"offset": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
878
|
+
"tag": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
879
|
+
"collection": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
880
|
+
"text": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
881
|
+
"searchsort": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval"
|
882
|
+
},
|
883
|
+
"hints": {
|
884
|
+
"allow": [
|
885
|
+
"GET"
|
886
|
+
]
|
887
|
+
}
|
888
|
+
},
|
889
|
+
{
|
890
|
+
"href-template": "https://api-sandbox.pmp.io/profiles{/guid}",
|
891
|
+
"title": "Access profiles",
|
892
|
+
"rels": [
|
893
|
+
"urn:pmp:hreftpl:profiles"
|
894
|
+
],
|
895
|
+
"href-vars": {
|
896
|
+
"guid": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval"
|
897
|
+
},
|
898
|
+
"hints": {
|
899
|
+
"allow": [
|
900
|
+
"GET"
|
901
|
+
]
|
902
|
+
}
|
903
|
+
},
|
904
|
+
{
|
905
|
+
"href-template": "https://api-sandbox.pmp.io/schemas{/guid}",
|
906
|
+
"title": "Access schemas",
|
907
|
+
"rels": [
|
908
|
+
"urn:pmp:hreftpl:schemas"
|
909
|
+
],
|
910
|
+
"href-vars": {
|
911
|
+
"guid": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval"
|
912
|
+
},
|
913
|
+
"hints": {
|
914
|
+
"allow": [
|
915
|
+
"GET"
|
916
|
+
]
|
917
|
+
},
|
918
|
+
"type": "application/schema+json"
|
919
|
+
},
|
920
|
+
{
|
921
|
+
"href-template": "https://api-sandbox.pmp.io/docs{/guid}{?limit,offset}",
|
922
|
+
"title": "Access documents",
|
923
|
+
"rels": [
|
924
|
+
"urn:pmp:hreftpl:docs"
|
925
|
+
],
|
926
|
+
"href-vars": {
|
927
|
+
"guid": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
928
|
+
"limit": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
929
|
+
"offset": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval"
|
930
|
+
},
|
931
|
+
"hints": {
|
932
|
+
"allow": [
|
933
|
+
"GET"
|
934
|
+
]
|
935
|
+
}
|
936
|
+
},
|
937
|
+
{
|
938
|
+
"href-template": "https://api-sandbox.pmp.io/docs{?limit,offset,tag,collection,text,searchsort,has,author,distributor,distributorgroup,startdate,enddate,profile,language}",
|
939
|
+
"title": "Query for documents",
|
940
|
+
"rels": [
|
941
|
+
"urn:pmp:query:docs"
|
942
|
+
],
|
943
|
+
"href-vars": {
|
944
|
+
"limit": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
945
|
+
"offset": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
946
|
+
"tag": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
947
|
+
"collection": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
948
|
+
"text": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
949
|
+
"searchsort": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
950
|
+
"has": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
951
|
+
"author": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
952
|
+
"distributor": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
953
|
+
"distributorgroup": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
954
|
+
"startdate": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
955
|
+
"enddate": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
956
|
+
"profile": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval",
|
957
|
+
"language": "https://github.com/publicmediaplatform/pmpdocs/wiki/Content-Retrieval"
|
958
|
+
},
|
959
|
+
"hints": {
|
960
|
+
"allow": [
|
961
|
+
"GET"
|
962
|
+
]
|
963
|
+
}
|
964
|
+
},
|
965
|
+
{
|
966
|
+
"href": "https://api-sandbox.pmp.io/guids",
|
967
|
+
"title": "Generate guids",
|
968
|
+
"rels": [
|
969
|
+
"urn:pmp:query:guids"
|
970
|
+
],
|
971
|
+
"hints": {
|
972
|
+
"allow": [
|
973
|
+
"POST"
|
974
|
+
],
|
975
|
+
"accept-post": [
|
976
|
+
"application/x-www-form-urlencoded"
|
977
|
+
]
|
978
|
+
},
|
979
|
+
"type": "application/json"
|
980
|
+
}
|
981
|
+
],
|
982
|
+
"edit": [
|
983
|
+
{
|
984
|
+
"href-template": "https://publish-sandbox.pmp.io/docs{/guid}",
|
985
|
+
"title": "Document Save",
|
986
|
+
"rels": [
|
987
|
+
"urn:pmp:form:documentsave"
|
988
|
+
],
|
989
|
+
"href-vars": {
|
990
|
+
"guid": "https://github.com/publicmediaplatform/pmpdocs/wiki/Globaly-Unique-Identifiers-for-PMP-Documents"
|
991
|
+
},
|
992
|
+
"hints": {
|
993
|
+
"formats": [
|
994
|
+
"application/vnd.pmp.collection.doc+json"
|
995
|
+
],
|
996
|
+
"allow": [
|
997
|
+
"PUT",
|
998
|
+
"DELETE"
|
999
|
+
],
|
1000
|
+
"docs": "https://github.com/publicmediaplatform/pmpdocs/wiki/Collection.doc-JSON-Media-Type"
|
1001
|
+
}
|
1002
|
+
},
|
1003
|
+
{
|
1004
|
+
"href-template": "https://publish-sandbox.pmp.io/profiles{/guid}",
|
1005
|
+
"title": "Profile Save",
|
1006
|
+
"rels": [
|
1007
|
+
"urn:pmp:form:profilesave"
|
1008
|
+
],
|
1009
|
+
"href-vars": {
|
1010
|
+
"guid": "https://github.com/publicmediaplatform/pmpdocs/wiki/Globaly-Unique-Identifiers-for-PMP-Documents"
|
1011
|
+
},
|
1012
|
+
"hints": {
|
1013
|
+
"formats": [
|
1014
|
+
"application/vnd.pmp.collection.doc+json"
|
1015
|
+
],
|
1016
|
+
"allow": [
|
1017
|
+
"PUT",
|
1018
|
+
"DELETE"
|
1019
|
+
],
|
1020
|
+
"docs": "https://github.com/publicmediaplatform/pmpdocs/wiki/Profile-profile"
|
1021
|
+
}
|
1022
|
+
},
|
1023
|
+
{
|
1024
|
+
"href-template": "https://publish-sandbox.pmp.io/schemas{/guid}",
|
1025
|
+
"title": "Schema Save",
|
1026
|
+
"rels": [
|
1027
|
+
"urn:pmp:form:schemasave"
|
1028
|
+
],
|
1029
|
+
"href-vars": {
|
1030
|
+
"guid": "https://github.com/publicmediaplatform/pmpdocs/wiki/Globaly-Unique-Identifiers-for-PMP-Documents"
|
1031
|
+
},
|
1032
|
+
"hints": {
|
1033
|
+
"formats": [
|
1034
|
+
"application/schema+json"
|
1035
|
+
],
|
1036
|
+
"allow": [
|
1037
|
+
"PUT",
|
1038
|
+
"DELETE"
|
1039
|
+
],
|
1040
|
+
"docs": "http://json-schema.org/"
|
1041
|
+
}
|
1042
|
+
},
|
1043
|
+
{
|
1044
|
+
"href": "https://publish-sandbox.pmp.io/files",
|
1045
|
+
"title": "Upload a rich media file",
|
1046
|
+
"rels": [
|
1047
|
+
"urn:pmp:form:mediaupload"
|
1048
|
+
],
|
1049
|
+
"href-vars": {
|
1050
|
+
"submission": "https://github.com/publicmediaplatform/pmpdocs/wiki/Media-File-Upload"
|
1051
|
+
},
|
1052
|
+
"hints": {
|
1053
|
+
"allow": [
|
1054
|
+
"POST"
|
1055
|
+
],
|
1056
|
+
"accept-post": [
|
1057
|
+
"multipart/form-data"
|
1058
|
+
]
|
1059
|
+
}
|
1060
|
+
}
|
1061
|
+
]
|
1062
|
+
},
|
1063
|
+
"attributes": {
|
1064
|
+
"valid": {
|
1065
|
+
"from": "2013-10-25T16:06:51+00:00",
|
1066
|
+
"to": "3013-10-25T16:06:51+00:00"
|
1067
|
+
},
|
1068
|
+
"created": "2013-10-25T16:06:51+00:00",
|
1069
|
+
"modified": "2013-10-25T16:06:51+00:00"
|
1070
|
+
}
|
1071
|
+
}
|
1072
|
+
|
1073
|
+
|
1074
|
+
|
1075
|
+
Step 5 complete, all done!
|
1076
|
+
|
1077
|
+
[12:06:55][andrew][~/dev/projects/pmp/pmp]>
|