1

如何将来自 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
    }
  ]
}
4

1 回答 1

2

用户由 Call LogextensionId和 Glip标识personId,当用户是公司用户时,它们具有相同的值。

  • 在 RingCentral 呼叫日志 API 中,每个用户都由一个extensionId.
    • 在公司通话/restapi/v1.0/account/{accountId}/call-log记录API view=Detailed(可以出现在通话中。每条腿都有一个带有HATEOAS属性的属性来为用户检索信息。extensionIdlegsextensionextensionIduri
    • 在用户调用日志 API ( /restapi/v1.0/account/{accountId}/extension/{extensionId}/call-log) 中,extensionId在 URL 路径中明确说明。
  • 在 Glip API 中,每个用户都由一个personId. 出现personIdcreatorIdGlip API 的其他地方。
    • 当 Glip 用户也是 RingCentral 用户时,GlippersonId值与 相同extensionId,例如12345678
    • 当 Glip 用户是访客且不在 RingCentral 帐户中时,GlippersonId值以 为前缀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 用户,只需将其映射到personId与 Call Log 匹配的Glip 用户extensionId

于 2018-11-10T07:41:27.000 回答