0

我正在尝试创建有关事项的指标并将指标与关联的用户和联系人联系起来。我能够成功地从 Matters、Users 和 Contacts 端点提取数据;但是,API 文档建议应该有一个“联系人”对象,该对象可以从具有联系人 ID 的用户端点返回。问题是这个对象总是空的。谁能告诉我为什么会这样以及如何解决?

这是文档:

https://app.clio.com/api/v4/documentation#operation/User#index

这是我的邮递员请求,我用它来验证我正在检索我需要的数据,然后再用我的应用程序访问端点。

https://www.getpostman.com/collections/4f7e3660330fe912c2d5

这是我可能检索到的 json 示例:

{
"data": [
{
"account_owner": true,
"clio_connect": true,
"court_rules_default_attendee": true,
"default_calendar_id": 0,
"email": "string",
"enabled": true,
"etag": "string",
"first_name": "string",
"id": 0,
"initials": "string",
"last_name": "string",
"name": "string",
"phone_number": "string",
"rate": 0,
"subscription_type": "Attorney",
"time_zone": "string",
"roles": [],
"created_at": "2019-04-17T15:23:02Z",
"updated_at": "2019-04-17T15:23:02Z",
"default_activity_description": [],
"notification_methods": [],
"account": [],
"avatar": [],
***"contact": [
{
"id": 0,
"etag": "string",
"name": "string",
"first_name": "string",
"middle_name": "string",
"last_name": "string",
"type": "Company",
"created_at": "2019-04-17T15:23:02Z",
"updated_at": "2019-04-17T15:23:02Z",
"prefix": "string",
"title": "string",
"initials": "string",
"clio_connect_email": "string",
"locked_clio_connect_email": true,
"client_connect_user_id": 0,
"primary_email_address": "string",
"primary_phone_number": "string",
"ledes_client_id": "string",
"is_client": true
}
]***,
"job_title": []
}
]
}

这是我实际得到的:

注意:我没有检索到所有可能的属性。

{
    "data": [
        {
            "id": 344993632,
            "etag": "\"14902f605c2616c56a68f6d0d2c36334\"",
            "name": "Clio SetUp",
            "first_name": "Clio",
            "last_name": "SetUp",
            "phone_number": null,
            "initials": "CS",
            "default_calendar_id": 852014,
            "subscription_type": "Attorney",
            "email": "frances.bourikas+h@clio.com",
            "created_at": "2017-06-22T15:16:10-06:00",
            "updated_at": "2018-12-28T05:27:49-07:00",
            "roles": [
                "admin"
            ],
            "job_title": null,
            "account": {
                "id": 809498454,
                "etag": "\"303ff7565c8c22be6a68f6d0d2c36334\"",
                "name": "Hoglund, Chwialkowski & Mrozik",
                "state": "paid"
            },
            ***"contact": null***
        },

...
}
4

1 回答 1

0

检查 GET 请求的语法。语法很棘手,但应该类似于:

https://app.clio.com/api/v4/users.json?fields=id,name,first_name,last_name,email,enabled,account_owner,phone_number,rate,subscription_type,time_zone,account {id},contact{id ,name,first_name,last_name,type,primary_email_address,primary_phone_number,is_client}created_at,updated_at

当然是 URL 编码的。

于 2020-01-13T18:20:40.493 回答