[英]How to associate RingCentral call data and Glip post data by user?
如何將RingCentral API中的調用數據與Glip API中的用戶數據相關聯。 據我所知道的,唯一的重疊是位於通話記錄適當的名稱to
和from
字段(這並不總是存在),它可以映射到一個電子郵件地址,然后向用戶GLIP。 這似乎是處理事情的非常間接的方式。 是否有ID或類似的東西鏈接兩個API? 具體來說,我想知道來自或向某人打來的電話是否也是我組織中的Glip用戶。
RingCentral呼叫日志API示例
https://developer.ringcentral.com/api-reference#Call-Log-loadCompanyCallLog
GET /restapi/v1.0/account/~/call-log
{
"uri": "https://platform.devtest.ringcentral.com/restapi/v1.0/account/11111111/call-log?view=Simple&showBlocked=true&withRecording=false&dateFrom=2018-11-09T07:00:00.000Z&page=1&perPage=100",
"records": [
{
"uri": "https://platform.devtest.ringcentral.com/restapi/v1.0/account/11111111/call-log/abcdef0123456789?view=Simple",
"id": "abcdef0123456789",
"sessionId": "1234567890",
"startTime": "2018-11-10T00:52:07.020Z",
"duration": 11,
"type": "Voice",
"direction": "Inbound",
"action": "Phone Call",
"result": "Missed",
"to": {
"phoneNumber": "+16505550100"
},
"from": {
"phoneNumber": "+12155550101",
"location": "Philadelphia, PA"
}
},
Glip Post API示例
https://developer.ringcentral.com/api-reference#Posts-listGlipGroupPosts
GET /restapi/v1.0/glip/groups/{groupId}/posts
{
"records":[
{
"id":"1542094852",
"groupId":"155654",
"type":"TextMessage",
"text":"",
"creatorId":"glip-29507587",
"addedPersonIds":null,
"creationTime":"2018-05-31T14:45:16.822Z",
"lastModifiedTime":"2018-05-31T14:45:16.822Z",
"attachments":null,
"activity":null,
"title":null,
"iconUri":null,
"iconEmoji":null,
"mentions":null
}
]
}
當用戶是公司用戶時,通過呼叫日志extensionId
ID和Glip personId
來標識用戶,它們具有相同的值。
extensionId
標識。
/restapi/v1.0/account/{accountId}/call-log
}/call-log)中,您將收到所有用戶的呼叫日志,並且要識別每個用戶的呼叫,需要通過以下方式查詢詳細視圖:添加view=Detailed
查詢字符串參數,然后在調用legs
數組中找到extensionId
,因為一個呼叫中可以存在多個用戶。 每條支路都有一個extension
屬性,該屬性具有extensionId
和HATEOAS uri
屬性,以為用戶檢索信息。 /restapi/v1.0/account/{accountId}/extension/{extensionId}/call-log
}/ extensionId
{ /restapi/v1.0/account/{accountId}/extension/{extensionId}/call-log
)中, extensionId
在URL路徑中明確聲明。 personId
標識。 personId
顯示為creatorId
以及Glip API中的其他位置。
personId
值與extensionId
相同,例如12345678
personId
值glip-
作為前綴,例如glip-12345678
這是詳細的公司呼叫日志條目的示例:
GET /restapi/v1.0/account/~/call-log?view=Detailed
{
"uri":"https://platform.devtest.ringcentral.com/restapi/v1.0/account/11111111/call-log?view=Detailed&showBlocked=true&withRecording=false&dateFrom=2018-11-09T07:37:00.000Z&page=1&perPage=100",
"records":[
{
"uri":"https://platform.devtest.ringcentral.com/restapi/v1.0/account/11111111/call-log/abcdef0123456789?view=Detailed",
"id":"abcdef0123456789",
"sessionId":"19923257004",
"startTime":"2018-11-10T00:52:07.020Z",
"duration":11,
"type":"Voice",
"direction":"Inbound",
"action":"Phone Call",
"result":"Missed",
"to":{
"phoneNumber":"+16505550100"
},
"from":{
"phoneNumber":"+12155550101",
"location":"Philadelphia, PA"
},
"transport":"PSTN",
"lastModifiedTime":"2018-11-10T00:52:40.001Z",
"billing":{
"costIncluded":0,
"costPurchased":0
},
"legs":[
{
"startTime":"2018-11-10T00:52:07.020Z",
"duration":11,
"type":"Voice",
"direction":"Inbound",
"action":"Phone Call",
"result":"Missed",
"to":{
"phoneNumber":"+12675550100"
},
"from":{
"phoneNumber":"+12155550101",
"location":"Philadelphia, PA"
},
"transport":"PSTN",
"billing":{
"costIncluded":0,
"costPurchased":0
},
"legType":"Accept",
"master":true
},
{
"startTime":"2018-11-10T00:52:07.050Z",
"duration":11,
"type":"Voice",
"direction":"Inbound",
"action":"Phone Call",
"result":"Missed",
"to":{
"phoneNumber":"+12679304030",
"name":"Sales Queue"
},
"from":{
"phoneNumber":"+12155550101",
"location":"Philadelphia, PA"
},
"extension":{
"uri":"https://platform.devtest.ringcentral.com/restapi/v1.0/account/11111111/extension/22222222",
"id":22222222
},
"transport":"PSTN",
"legType":"Accept"
},
{
"startTime":"2018-11-10T00:52:15.220Z",
"duration":3,
"type":"Voice",
"direction":"Outbound",
"action":"FindMe",
"result":"Accepted",
"to":{
"phoneNumber":"+16505550100",
"location":"Redwood City, CA"
},
"from":{
"phoneNumber":"+12675550100",
"name":"Tiger RingForce"
},
"extension":{
"uri":"https://platform.devtest.ringcentral.com/restapi/v1.0/account/111111111/extension/33333333",
"id":33333333
},
"transport":"PSTN",
"legType":"FindMe"
},
{
"startTime":"2018-11-10T00:52:15.257Z",
"duration":3,
"type":"Voice",
"direction":"Outbound",
"action":"FindMe",
"result":"Accepted",
"to":{
"phoneNumber":"+18185550100",
"location":"North Hollywood, CA"
},
"from":{
"phoneNumber":"+12675550100",
"name":"Tiger RingForce"
},
"extension":{
"uri":"https://platform.devtest.ringcentral.com/restapi/v1.0/account/130709004/extension/130836004",
"id":130836004
},
"transport":"PSTN",
"legType":"FindMe"
}
]
}
]
}
要映射到Glip用戶,只需將其映射到具有與Call Log extensionId
匹配的personId
Glip用戶。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.