-
Notifications
You must be signed in to change notification settings - Fork 3
Protocol Contact
A contact only makes sense in the context of an organization/reception. So, every call needs both a contact identification and a reception identification.
GET /contact/list/reception/<reception_id>')
If the reception, identified by the supplied id exists, a list of contact objects in JSON format is returned. If no contacts are associated with the reception, an empty list is returned.
HTTP status: 200 OK
{
"contacts": [
{
"reception_id": 1,
"contact_id": 7,
"wants_messages": true,
"enabled": true,
"full_name": "Ulrik Jønsson",
"contact_type": "human",
"backup": [
{
"value": "Karl Rostgaard Christensen",
"priority": 1
}
],
"emailaddresses": [],
"handling": [],
"telephonenumbers": [
{
"value": "12345678",
"priority": 1
}
],
"workhours": [],
"tags": [
"Granvej",
"Mosekrogen"
],
"department": "",
"info": "",
"position": "",
"relations": "",
"responsibility": ""
},
{
"reception_id": 1,
"contact_id": 17,
"wants_messages": true,
"enabled": true,
"full_name": "Helga Helgason",
"contact_type": "human"
},
{
"reception_id": 1,
"contact_id": 18,
"wants_messages": true,
"enabled": true,
"full_name": "Martinus Martinussen",
"contact_type": "human"
},
{
"reception_id": 1,
"contact_id": 19,
"wants_messages": true,
"enabled": true,
"full_name": "Bob Børgesen",
"contact_type": "human"
},
{
"reception_id": 1,
"contact_id": 20,
"wants_messages": true,
"enabled": true,
"full_name": "Charlie Carstensen",
"contact_type": "human"
},
{
"reception_id": 1,
"contact_id": 21,
"wants_messages": true,
"enabled": true,
"full_name": "Alice Arnesen",
"contact_type": "human"
},
{
"reception_id": 1,
"contact_id": 46,
"wants_messages": true,
"enabled": true,
"full_name": "Carlo Connemara",
"contact_type": "human"
}
]
}If no active reception is associated with the supplied identification, an empty object is returned along with a "not found" status.
HTTP Status: 404 Not Found
{}GET /contact/<contact_id>/reception/<reception_id>
If the contact of the supplied reception context is located, the contact object in JSON format.
HTTP status: 200 OK
{
"reception_id": 2,
"contact_id": 1,
"wants_messages": true,
"enabled": true,
"full_name": "Thomas Fisher",
"contact_type": "human",
"backup": [
{
"value": "Steen Fisher",
"priority": 1
}
],
"emailaddresses": [
{
"value": "tf@ff.dk",
"priority": 1
}
],
"handling": [
{
"value": "spørg ikke ind til ekstra stærk varianten",
"priority": 1
}
],
"telephonenumbers": [
{
"value": "87654321",
"priority": 1
}
],
"workhours": [],
"tags": [
"Fisker",
"sømand",
"pirat"
],
"department": "Fangst",
"info": "Tidligere fisker I militæret",
"position": "Key fishing manager",
"relations": "Gift med Triton Fisher",
"responsibility": "Fersk fisk"
}If no such combination of contact/reception identifications are present, an empty object is returned, along with a "not found" status.
HTTP Status: 404 Not Found
{}GET /contact/<contact_id>/reception/<reception_id>/calendar)
Returns a list of calendar_entry objects in JSON format. An empty list is allowed, if no calendar are found.
HTTP status: 200 OK
{TODO}GET /contact/<contact_id>/reception/<reception_id>/phone)
Returns a list of phonenumber objects in JSON format. An empty list is allowed, if no entries are found.
GET /contact/<contact_id>/reception/<reception_id>/phone/<phone_id>)
Returns a specific phonenumber object in JSON format, idenfied by the tuple {<contact_id>,<reception_id>,<phone_id>}