/urns/urn/{urn}/urls Resource

URNs managed by the URN-Service.

GET /urns/urn/{urn}/urls

Returns a list of URLs attached to this URN.

Access: Unauthorized (public) access allowed.

Request Parameters
name type description constraints
urn path whose URLs are queried. required
runas query optional login name whose identity is used to execute the request (only available to users with the RunAs privilege)  
Response Codes
code condition
200 if the request was completed successfully
401 if the user is not authenticated (error code 401001)
404 if the URN is not registered (error code 404001)
Response Body
media type data type description
application/json Collection (JSON) a Collection of Urls.

Example

Request
GET /urns/urn/{urn}/urls
Content-Type: */*
Accept: application/json

                
...
                
              
Response
HTTP/1.1 200 OK
Content-Type: application/json

                
{
  "self" : "http://example.org/collection",
  "totalItems" : 42,
  "items" : [ { }, { } ]
}
                
              

POST /urns/urn/{urn}/urls

Registers a new URL.

Access: Logged in organisations only.

Request Parameters
name type description constraints
urn path to which the URL is added required
runas query optional login name whose identity is used to execute the request (only available to users with the RunAs privilege)  
Request Body
media type data type description
application/json CreateUrlRequest (JSON) the registration details for the new URL
Response Codes
code condition
201 if the URL was registered successfully
400
  • if mandatory fields are missing in the request (error code 400005),
  • if a field is not valid (error code 400007), or
  • if the organisation could not be found (error code 400009).
401 if the user is not authenticated (error code 401001)
403 if the user is not authorized to register
  • URLs (error code 403001) or
  • URLs on URNs which have a successor (error code 403001)
409 if the URL is already registered (error code 409001)
Response Body
media type data type description
application/json Url (JSON) the registration information of the new URL
Response Headers
name description
Location URI pointing to the new URL

Example

Request
POST /urns/urn/{urn}/urls
Content-Type: application/json
Accept: application/json

                
{
  "url" : "http://example.org/the-document.pdf",
  "owner" : "http://example.org/organisations/id/1516",
  "priority" : 100
}
                
              
Response
HTTP/1.1 201 Created
Content-Type: application/json
Location: ...

                
{
  "self" : "http://example.org/urns/urn/urn:nbn:de:101:1-200911171195/urls/base64/aHR0cDovL2V4YW1wbGUub3JnL3RoZS1kb2N1bWVudC5wZGY=",
  "created" : "2017-03-02T15:23:16.123Z",
  "lastModified" : "2017-03-02T15:23:16.123Z",
  "url" : "http://example.org/the-document.pdf",
  "urn" : "http://example.org/urns/urn/urn:nbn:de:101:1-200911171195",
  "owner" : "http://example.org/organisations/id/1516",
  "priority" : 100
}