/organisations/id/{id}/contacts Resource

Organisations and contacts who manage their URNs and URLs with the URN-Service.

GET /organisations/id/{id}/contacts

Returns the contacts of an organisation.

Access: Logged in organisations only.

Request Parameters
name type description constraints
id path id of the organisation whose contacts are requested 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 could not be authenticated (error code 401001)
403 if the user is not authorised to retrieve the contacts of the organisation (error code 403001)
404 if the organisation with the given id could not be found (error code 404001)
Response Body
media type data type description
application/json Collection (JSON) a Collection of Contacts

Example

Request
GET /organisations/id/{id}/contacts
Content-Type: */*
Accept: application/json

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

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

POST /organisations/id/{id}/contacts

Adds a new contact to an organisation.

Access: System administrators only.

Request Parameters
name type description constraints
id path of the organisation whose contacts are requested 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 CreateContactRequest (JSON) the details for the new contact
Response Codes
code condition
201 if the contact was added successfully
400
  • if mandatory fields are missing in the request (error code 400005) or
  • if a field is not valid (error code 400007).
401 if the user is not authenticated (error code 401001)
403 if the user is not authorized to register
  • contacts (error code 403001) or
  • contacts with comments (error code 403001).
404 if the organisation with the given id could not be found (error code 404001)
Response Body
media type data type description
application/json Contact (JSON) the new contact
Response Headers
name description
Location URI pointing to the new contact

Example

Request
POST /organisations/id/{id}/contacts
Content-Type: application/json
Accept: application/json

                
{
  "surname" : "Gödel",
  "forename" : "Kurt",
  "email" : "k.goedel@example.org",
  "phone" : "+49 69 1525-0",
  "function" : "system administrator",
  "comment" : "This contact is used for testing purposes only"
}
                
              
Response
HTTP/1.1 201 Created
Content-Type: application/json
Location: ...

                
{
  "self" : "http://example.org/organisations/id/1/contacts/id/1",
  "created" : "2017-03-02T15:23:16.123Z",
  "lastModified" : "2017-03-02T15:23:16.123Z",
  "surname" : "Gödel",
  "forename" : "Kurt",
  "email" : "k.goedel@example.org",
  "phone" : "+49 69 1525-0",
  "function" : "system administrator",
  "organisation" : "http://example.org/organisations/id/1",
  "comment" : "This contact is used for testing purposes only"
}