-
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
[
{
"contact_id": 66,
"reception_id": 4,
"department": "Plumbing",
"wants_messages": true,
"enabled": true,
"full_name": "Mario Mario",
"distribution_list": {
"to": [
{
"contact": {
"id": 66,
"name": "Mario Mario"
},
"reception": {
"id": 4,
"name": "Hansen VVS A/S"
}
}
],
"cc": [],
"bcc": []
},
"contact_type": "human",
"phones": [],
"endpoints": [],
"backup": [
"Luigi Mario"
],
"emailaddresses": [
"mario@hansenvvs.dk"
],
"handling": [
"Take a message"
],
"workhours": [
"Hverdage 07:00 – 18:00",
"Weekend: 10:00 - 14:00"
],
"tags": [
"Super"
],
"info": "Stuff",
"position": "CPO (Cheif pluming officer)",
"relations": "Brother of Luigi Mario",
"responsibility": "Jumping around"
},
{
"contact_id": 67,
"reception_id": 4,
"department": "Pipes",
"wants_messages": true,
"enabled": true,
"full_name": "Luigi Mario",
"distribution_list": {
"to": [
{
"contact": {
"id": 67,
"name": "Luigi Mario"
},
"reception": {
"id": 4,
"name": "Hansen VVS A/S"
}
}
],
"cc": [],
"bcc": []
},
"contact_type": "human",
"phones": [],
"endpoints": [],
"backup": [
"Mario Mario"
],
"emailaddresses": [
"luigi@hansenvvs.dk"
],
"handling": [
"Call his brother Mario, or take a message"
],
"workhours": [
"Hverdage 07:00 – 18:00",
"Weekend: 10:00 - 14:00"
],
"tags": [
"Super"
],
"info": "Handles the dirty stuff",
"position": "Assistant",
"relations": "Brother of Mario Mario",
"responsibility": "Taller stuff"
}
]
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>}