...
Codeblock | ||||
---|---|---|---|---|
| ||||
HTTP/1.1 200 OK Connection: keep-alive Content-Type: application/json Content-Length: 656 Date: Wed, 13 Feb 2019 14:10:41 GMT { "name": "urn:nbn:de:example", "creationDatecreated": "2019-02-13T15:08:55+0100.123Z", "lastModified": "2019-02-13T15:08:55+0100.123Z", "allowsRegistration": true, "owner": "https://api.nbn-resolving.org/sandbox/v2/organisations/id/1", "urnNamingPolicy": "https://api.nbn-resolving.org/sandbox/v2/policies/urn-naming/id/no-check", "urlPolicy": "https://api.nbn-resolving.org/sandbox/v2/policies/url/id/no-check", "comment": null, "resolverUrl": "", "urns": "https://api.nbn-resolving.org/sandbox/v2/namespaces/name/urn:nbn:de:example/urns", "urnSuggestion": "https://api.nbn-resolving.org/sandbox/v2/namespaces/name/urn:nbn:de:example/urn-suggestion", "@idself": "https://api.nbn-resolving.org/sandbox/v2/namespaces/name/urn:nbn:de:example" } |
...
Codeblock | ||||
---|---|---|---|---|
| ||||
HTTP/1.1 200 OK Connection: keep-alive Content-Type: application/json Content-Length: 233 Date: Wed, 13 Feb 2019 14:15:52 GMT { "suggestedUrn": "urn:nbn:de:example-2019021315155244513532", "namespace": "https://api.nbn-resolving.org/sandbox/v2/namespaces/name/urn:nbn:de:example", "@idself": "https://api.nbn-resolving.org/sandbox/v2/namespaces/name/urn:nbn:de:example/urn-suggestion" } |
...
Die Angabe der priority
ist optional. Sie bestimmt bei mehreren URLs in welcher Reihenfolge sie beim Resolving berücksichtigt werden. URLs mit höherer Priorität (d.h einer größeren Zahl) werden vorrangig verwendet (Hinweis: Dies ist im aktuellen NBN-Resolver auf https://nbn-resolving.org/ noch nicht vollständig umgesetzt).
Info |
---|
Das Konzept Priority/Primary wird aktuell bearbeitet. Bitte markieren Sie ausschließlich die am höchsten priorisierte URL mit dem Wert "1". |
Codeblock |
---|
POST /sandbox/v2/urns Authorization: Basic dXJuLXBhcnRuZXI6bWVpbi1wYXNzd29ydA== Content-Type: application/json Accept: application/json { "urn": "urn:nbn:de:example-2019021315155244513532", "urls": [ { "url": "http://example.org/document-url", "priority": 10 } ] } |
...
Codeblock | ||||
---|---|---|---|---|
| ||||
HTTP/1.1 201 Created Connection: keep-alive Location: https://api.nbn-resolving.org/sandbox/v2/urns/urn/urn:nbn:de:example-2019021315155244513532 Content-Type: application/json Content-Length: 527 Date: Wed, 13 Feb 2019 14:32:48 GMT { "urn": "urn:nbn:de:example-2019021315155244513532", "creationDatecreated": "2019-02-13T15:32:48+0100.123Z", "lastModified": "2019-02-13T15:32:48+0100.123Z", "namespace": "https://api.nbn-resolving.org/sandbox/v2/namespaces/name/urn:nbn:de:example", "successor": null, "urls": "https://api.nbn-resolving.org/sandbox/v2/urns/urn/urn:nbn:de:example-2019021315155244513532/urls", "myUrls": "https://api.nbn-resolving.org/sandbox/v2/urns/urn/urn:nbn:de:example-2019021315155244513532/my-urls", "@idself": "https://api.nbn-resolving.org/sandbox/v2/urns/urn/urn:nbn:de:example-2019021315155244513532" } |
...
Mithilfe der URLs in den Feldern @id
, urls
, myUrls
können wir jetzt leicht weitere Abfragen auf der URN vornehmen.
...
Codeblock | ||||
---|---|---|---|---|
| ||||
HTTP/1.1 200 OK Connection: keep-alive Content-Type: application/json Content-Length: 527 Date: Wed, 13 Feb 2019 14:50:27 GMT { "urn": "urn:nbn:de:example-2019021315155244513532", "creationDatecreated": "2019-02-13T15:32:48+0100.123Z", "lastModified": "2019-02-13T15:32:48+0100.123Z", "namespace": "https://api.nbn-resolving.org/sandbox/v2/namespaces/name/urn:nbn:de:example", "successor": null, "urls": "https://api.nbn-resolving.org/sandbox/v2/urns/urn/urn:nbn:de:example-2019021315155244513532/urls", "myUrls": "https://api.nbn-resolving.org/sandbox/v2/urns/urn/urn:nbn:de:example-2019021315155244513532/my-urls", "@idself": "https://api.nbn-resolving.org/sandbox/v2/urns/urn/urn:nbn:de:example-2019021315155244513532" } |
...
Codeblock | ||||
---|---|---|---|---|
| ||||
HTTP/1.1 200 OK Connection: keep-alive Content-Type: application/json Content-Length: 573 Date: Wed, 13 Feb 2019 14:53:08 GMT { "totalItems": 1, "items": [ { "url": "http://example.org/document-url", "creationDatecreated": "2019-02-13T15:32:48+0100.123Z", "lastModified": "2019-02-13T15:32:48+0100.123Z", "urn": "https://api.nbn-resolving.org/sandbox/v2/urns/urn/urn:nbn:de:example-2019021315155244513532", "owner": "https://api.nbn-resolving.org/sandbox/v2/organisations/id/1", "priority": 10, "@idself": "https://api.nbn-resolving.org/sandbox/v2/urns/urn/urn:nbn:de:example-2019021315155244513532/urls/base64/aHR0cDovL2V4YW1wbGUub3JnL2RvY3VtZW50LXVybA==" } ], "@idself": "https://api.nbn-resolving.org/sandbox/v2/urns/urn/urn:nbn:de:example-2019021315155244513532/urls" } |
...
Codeblock | ||||
---|---|---|---|---|
| ||||
HTTP/1.1 200 OK Connection: keep-alive Content-Type: application/json Content-Length: 576 Date: Wed, 13 Feb 2019 14:56:02 GMT { "totalItems": 1, "items": [ { "url": "http://example.org/document-url", "creationDatecreated": "2019-02-13T15:32:48+0100.123Z", "lastModified": "2019-02-13T15:32:48+0100.123Z", "urn": "https://api.nbn-resolving.org/sandbox/v2/urns/urn/urn:nbn:de:example-2019021315155244513532", "owner": "https://api.nbn-resolving.org/sandbox/v2/organisations/id/1", "priority": 10, "@idself": "https://api.nbn-resolving.org/sandbox/v2/urns/urn/urn:nbn:de:example-2019021315155244513532/urls/base64/aHR0cDovL2V4YW1wbGUub3JnL2RvY3VtZW50LXVybA==" } ], "@idself": "https://api.nbn-resolving.org/sandbox/v2/urns/urn/urn:nbn:de:example-2019021315155244513532/my-urls" } |
...
Codeblock | ||||
---|---|---|---|---|
| ||||
HTTP/1.1 200 OK Connection: keep-alive Content-Type: application/json Content-Length: 449 Date: Wed, 13 Feb 2019 15:01:21 GMT { "url": "http://example.org/document-url", "creationDatecreated": "2019-02-13T15:32:48+0100.123Z", "lastModified": "2019-02-13T15:32:48+0100.123Z", "urn": "https://api.nbn-resolving.org/sandbox/v2/urns/urn/urn:nbn:de:example-2019021315155244513532", "owner": "https://api.nbn-resolving.org/sandbox/v2/organisations/id/1", "priority": 10, "@idself": "https://api.nbn-resolving.org/sandbox/v2/urns/urn/urn:nbn:de:example-2019021315155244513532/urls/base64/aHR0cDovL2V4YW1wbGUub3JnL2RvY3VtZW50LXVybA==" } |
...
Codeblock | ||||
---|---|---|---|---|
| ||||
HTTP/1.1 201 Created Connection: keep-alive Location: https://api.nbn-resolving.org/sandbox/v2/urns/urn/urn:nbn:de:example-2019021315155244513532/urls/base64/aHR0cDovL2V4YW1wbGUub3JnL2Fub3RoZXItZG9jdW1lbnQtdXJs Content-Type: application/json Content-Length: 466 Date: Wed, 13 Feb 2019 15:11:15 GMT { "url": "http://example.org/another-document-url", "creationDatecreated": "2019-02-13T16:11:15+0100.123Z", "lastModified": "2019-02-13T16:11:15+0100.123Z", "urn": "https://api.nbn-resolving.org/sandbox/v2/urns/urn/urn:nbn:de:example-2019021315155244513532", "owner": "https://api.nbn-resolving.org/sandbox/v2/organisations/id/1", "priority": 100, "@idself": "https://api.nbn-resolving.org/sandbox/v2/urns/urn/urn:nbn:de:example-2019021315155244513532/urls/base64/aHR0cDovL2V4YW1wbGUub3JnL2Fub3RoZXItZG9jdW1lbnQtdXJs" } |
Als Antwort auf das Anlegen einer neuen URL wird der Status 201 Created
zurückgegeben und die Beschreibung der neuen URL zurückgegeben.
Aktualisieren der Priorität einer URL (Da das Konzept der Priority gerade überarbeitet wird, wird diese Funktion zukünftig nicht mehr benötigt!)
Um die Priorität einer URL zu ändern, kann ein PATCH
-Request auf die jeweilige URL-Ressource unter dem Endpunkt-Muster /urns/urn/<urn>/urls/base64/<url-in-base64>
gemacht werden.
...
Neben dem Hinzufügen und Löschen einzelner URLs bietet die URN-Service API auch die Möglichkeit, alle eigenen URLs durch neue URLs zu ersetzen. Dies geschieht über einen PATCH
-Request an den Endpunkt /urns/urn/<urn>/my-urls
. Der Request muss eine Liste der neuen URLs enthalten. Diese können sich auch teilweise mit den Existierenden überschneiden, falls nur ein Teil der URLs verändert werden soll. Im folgenden Beispiel, soll die existierende URL beibehalten werden, daher ist sie in der Liste enthalten. Allerdings verändern wir ihre Priorität. Zusätzlich registrieren wir eine neue URL. Dabei verzichten wir auf die Angabe der Priorität, sodass die URL die Priorität 0 erhält.
...