API:新しいAPIクエリパラメーター「fields」を使用して、「return object」の代わりに

Revised: 19 November 2021

はじめに

APIを使用する際のパフォーマンスを向上させるために、クエリでAPIフィルターまたはreturn_objectを使用することをお勧めしますが、APIフィルターは特定のオブジェクトタイプでのみ使用でき、今後のリリースではreturn_objectを廃止する予定です。その一環として、必要に応じて動的APIフィルターを作成する代替方法を、必要なフィールドを含むAPIクエリパラメーターとして指定できます。

インテグレーションオブジェクト

次のオブジェクトはqueryパラメータと連携します。fields

承認API

https://<customer>.coupahost.com/api/approvals?fields=["id","created-at"]&limit=1

https://<customer>.coupahost.com/api/approvals?approvable-type=EasyFormResponse&status[in]=pending_approval,approved&updated-at[gt_or_eq]=2021-11-01T00:00&fields=["id","approvable-type","approvable-id"]

料金API

https://<customer>.coupahost.com/api/charges?fields=["id","外部参照id"]&limit=1

ネストされたフィールドの例:

https://<customer>.coupahost.com/api/charges?fields=["id","外部参照id",{"currency":["code"]}]&limit=1

契約API:

例:https://<customer>.coupahost.com/api/contracts?status=published&fields=["id","status"]&limit=1

ネストされたフィールドの例:

https://<customer>.coupahost.com/api/charges??limit=1&fields=["id","外部参照id",{"サプライヤー":["id","名前"]}]

CoupaPay支払API

https://<customer>.coupahost.com/api/coupa_pay/payments?status=published&fields=["id","status"]&limit=1

ネストされたフィールドの例:

