Contact endpoint¶
Endpoint for contact search. Follows specification of Moxie.
- GET /contact/search¶
Search for persons by name and medium (tel or email)
Example request:
GET /contact/search?q=smith&medium=phone&match=exact HTTP/1.1 Host: api.m.ox.ac.uk Accept: application/json
Example response as HAL/JSON:
HTTP/1.1 200 OK Content-Type: application/json { "_links": { "self": { "href": "/contact/search?q=martin&medium=phone&match=exact" } }, "persons": [ { "external_tel": "xxxxx xxxxx", "internal_tel": "xxxxx", "name": "Martin, Dr X", "unit": "X, Department of" }, { "external_tel": "xxxxx xxxxx", "internal_tel": "xxxxx", "name": "Martin, Dr X", "unit": "X" }, [...] ] }
The response contains a list of results.
Query Parameters: - q – search query
- medium – directory to search: phone or email
- match – which entries to match: exact or approximate
Status Codes: - 200 OK – results found
- 400 Bad Request – search query is inconsistent (expect details about the error as application/json in the body of the response)
- 503 Service Unavailable – search service is not available