Search Communication
This request returns a list of communication events: chat messages, calls, emails and SMS messages.
The order_by parameter selects between two result types: Most Recently Used communication events (most recently seen) or all objects.
If all objects are selected then the results ordered in (reverse) chronological order, and is paged.
Resource
GET /communications[?parameters]
Parameters
Name | Type | Description |
---|---|---|
|
String |
Select communication objects which name matches this string. The name is usually auto generated from the object fields, except email name which is equal to the message’s subject. |
|
[mru|oid] |
Order type: Most recently used objects first (mru), or order by date. Default: Order by date. |
|
[id] |
Paging: return results before the specified cursor ID. |
|
[id] |
Paging: return results after the specified cursor ID. |
|
[Date] |
Search for communications that happens from this date or later, result order doesn’t matter. |
|
[Date] |
Search for communications that happens until this date or earlier, result order doesn’t matter. |
Paging
Paging of the communication API calls is very tricky. This is because the ordering is descending and there is also a date part to consider.
How to handle paging is different when you are ascending or descending (communication is ordered descending by default).
Descending
If the communication is given in a descending order, the following call is made:
https://xelion.nl/api/v1/master/communications?limit=4&order=descending
This will return the following:
{
"data": [
{
"object": {
"subject": "",
"date": "2021-06-29 09:50:33",
"commonName": "Wesley <- Micha , 2021-06-29",
"oid": "2006518",
"objectType": "CallLog"
},
"links": [
{
"rel": "self",
"href": "https://xelion.nl/api/v1/master/communications/2006518",
"method": "GET"
}
]
},
{
"object": {
"subject": "",
"date": "2021-06-29 09:50:07",
"commonName": "Wesley <- Arnon, 2021-06-29",
"oid": "2006495",
"objectType": "CallLog"
},
"links": [
{
"rel": "self",
"href": "https://xelion.nl/api/v1/master/communications/2006495",
"method": "GET"
}
]
},
{
"object": {
"subject": "",
"date": "2021-06-29 09:49:10",
"commonName": "Wesley <- Arthur, 2021-06-29",
"oid": "2006469",
"objectType": "CallLog"
},
"links": [
{
"rel": "self",
"href": "https://xelion.nl/api/v1/master/communications/2006469",
"method": "GET"
}
]
},
{
"object": {
"subject": "",
"date": "2021-06-25 15:28:32",
"commonName": "Wesley -> Arno, 2021-06-25",
"oid": "2006154",
"objectType": "CallLog"
},
"links": [
{
"rel": "self",
"href": "https://xelion.nl/api/v1/master/communications/2006154",
"method": "GET"
}
]
}
],
"meta": {
"links": [
{
"rel": "refresh",
"href": "https://xelion.nl/api/v1/master/communications",
"method": "GET"
},
{
"rel": "next",
"href": "https://xelion.nl/api/v1/master/communications?after=2006518",
"method": "GET"
},
{
"rel": "previous",
"href": "https://xelion.nl/api/v1/master/communications?before=2006154",
"method": "GET"
}
],
"paging": {
"previousId": "2006154",
"nextId": "2006518"
}
}
}
The 4 newest communications are given in a descending order (2021-06-29 09:50:33 until 2021-06-25 15:28:32).
For the next 4 communication objects you need the 4 communication objects that are before the communication with the date 2021-06-25 15:28:32, as you can see, the oid of this communication is 2006154.
You can also find this oid in the meta info of the response. In this meta info there is a object paging with the field previousId, use this field to fetch the correct oid for the next page.
When the id is found, do the following API call for the next 4 communication items:
https://xelion.nl/api/v1/master/communications?limit=4&order=descending&before=2006154
This will return the following:
{
"data": [
{
"object": {
"subject": "",
"date": "2021-06-25 15:09:13",
"commonName": "Wesley -> Arno, 2021-06-25",
"oid": "2006142",
"objectType": "CallLog"
},
"links": [
{
"rel": "self",
"href": "https://xelion.nl/api/v1/master/communications/2006142",
"method": "GET"
}
]
},
{
"object": {
"subject": "hello there",
"date": "2021-06-25 15:08:21",
"commonName": "hello there",
"oid": "2006131",
"objectType": "XCCUserChat"
},
"links": [
{
"rel": "self",
"href": "https://xelion.nl/api/v1/master/communications/2006131",
"method": "GET"
}
]
},
{
"object": {
"subject": "hello there",
"date": "2021-06-25 15:07:51",
"commonName": "hello there",
"oid": "2006116",
"objectType": "XCCUserChat"
},
"links": [
{
"rel": "self",
"href": "https://xelion.nl/api/v1/master/communications/2006116",
"method": "GET"
}
]
},
{
"object": {
"subject": "",
"date": "2021-06-25 14:06:57",
"commonName": "Wesley -> Arno, 2021-06-25",
"oid": "2006057",
"objectType": "CallLog"
},
"links": [
{
"rel": "self",
"href": "https://xelion.nl/api/v1/master/communications/2006057",
"method": "GET"
}
]
}
],
"meta": {
"links": [
{
"rel": "refresh",
"href": "https://xelion.nl/api/v1/master/communications",
"method": "GET"
},
{
"rel": "next",
"href": "https://xelion.nl/api/v1/master/communications?after=2006142",
"method": "GET"
},
{
"rel": "previous",
"href": "https://xelion.nl/api/v1/master/communications?before=2006057",
"method": "GET"
}
],
"paging": {
"previousId": "2006057",
"nextId": "2006142"
}
}
}
Now the next 4 (older) communication items are returned (2021-06-25 15:09:13 until 2021-06-25 14:06:57).
The last communication item now has the oid 2006057 and as you can see this is also filled in the meta paging value previousId.
So for the next 4 communication items the same can be done.
Sometimes it is needed to go back a page. The do the exact opposite of the above description.
Checkout the first communication item (in this case it is the item with the oid 2006142) or check out the nextId in the meta paging values
and use this to get the previous page with the following URL:
https://xelion.nl/api/v1/master/communications?limit=4&order=descending&after=2006142
This will return the exact same results as the initial call.
Check out that now the parameter after is used instead of before.
Ascending
If the communication is given in a ascending order, the following call is made:
https://xelion.nl/api/v1/master/communications?limit=4&order=ascending
This will return the following:
{
"data": [
{
"object": {
"subject": "test",
"date": "2019-04-11 14:26:38",
"commonName": "test",
"oid": "1811484",
"objectType": "XCCUserChat"
},
"links": [
{
"rel": "self",
"href": "https://xelion.nl/api/v1/master/communications/1811484",
"method": "GET"
}
]
},
{
"object": {
"subject": "hallo?",
"date": "2019-04-11 14:38:40",
"commonName": "hallo?",
"oid": "1811519",
"objectType": "XCCUserChat"
},
"links": [
{
"rel": "self",
"href": "https://xelion.nl/api/v1/master/communications/1811519",
"method": "GET"
}
]
},
{
"object": {
"subject": "hallo?",
"date": "2019-04-11 14:38:40",
"commonName": "hallo?",
"oid": "1811524",
"objectType": "XCCUserChat"
},
"links": [
{
"rel": "self",
"href": "https://xelion.nl/api/v1/master/communications/1811524",
"method": "GET"
}
]
},
{
"object": {
"subject": "test",
"date": "2019-04-15 10:06:05",
"commonName": "test",
"oid": "1813195",
"objectType": "XCCUserChat"
},
"links": [
{
"rel": "self",
"href": "https://xelion.nl/api/v1/master/communications/1813195",
"method": "GET"
}
]
}
],
"meta": {
"links": [
{
"rel": "refresh",
"href": "https://xelion.nl/api/v1/master/communications",
"method": "GET"
},
{
"rel": "next",
"href": "https://xelion.nl/api/v1/master/communications?after=1813195",
"method": "GET"
},
{
"rel": "previous",
"href": "https://xelion.nl/api/v1/master/communications?before=1811484",
"method": "GET"
}
],
"paging": {
"previousId": "1811484",
"nextId": "1813195"
}
}
}
The 4 oldest communications are given in a ascending order (2019-04-11 14:26:38 until 2019-04-15 10:06:05).
For the next 4 communication objects you need the 4 communication objects that are after the communication with the date 2019-04-15 10:06:05, as you can see, the oid of this communication is 1813195.
You can also find this oid in the meta info of the response. In this meta info there is a object paging with the field nextId, use this field to fetch the correct oid for the next page.
When the id is found, do the following API call for the next 4 communication items:
https://xelion.nl/api/v1/master/communications?limit=4&order=ascending&after=1813195
This will return the following:
{
"data": [
{
"object": {
"subject": "kees",
"date": "2019-04-15 10:06:15",
"commonName": "kees",
"oid": "1813209",
"objectType": "XCCUserChat"
},
"links": [
{
"rel": "self",
"href": "https://xelion.nl/api/v1/master/communications/1813209",
"method": "GET"
}
]
},
{
"object": {
"subject": "",
"date": "2019-10-30 11:05:05",
"commonName": "Wesley Legierse <- Xelion B.V., 2019-10-30",
"oid": "1853478",
"objectType": "CallLog"
},
"links": [
{
"rel": "self",
"href": "https://xelion.nl/api/v1/master/communications/1853478",
"method": "GET"
}
]
},
{
"object": {
"subject": "",
"date": "2019-10-30 11:06:59",
"commonName": "Wesley Legierse <- Xelion B.V., 2019-10-30",
"oid": "1853492",
"objectType": "CallLog"
},
"links": [
{
"rel": "self",
"href": "https://xelion.nl/api/v1/master/communications/1853492",
"method": "GET"
}
]
},
{
"object": {
"subject": "",
"date": "2021-01-14 13:39:14",
"commonName": "Wesley Legierse -> 600, 2021-01-14",
"oid": "1966759",
"objectType": "CallLog"
},
"links": [
{
"rel": "self",
"href": "https://xelion.nl/api/v1/master/communications/1966759",
"method": "GET"
}
]
}
],
"meta": {
"links": [
{
"rel": "refresh",
"href": "https://xelion.nl/api/v1/master/communications",
"method": "GET"
},
{
"rel": "next",
"href": "https://xelion.nl/api/v1/master/communications?after=1966759",
"method": "GET"
},
{
"rel": "previous",
"href": "https://xelion.nl/api/v1/master/communications?before=1813209",
"method": "GET"
}
],
"paging": {
"previousId": "1813209",
"nextId": "1966759"
}
}
}
Now the next 4 (newer) communication items are returned (2019-04-15 10:06:15 until 2021-01-14 13:39:14).
The last communication item now has the oid 1966759 and as you can see this is also filled in the meta paging value nextId.
So for the next 4 communication items the same can be done.
Sometimes it is needed to go back a page. The do the exact opposite of the above description.
Checkout the first communication item (in this case it is the item with the oid 1813209) or check out the previousId in the meta paging values
and use this to get the previous page with the following URL:
https://xelion.nl/api/v1/master/communications?limit=4&order=ascending&before=1813209
This will return the exact same results as the initial call.
Check out that now the parameter before is used instead of after.
Payload
None
Response
Context
Authorization |
User |
Errors
Example
GET https://xelion.nl/api/v1/master/communications?&include=all
{
"data": [
{
"object": {
"subject": "",
"date": "2019-02-11 16:05:40",
"durationSec": 2,
"incoming": false,
"displayed": false,
"flagged": false,
"hasAttachment": false,
"hasInlineAttachment": false,
"contentSummary": "",
"contentSummaryIsComplete": true,
"participants": [
{
"commonName": "Arno 1 2",
"role": "rtFrom",
"address": "411",
"addressable": {
"commonName": "Arno 1 2",
"oid": "1650938",
"objectType": "Person"
},
"oid": "1820077",
"objectType": "Addressee"
},
{
"commonName": "Wesley",
"role": "rtTo",
"address": "413",
"addressable": {
"commonName": "Wesley",
"oid": "1650975",
"objectType": "Person"
},
"oid": "1820088",
"objectType": "Addressee"
}
],
"voicemail": false,
"callId": "",
"callFlowId": "2019-02-11-17:05:41-00000015",
"phone": "arno",
"isConferenceCall": false,
"callAnswerTime": "2019-02-11 17:05:42",
"callAnswerTimeSec": 3,
"callEndTime": "2019-02-11 17:05:43",
"onHoldDuration": 0,
"trunk": "",
"phoneLine": {
"commonName": "Telefoonaansluiting Arno",
"oid": "1651130",
"objectType": "XCCPhoneLine"
},
"wrapUpTime": 0,
"userProfile": {
"commonName": "arno",
"oid": "1651120",
"objectType": "UserProfile"
},
"commonName": "Arno 1 2 -> Wesley, 2019-02-11",
"oid": "1820076",
"objectType": "CallLog"
},
"links": [
{
"rel": "self",
"href": "https://xelion.nl/api/v1/master/communications/1820076",
"method": "GET"
}
]
},
{
"object": {
"subject": "",
"date": "2019-02-11 16:05:26",
"durationSec": 3,
"incoming": true,
"displayed": false,
"flagged": false,
"hasAttachment": false,
"hasInlineAttachment": false,
"contentSummary": "",
"contentSummaryIsComplete": true,
"participants": [
{
"commonName": "Arno 1 2",
"role": "rtTo",
"address": "411",
"addressable": {
"commonName": "Arno 1 2",
"oid": "1650938",
"objectType": "Person"
},
"oid": "1820035",
"objectType": "Addressee"
},
{
"commonName": "Wesley",
"role": "rtFrom",
"address": "413",
"addressable": {
"commonName": "Wesley",
"oid": "1650975",
"objectType": "Person"
},
"oid": "1820046",
"objectType": "Addressee"
}
],
"voicemail": false,
"callId": "",
"callFlowId": "2019-02-11-17:05:27-00000009",
"phone": "arno",
"isConferenceCall": false,
"callAnswerTime": "2019-02-11 17:05:29",
"callAnswerTimeSec": 4,
"callEndTime": "2019-02-11 17:05:32",
"onHoldDuration": 0,
"trunk": "",
"phoneLine": {
"commonName": "Telefoonaansluiting Arno",
"oid": "1651130",
"objectType": "XCCPhoneLine"
},
"wrapUpTime": 10,
"userProfile": {
"commonName": "arno",
"oid": "1651120",
"objectType": "UserProfile"
},
"commonName": "Arno 1 2 <- Wesley, 2019-02-11",
"oid": "1820034",
"objectType": "CallLog"
},
"links": [
{
"rel": "self",
"href": "https://xelion.nl/api/v1/master/communications/1820034",
"method": "GET"
}
]
}
],
"meta": {
"links": [
{
"rel": "refresh",
"href": "https://xelion.nl/api/v1/master/communications",
"method": "GET"
},
{
"rel": "next",
"href": "https://xelion.nl/api/v1/master/communications?after=1820076",
"method": "GET"
},
{
"rel": "previous",
"href": "https://xelion.nl/api/v1/master/communications?before=1820034",
"method": "GET"
}
],
"paging": {
"previousId": "1820034",
"nextId": "1820076"
}
}
}