fields=["id","payment-batch-id","status","exchange_rate","updated_at",{"pay_from_account":["id",{"currency":["code"]}]},{"pay_to_currency":["code"]},{"payee":["number"]},{"digital_check":["check_number"]},{"payment_details":["id","updated_at","source_transaction_id","source_reference","discount_total",_payment" {"payable_allocations":["id"、"updated_at"、"payable_to_amount"、"source_transaction_to_reference"、"source_transaction_to_id"]}、{"currency":["code"]}]}

カスタムオブジェクトAPI

https://<customer>.coupahost.com/api/custom_objects/<ID>/object_instances?updated_at[gt_or_eq]=2021-11-10&fields=["id","created_at","updated_at","custom_object_name","custom_object_code","form_response_id","owner_id","due_date","start_date","duration", percentage","linkable_type","linkable_id",{"created_by":["id"],{"updated_by": []},{"custom_fields": {}}]

簡易フォーム回答API

https://<customer>.coupahost.com/api/easy_form_responses/<ID>?fields=["id","created_at","updated_at","easy_form_id","name","status","submitted_at",{"subject":["id","supplier_id","custom_object_name","custom_object_code"]},{"easy_form_widget_responses":["id","easy_form_id","easy_form_widget_id","answer","type","field_name",_widget"},{"requested_by":["id"]},{"created_by":["id"]},{"updated_by":["id"]}

経費レポートAPI

https://<customer>.coupahost.com/api/expense_reports?status=approved_for_payment&fields=["id","title"]&limit=1

ネストされたフィールドの例:

https://<customer>.coupahost.com/api/users?status=active&fields=["id",{"expense_lines":["id","amount"]}]&limit=1

請求書API

https://<customer>.coupahost.com/api/invoices?status=approved&fields=["id","status"]&limit=1

ネストされたフィールドの例:

/invoices/:id?fields=["id", "invoice-number", { "currency": [ "code" ] },{"account_type":["id", "name"]}]

アイテムAPI

https://<customer>.coupahost.com/api/items?fields=["id","created-at"]&limit=1

発注書API

https://<customer>.coupahost.com/api/purchase_orders?status=issued&fields=["id","status"]&limit=1

ネストされたフィールドの例:

https://<customer>.coupahost.com/api/purchase_orders?limit=1&fields=[ "id", "created_at", "updated_at", "updated_at", "order_header_id", "po_number", "version", { "custom_fields": {} }, { "ship_to_address": [ "id", "created_at", "updated_at", "name", "location_code", "street1", "street2", "city", "state", "postal_code", "attention", "active", { "country": [ "code" } }, { "custom_fields" ship_to_user:[ "id", "login" ] }, { "supplier":[ "id", "name", "display_name", "number", { "primary_address":[ "id", "name", "location_code", "street1", "street2", "city", "state", "postal_code", "attention", "active", { "country":[ "code" ] } ] } } }, { "payment_term":[ "id", "code" }, { "currency" }, { shipping_term": "id", "code" ] }, { "order_line_changes": [ "id", "created_at", "updated_at", "line_num", "description", "order_header_change_id", "order_line_id", "price", "quantity", "total", { "account": [ "id", "name", "code", "segment_1", "segment_2", "segment_3", "segment_4" ] }, { "custom_fields": {}, "currency": [ "code" }, { "commodity": name", { "custom_fields": {} } ] }, { "uom": [ "code" ] } ] } }, { "current_approval": [ "id", "created_at", "updated_at", "position", "approval_chain_id", "status", "approval_date", "note", "type", "approvable_type", "approvable_id", "delegate_id", { "approved_by": [ "id", "login", "employee_number" } ] } }, { "approvalid: "、"created_at"、"updated_at"、"position"、"approval_chain_id"、"status"、"approval_date"、"note"、"type"、"approvable_type"、"approvable_id"、"delegate_id"、{"approved_by":[ "id"、"login"、"employee_number" ] }]

発注書の変更API

https://<customer>.coupahost.com/api/purchase_order_changes?fields=["id","created-at"]&limit=1

ネストされたフィールドの例:

https://<customer>.coupahost.com/api/purchase_orders?limit=1&fields=[ "id", "created_at", "updated_at", "updated_at", "order_header_id", "po_number", "version", { "custom_fields": {} }, { "ship_to_address": [ "id", "created_at", "updated_at", "name", "location_code", "street1", "street2", "city", "state", "postal_code", "attention", "active", { "country": [ "code" } }, { "custom_fields" ship_to_user:[ "id", "login" ] }, { "supplier":[ "id", "name", "display_name", "number", { "primary_address":[ "id", "name", "location_code", "street1", "street2", "city", "state", "postal_code", "attention", "active", { "country":[ "code" ] } ] } } }, { "payment_term":[ "id", "code" }, { "currency" }, { shipping_term": "id", "code" ] }, { "order_line_changes": [ "id", "created_at", "updated_at", "line_num", "description", "order_header_change_id", "order_line_id", "price", "quantity", "total", { "account": [ "id", "name", "code", "segment_1", "segment_2", "segment_3", "segment_4" ] }, { "custom_fields": {}, "currency": [ "code" }, { "commodity": name", { "custom_fields": {} } ] }, { "uom": [ "code" ] } ] } }, { "current_approval": [ "id", "created_at", "updated_at", "position", "approval_chain_id", "status", "approval_date", "note", "type", "approvable_type", "approvable_id", "delegate_id", { "approved_by": [ "id", "login", "employee_number" } ] } }, { "approvalid: "、"created_at"、"updated_at"、"position"、"approval_chain_id"、"status"、"approval_date"、"note"、"type"、"approvable_type"、"approvable_id"、"delegate_id"、{"approved_by":[ "id"、"login"、"employee_number" ] }]

申請書API

https://<customer>.coupahost.com/api/requisitions?status=ordered&fields=["id","status"]&limit=1

ネストされたフィールドの例:

https://<customer>.coupahost.com/api/requisitions?limit=1&fields=[ "id", "submitted_at", "us_estimated_tax", { "currency": [ "code" ] }, { "ship_to_address": [ "id", "name", "location_code", "street1", "street2", "city", "state", "postal_code", "attention", "active", "vat_number", { "country": [ "code" ] }, { "custom_fields": {} } } }, { "requisition_lines: [ id", "description", "line_num", need_by date"、"order_line_id"、"quantity"、"source_part_num"、"unspsc_code"、"status"、"supp_aux_part_num"、"total"、"line_type"、"supplier_site_id"、"unit_price"、{"account":[ "name"、"code"、"segment_1"、"segment_2"、"segment_3"、"segment_4"、{"account_type":[ "name" ] } }、{"uom": "code" }、{ "shipping_term": "code"、} { "supplier": [ "id", "name", "display_name", "number", { "primary_address": [ "id", "name", "location_code", "street1", "street2", "city", "state", "postal_code", "attention", "active", { "country": [ "code" ] } ] } } } } } }, { "current_approval": [ "id", "created_at", "updated_at", "position_approval", chain_id"、"status"、"approval_date"、"note"、"type"、"approvable_type"、"approvable_id"、"delegate_id"、"holdable" ] }、{ "custom_fields": {} }]

サプライヤーAPI

例:https://<customer>.coupahost.com/api/suppliers?status=active&fields=["id","name"]&limit=1

ネストされたフィールドの例:

https://<customer>.coupahost.com/api/users?status=active&fields=["id",{"primary_contact":["name-given"]}]&limit=1

サプライヤーアイテムAPI

https://<customer>.coupahost.com/api/supplier_items?fields=["id","created-at"]&limit=1

サプライヤーのRisk Awareフィード(API経由)

https://<customer>.coupahost.com/api/supplier_risk_aware_feed?fields=["id","number-field-01"]&limit=1

ネストされたフィールドの例:

https://<customer>.coupahost.com/api/users?status=active&fields=["id",{"supplier":["id","name"]}]&limit=1

タスクAPI

https://<customer>.coupahost.com/api/tasks?&updated_at[gt_or_eq]=2021-07-01&linkable-type=Project&owner-id[blank]=false&linkable[status][not_eq]=draft&fields=["id","created_at","updated_at","title","description","owner_id","due_date","start_date","duration","percentage","linkable_type","linkable_id",{"owner"},{ "resolved_by: "id"]},{ "リンク可能": [ "id","created_at","updated_at","name","active","open","description","mention_name","start_date","external_reference_number","end_date","commodity_id","status",{"template_group": ["id","name",{"custom_fields": {}},{"category": ["id","name",{"custom_fields": {}],{"department": ["id,",{"custom_fields": {}}]},{"users": ["id","email",{"custom_fields": {}}]},{"commodity": ["id","name",{"custom_fields": {}}]},{"custom_fields": {}}]},{"created_by": ["id"]},{"updated_by": ["id"]}]

ユーザーAPI

例:https://<customer>.coupahost.com/api/users?status=active&fields=["id","email"]&limit=1

ネストされたフィールドの例:

https://<customer>.coupahost.com/api/users?status=active&fields=["id","外部参照番号",{"役割":["名前"]}]&limit=1

APIフィルターの参照文書

Success Portalの記事:https://success.coupa.com/Integrate/Integration_Knowledge_Articles/API_Response_Filters#As_an_operator

このページに表示されている一部、または全ての内容は、機械翻訳によるものです。ご了承ください。