1
+ # Create/register a pid record.
2
+ # As we use the Typed PID Maker, it must be valid, otherwise it will not work.
3
+ POST http://localhost:8090/api/v1/pit/pid/
4
+ Content-Type: application/vnd.datamanager.pid.simple+json
5
+ Accept: application/vnd.datamanager.pid.simple+json
6
+ {
7
+ "record": [
8
+ { "key": "21.T11148/076759916209e5d62bd5", "value": "21.T11148/301c6f04763a16f0f72a" },
9
+ { "key": "21.T11148/397d831aa3a9d18eb52c", "value": "2021-12-21T17:36:09.541+00:00" },
10
+ { "key": "21.T11148/8074aed799118ac263ad", "value": "21.T11148/37d0f4689c6ea3301787" },
11
+ { "key": "21.T11148/92e200311a56800b3e47", "value": "{ \"sha256sum\": \"sha256 c50624fd5ddd2b9652b72e2d2eabcb31a54b777718ab6fb7e44b582c20239a7c\" }" },
12
+ { "key": "21.T11148/aafd5fb4c7222e2d950a", "value": "2021-12-21T17:36:09.541+00:00" },
13
+ { "key": "21.T11148/b8457812905b83046284", "value": "https://test.repo/file001" },
14
+ { "key": "21.T11148/c692273deb2772da307f", "value": "1.0.0" },
15
+ { "key": "21.T11148/c83481d4bf467110e7c9", "value": "21.T11148/ManuscriptPage" }
16
+ ]
17
+ }
18
+
19
+ # on success, we get a 201
20
+ HTTP 201
21
+ # in the response body, you'll get the record and the pid
22
+ [Captures]
23
+ pid: jsonpath "$.pid"
24
+
25
+ # if we resolve the pid...
26
+ GET http://localhost:8090/api/v1/pit/pid/{{pid}}?validation=true
27
+ Accept: application/vnd.datamanager.pid.simple+json
28
+
29
+ # on validation fail, we get 400 instead of 200
30
+ # unfortunately we can (by default) not create invalid PIDs using the Typed PID Maker,
31
+ # so we can not properly demonstrate it here, as long as it is in sandboxed mode.
32
+ # This limitation is being worked on (current version at the time of writing is 2.0.0):
33
+ # In future we plan to allow resolving all kinds of real PIDs even in sandboxed mode.
34
+ HTTP 200
0 commit comments