繁体   English   中英

如何按用户关联RingCentral呼叫数据和Glip Post数据?

[英]How to associate RingCentral call data and Glip post data by user?

如何将RingCentral API中的调用数据与Glip API中的用户数据相关联。 据我所知道的,唯一的重叠是位于通话记录适当的名称tofrom字段(这并不总是存在),它可以映射到一个电子邮件地址,然后向用户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来标识用户,它们具有相同的值。

  • 在RingCentral呼叫日志API中,每个用户都由extensionId标识。
    • 在公司呼叫日志API( /restapi/v1.0/account/{accountId}/call-log }/call-log)中,您将收到所有用户的呼叫日志,并且要识别每个用户的呼叫,需要通过以下方式查询详细视图:添加view=Detailed查询字符串参数,然后在调用legs数组中找到extensionId ,因为一个呼叫中可以存在多个用户。 每条支路都有一个extension属性,该属性具有extensionId和HATEOAS uri属性,以为用户检索信息。
    • 在用户呼叫日志API( /restapi/v1.0/account/{accountId}/extension/{extensionId}/call-log }/ extensionId { /restapi/v1.0/account/{accountId}/extension/{extensionId}/call-log )中, extensionId在URL路径中明确声明。
  • 在Glip API中,每个用户都由personId标识。 personId显示为creatorId以及Glip API中的其他位置。
    • 当Glip用户也是RingCentral用户时,Glip personId值与extensionId相同,例如12345678
    • 当Glip用户是访客并且不在RingCentral帐户中时,Glip personIdglip-作为前缀,例如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.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM