首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何将RingCentral调用数据与Glip post数据按用户关联?

如何将RingCentral调用数据与Glip post数据按用户关联?
EN

Stack Overflow用户
提问于 2018-11-10 07:09:34
回答 1查看 103关注 0票数 1

如何将RingCentral API中的调用数据与Glip中的用户数据关联起来。据我所知,唯一的重叠是位于调用日志tofrom字段(它们并不总是存在)中的正确名称,这些名称可以映射到电子邮件地址,然后映射到Glip。这似乎是一种非常间接的做事方式。是否有ids或类似的东西来连接这两个API?具体来说,我想知道来自或将要打给某个人的电话是否也是我所在组织中的Glip。

RingCentral调用日志API示例

https://developer.ringcentral.com/api-reference#Call-Log-loadCompanyCallLog

代码语言:javascript
复制
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示例

https://developer.ringcentral.com/api-reference#Posts-listGlipGroupPosts

代码语言:javascript
复制
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
    }
  ]
}
EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2018-11-10 07:41:27

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

  • 在RingCentral调用日志API中,每个用户都由一个extensionId标识。
    • 在公司调用日志API (/restapi/v1.0/account/{accountId}/call-log)中,您将接收所有用户的呼叫日志,要标识每个用户的调用,您需要通过添加view=Detailed查询字符串参数来查询详细视图,然后在call legs数组中查找extensionId,因为一个调用中可以有多个用户。每个腿都有一个extension属性,其中包含一个extensionId和HATEOAS uri属性,用于为用户检索信息。
    • 在用户调用日志API (/restapi/v1.0/account/{accountId}/extension/{extensionId}/call-log)中,extensionId在URL路径中显式地声明。

  • 在Glip中,每个用户都由一个personId标识。personIdcreatorId的形式出现,并在Glip中的其他地方出现。
    • 当Glip也是RingCentral用户时,Glip personId值与extensionId相同,例如12345678
    • 当Glip是一个来宾而不在RingCentral帐户中时,personId值以glip-作为前缀,例如glip-12345678

下面是一个详细的公司调用日志条目的示例:

代码语言:javascript
复制
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匹配的personId将其映射到Glip。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/53236793

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档