@@ -36,22 +36,74 @@ That's it configuration-wise. If we try to create a record through the API, your
36
36
Did the changes work? We are going to try to create a new record:
37
37
38
38
``` console
39
- $ curl -k -XPOST -H " Content-Type: application/json" https://localhost:5000/api/records/ -d '
40
- {
41
- "access": {
42
- "metadata_restricted": "false",
43
- "files_restricted": "false"
39
+ $ curl -k -XPOST -H " Content-Type: application/json" https://localhost:5000/api/records/ -d ' {
40
+ "_access": {
41
+ "metadata_restricted": false,
42
+ "files_restricted": false
43
+ },
44
+ "_owners": [1],
45
+ "_created_by": 1,
46
+ "access_right": "open",
47
+ "resource_type": {
48
+ "type": "image",
49
+ "subtype": "photo"
50
+ },
51
+ "identifiers": [
52
+ {
53
+ "identifier": "10.9999/rdm.9999999",
54
+ "scheme": "DOI"
55
+ }, {
56
+ "identifier": "9999.99999",
57
+ "scheme": "arXiv"
58
+ }
59
+ ],
60
+ "creators": [
61
+ {
62
+ "name": "Julio Cesar",
63
+ "type": "Personal",
64
+ "given_name": "Julio",
65
+ "family_name": "Cesar",
66
+ "identifiers": [
67
+ {
68
+ "identifier": "9999-9999-9999-9999",
69
+ "scheme": "Orcid"
70
+ }
71
+ ],
72
+ "affiliations": [
73
+ {
74
+ "name": "Entity One",
75
+ "identifier": "entity-one",
76
+ "scheme": "entity-id-scheme"
77
+ }
78
+ ]
79
+ }
80
+ ],
81
+ "titles": [
82
+ {
83
+ "title": "A Romans story",
84
+ "type": "Other",
85
+ "lang": "eng"
86
+ }
87
+ ],
88
+ "descriptions": [
89
+ {
90
+ "description": "A story on how Julio Cesar relates to Gladiator.",
91
+ "type": "Abstract",
92
+ "lang": "eng"
93
+ }
94
+ ],
95
+ "community": {
96
+ "primary": "Maincom",
97
+ "secondary": ["Subcom One", "Subcom Two"]
44
98
},
45
- "access_right": "open",
46
- "contributors": [{"name": "Jon Doe"}],
47
- "description": "A Holiday Record description",
48
- "owners": [1],
49
- "publication_date": "25/12/2019",
50
- "resource_type": {
51
- "type": "Dataset",
52
- "subtype": "dataset"
53
- },
54
- "title": "A Holiday Record"
99
+ "licenses": [
100
+ {
101
+ "license": "Berkeley Software Distribution 3",
102
+ "uri": "https://opensource.org/licenses/BSD-3-Clause",
103
+ "identifier": "BSD-3",
104
+ "scheme": "BSD-3"
105
+ }
106
+ ]
55
107
}'
56
108
```
57
109
@@ -88,22 +140,74 @@ Note that this user will have ID 2.
88
140
Afterwards we can test if the new permissions are working correctly.
89
141
90
142
``` console
91
- $ curl -k -XPOST -H " Authorization:Bearer sHHq1K9y7a2v5doKDRSFmSFOxa1tZDHFcbs31npaxm1sFEt27yomLMt0ynkl" -H " Content-Type: application/json" https://localhost:5000/api/records/ -d '
92
- {
93
- "access": {
94
- "metadata_restricted": "false",
95
- "files_restricted": "false"
96
- },
97
- "access_right": "open",
98
- "contributors": [{"name": "Jon Doe"}],
99
- "description": "A Holiday Record description",
100
- "owners": [1],
101
- "publication_date": "25/12/2019",
102
- "resource_type": {
103
- "type": "Dataset",
104
- "subtype": "dataset"
143
+ $ curl -k -XPOST -H " Authorization:Bearer sHHq1K9y7a2v5doKDRSFmSFOxa1tZDHFcbs31npaxm1sFEt27yomLMt0ynkl" -H " Content-Type: application/json" https://localhost:5000/api/records/ -d ' {
144
+ "_access": {
145
+ "metadata_restricted": false,
146
+ "files_restricted": false
147
+ },
148
+ "_owners": [1],
149
+ "_created_by": 1,
150
+ "access_right": "open",
151
+ "resource_type": {
152
+ "type": "image",
153
+ "subtype": "photo"
154
+ },
155
+ "identifiers": [
156
+ {
157
+ "identifier": "10.9999/rdm.9999999",
158
+ "scheme": "DOI"
159
+ }, {
160
+ "identifier": "9999.99999",
161
+ "scheme": "arXiv"
162
+ }
163
+ ],
164
+ "creators": [
165
+ {
166
+ "name": "Julio Cesar",
167
+ "type": "Personal",
168
+ "given_name": "Julio",
169
+ "family_name": "Cesar",
170
+ "identifiers": [
171
+ {
172
+ "identifier": "9999-9999-9999-9999",
173
+ "scheme": "Orcid"
174
+ }
175
+ ],
176
+ "affiliations": [
177
+ {
178
+ "name": "Entity One",
179
+ "identifier": "entity-one",
180
+ "scheme": "entity-id-scheme"
181
+ }
182
+ ]
183
+ }
184
+ ],
185
+ "titles": [
186
+ {
187
+ "title": "A Romans story",
188
+ "type": "Other",
189
+ "lang": "eng"
190
+ }
191
+ ],
192
+ "descriptions": [
193
+ {
194
+ "description": "A story on how Julio Cesar relates to Gladiator.",
195
+ "type": "Abstract",
196
+ "lang": "eng"
197
+ }
198
+ ],
199
+ "community": {
200
+ "primary": "Maincom",
201
+ "secondary": ["Subcom One", "Subcom Two"]
105
202
},
106
- "title": "A Holiday Record"
203
+ "licenses": [
204
+ {
205
+ "license": "Berkeley Software Distribution 3",
206
+ "uri": "https://opensource.org/licenses/BSD-3-Clause",
207
+ "identifier": "BSD-3",
208
+ "scheme": "BSD-3"
209
+ }
210
+ ]
107
211
}'
108
212
```
109
213
0 commit comments