Clio API - 更新 (PATCH) 事务的自定义字段值的正确格式是什么
Clio API - What is the correct format to Update (PATCH) a custom field value for a matter
有人能够通过 Clio 的 API 成功更新 custom_field_values 吗?
我正在尝试在单个问题下更新 custom_field_values 的值。我可以使用 PATCH 发送 JSON 字符串,并使用以下命令更新 location 或 description 等问题的默认值格式
{"data":{"location":"Orange"}}
但是在更新 "custom field value" 时,我遇到了 422 无法处理的实体 错误。我正在关注 Clio's v4 API Documentation,我的理解是要更新 custom_field_value 您需要以下内容 JSON:
{"data":{"custom_field_values":[{"id":658213,"custom_field":{"id":139385},"value":"New Value Goes Here!"}]}}
然而,这是 422 错误消息:
{"error":{"type":"ArgumentError","message":"An invalid argument was supplied: invalid custom field value id provided, acceptable format is <type>-<unique id>"}}
我无法解释建议可接受格式的部分!
我还尝试以最接近 Clio 的 V2 API 更新自定义字段的文档的以下格式发送 JSON:
{"data":{"custom_field_values":[{"custom_field":{"id":139385},"value":"New value goes here"}]}}
但是这就是我得到的结果:
{"error":{"type":"ArgumentError","message":"An invalid argument was supplied: custom field value for custom field 139385 already exists"}}
请注意,无论我的开发环境如何,这都是在 POSTMAN 中进行测试的。感谢您的回复!
我已经多次成功创建查询来更新事务中的自定义字段值,而这些 运行 对我来说一直都是。我已将您的 json 与我成功发送的 json 的一些示例进行了比较。你的语法看起来是正确的,但有足够的缺失让我只能猜测你的错误可能在哪里。
首先,您要向 https://app.clio.com/api/v4/matters/{matter id}.json
发送 PATCH,对吧?我花了一段时间才了解到您无法使用 https://app.clio.com/api/v4/custom_fields/{id}.json
.
的查询来更新诉讼或调查的自定义字段的值
其次,澄清一下,您在上面使用的 658213
id(第一个 id 字段)应该是该自定义字段实例的唯一 id。在您创建了针对此问题的特定自定义字段的实例之前,您不会得到它。您放置 139385
的第二个 id 字段是自定义字段本身的 id,您可以通过查询 https://app.clio.com/api/v4/custom_fields.json
.
获得它
如果您在自定义字段下查看 V.4 文档,您将找不到这个,或者至少我没有找到。但是您可以在文档的“事项”部分的介绍部分找到它:https://app.clio.com/api/v4/documentation#tag/Matters
希望这对您有所帮助。我想当您的自定义字段值唯一 ID 不正确时,Clio 的某个人可以通过验证您的错误字符串是否已交付来提供帮助。
为了进一步阐明 Jacob 对其他人的回答:
custom_field{id} 是创建 custom_field 时指定的 ID,对于它所使用的所有事务或联系人都是相同的.
custom_field_value{id} 是赋予 custom_field 实例的 id 添加到特定问题并且仅对该问题唯一
首次向事项添加 custom_field 使用以下格式:
{"data":{"custom_field_values":[{"custom_field":{"id":123456},"value":"string or integer depending on the type of CF"}]}}
要更新已添加到诉讼或调查的自定义字段,应使用以下格式:
{"data":{"custom_field_values":[{"id":"text_line-1234567", "custom_field":{"id":123456},"value":"string or integer depending on the type of CF"}]}}
要删除已添加到事务中的自定义字段,以下 JSON 格式就足够了:
{"data":{"custom_field_values":[{"id":"text_line-1234567", "custom_field":{"id":123456},"_destroy":true}]}}
有人能够通过 Clio 的 API 成功更新 custom_field_values 吗?
我正在尝试在单个问题下更新 custom_field_values 的值。我可以使用 PATCH 发送 JSON 字符串,并使用以下命令更新 location 或 description 等问题的默认值格式
{"data":{"location":"Orange"}}
但是在更新 "custom field value" 时,我遇到了 422 无法处理的实体 错误。我正在关注 Clio's v4 API Documentation,我的理解是要更新 custom_field_value 您需要以下内容 JSON:
{"data":{"custom_field_values":[{"id":658213,"custom_field":{"id":139385},"value":"New Value Goes Here!"}]}}
然而,这是 422 错误消息:
{"error":{"type":"ArgumentError","message":"An invalid argument was supplied: invalid custom field value id provided, acceptable format is <type>-<unique id>"}}
我无法解释建议可接受格式的部分!
我还尝试以最接近 Clio 的 V2 API 更新自定义字段的文档的以下格式发送 JSON:
{"data":{"custom_field_values":[{"custom_field":{"id":139385},"value":"New value goes here"}]}}
但是这就是我得到的结果:
{"error":{"type":"ArgumentError","message":"An invalid argument was supplied: custom field value for custom field 139385 already exists"}}
请注意,无论我的开发环境如何,这都是在 POSTMAN 中进行测试的。感谢您的回复!
我已经多次成功创建查询来更新事务中的自定义字段值,而这些 运行 对我来说一直都是。我已将您的 json 与我成功发送的 json 的一些示例进行了比较。你的语法看起来是正确的,但有足够的缺失让我只能猜测你的错误可能在哪里。
首先,您要向 https://app.clio.com/api/v4/matters/{matter id}.json
发送 PATCH,对吧?我花了一段时间才了解到您无法使用 https://app.clio.com/api/v4/custom_fields/{id}.json
.
其次,澄清一下,您在上面使用的 658213
id(第一个 id 字段)应该是该自定义字段实例的唯一 id。在您创建了针对此问题的特定自定义字段的实例之前,您不会得到它。您放置 139385
的第二个 id 字段是自定义字段本身的 id,您可以通过查询 https://app.clio.com/api/v4/custom_fields.json
.
如果您在自定义字段下查看 V.4 文档,您将找不到这个,或者至少我没有找到。但是您可以在文档的“事项”部分的介绍部分找到它:https://app.clio.com/api/v4/documentation#tag/Matters
希望这对您有所帮助。我想当您的自定义字段值唯一 ID 不正确时,Clio 的某个人可以通过验证您的错误字符串是否已交付来提供帮助。
为了进一步阐明 Jacob 对其他人的回答:
custom_field{id} 是创建 custom_field 时指定的 ID,对于它所使用的所有事务或联系人都是相同的.
custom_field_value{id} 是赋予 custom_field 实例的 id 添加到特定问题并且仅对该问题唯一
首次向事项添加 custom_field 使用以下格式:
{"data":{"custom_field_values":[{"custom_field":{"id":123456},"value":"string or integer depending on the type of CF"}]}}
要更新已添加到诉讼或调查的自定义字段,应使用以下格式:
{"data":{"custom_field_values":[{"id":"text_line-1234567", "custom_field":{"id":123456},"value":"string or integer depending on the type of CF"}]}}
要删除已添加到事务中的自定义字段,以下 JSON 格式就足够了:
{"data":{"custom_field_values":[{"id":"text_line-1234567", "custom_field":{"id":123456},"_destroy":true}]}}