/namespaces/name/{name} Resource

Namespaces that are managed by the URN-Service.

GET /namespaces/name/{name}

Returns information about a namespace.

Access: Unauthorized (public) access allowed.

Request Parameters
name type description constraints
name path of the namespace to return 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 namespace with the given name could not be found (error code 404001)
Response Body
media type data type description
application/json Namespace (JSON) the namespace

Example

Request
GET /namespaces/name/{name}
Content-Type: */*
Accept: application/json

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

                
{
  "self" : "http://example.org/namespaces/name/urn:nbn:de:0815",
  "name" : "urn:nbn:de2112",
  "created" : "2017-03-02T15:23:16.123Z",
  "lastModified" : "2017-03-02T15:23:16.123Z",
  "allowsRegistration" : true,
  "comment" : "This namespace is used for test purposes only",
  "resolverUrl" : "http://example.org/resolver",
  "owner" : "http://example.org/organisations/id/1",
  "urnNamingPolicy" : "http://example.org/policies/urn-naming/id/1",
  "urlPolicy" : "http://example.org/policies/url/id/1",
  "urns" : "http://example.org/namespaces/name/urn:nbn:de:0815/urns",
  "urnSuggestion" : "http://example.org/namespaces/name/urn:nbn:de:0815/urnsuggestion"
}
                
              

HEAD /namespaces/name/{name}

Checks whether a namespace exists.

Access: Unauthorized (public) access allowed.

Request Parameters
name type description constraints
name path of the namespace to check for 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 namespace with the given name could not be found (error code 404001)
Response Body
media type data type description
application/json object (JSON) an empty response (null)

Example

Request
HEAD /namespaces/name/{name}
Content-Type: */*
Accept: application/json

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

                
...
                
              

PATCH /namespaces/name/{name}

Updates an existing namespace.

Access: System administrators only.

Request Parameters
name type description constraints
name path name of the namespace to update 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 UpdateNamespaceRequest (JSON) specifies the information about the namespace that will be updated.
application/merge-patch+json UpdateNamespaceRequest (JSON)
Response Codes
code condition
204 update completed successfully
400
  • if a field was syntactically incorrect (error code 400007),
  • if the organisation identifier matched no organisation (error code 400009)
401 if the user could not be authenticated (error code 401001)
403 if the user is not allowed to update namespaces (error code 403001)
404 if a namespace with the given name does not exist (error code 404001)

Example

Request
PATCH /namespaces/name/{name}
Content-Type: application/json

                
{
  "allowsRegistration" : true,
  "owner" : "http://example.org/organisations/id/1",
  "urnNamingPolicy" : "http://example.org/policies/urn-naming/id/1",
  "urlPolicy" : "http://example.org/policies/url/id/1",
  "comment" : "This namespace is used for test purposes only",
  "resolverUrl" : "http://example.org/resolver"
}
                
              
Response
HTTP/1.1 204 No Content

              

DELETE /namespaces/name/{name}

Deletes a namespace.

Access: System administrators only.

Request Parameters
name type description constraints
name path the namespace which should be deleted 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
204 if the namespace was deleted successfully
401 if the user is not authenticated (error code 401001)
403
  • if the user is not authorized to delete this namespace (error code 403001) or
  • if the namespace cannot be deleted because there are URNs in it (error code 403002).
404 if the namespace does not exist (error code 404001)

Example

Request
DELETE /namespaces/name/{name}
Content-Type: */*

                
...
                
              
Response
HTTP/1.1 204 No Content