API: Verwendung des neuen API-Abfrageparameters "fields", Alternative zu "return object"

Revised: 19 November 2021

Einleitung

Für eine bessere Leistung bei der Verwendung von APIs empfehlen wir Kunden, API-Filter oder return_object in den Abfragen zu verwenden, aber API-Filter sind nur für bestimmte Objekttypen verfügbar, und in zukünftigen Versionen werden wir das return_object ablehnen. Als Teil davon kann die alternative Möglichkeit, dynamische API-Filter nach Bedarf zu erstellen, als API-Abfrageparameter mit den von uns benötigten Feldern angegeben werden.

Die neu hinzugefügten Felder innerhalb der APIs werden nur in API-Antworten angezeigt, wenn sie von einem bestimmten Feld begleitet werden, das im API-Antwortfilter oder dem Abfrageparameter "Felder" erwähnt wird.

Integrationsobjekte

Diese Objekte arbeiten mit dem Abfrageparameter: fields

Genehmigungs-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:00&fields=["id","approvable-type","approvable-id"]

Gebühren-API

https://<customer>.coupahost.com/api/charges?fields=["id","external-ref-id"]&limit=1

Beispiel für verschachtelte Felder:

https://<customer>.coupahost.com/api/charges?fields=["id","external-ref-id",{"currency":["code"]}]&limit=1

Vertrags-API:

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

Beispiel für verschachtelte Felder:

https://<customer>.coupahost.com/api/charges??limit=1&fields=["id","external-ref-id",{"supplier":["id","name"]}]

CoupaPay-Zahlungs-API

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

Beispiel für verschachtelte Felder:

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_transaction_reference","discount_total","payment_total",{"payable_allocations":["id","updated_at","payable_to_amount","source_transaction_to_reference","source_transaction_to_id"]},{"currency":["code"]}]}

Benutzerdefinierte Objekt-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": ["id"]},{"custom_fields": {}}]

Einfache Formularantworten-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","easy_form_response_id","answer","type","field_name","widget_label"]},{"requested_by": ["id"]},{"created_by": ["id"]},{"updated_by": ["id"]}]

Spesenabrechnungs-API

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

Beispiel für verschachtelte Felder:

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

Rechnungs-API

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

Beispiel für verschachtelte Felder:

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

Artikel-API

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

API für Bestellungen

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

Beispiel für verschachtelte Felder:

https://<customer>.coupahost.com/api/purchase_orders?limit=1&fields =[ "id", "created_at", "updated_at", "order_header_id", "po_number", "status", "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"] }}}, {"term": "id", "code", "currency": ["," code " ] }}, { " term ":", "id", "id", "," { "order_code", "," id_line ": ["] } 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 "," approvable_id "," delegate_id ", { " approver ": [ " id " ] }, { " approved_by ": [ " id "," login "," employee_number " ] } ] }, { " approvals ": [ " id "," created_at "," updated_at "," position "," chain_id "," status "," approval_status "," date_date "," type "," type "," approvable_id "," id_delegate "]}}", { "approved_by": [ "id", "login", "employee_number" ] } ] }]

Bestelländerungen API

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

Beispiel für verschachtelte Felder:

https://<customer>.coupahost.com/api/purchase_orders?limit=1&fields =[ "id", "created_at", "updated_at", "order_header_id", "po_number", "status", "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"] }}}, {"term": "id", "code", "currency": ["," code " ] }}, { " term ":", "id", "id", "," { "order_code", "," id_line ": ["] } 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 "," approvable_id "," delegate_id ", { " approver ": [ " id " ] }, { " approved_by ": [ " id "," login "," employee_number " ] } ] }, { " approvals ": [ " id "," created_at "," updated_at "," position "," chain_id "," status "," approval_status "," date_date "," type "," type "," approvable_id "," id_delegate "]}}", { "approved_by": [ "id", "login", "employee_number" ] } ] }]

Anforderungs-API

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

Beispiel für verschachtelte Felder:

https://.coupahost.com/api/requisitions?limit=1&fields =[<customer>"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": ["] }, {" uom ":" code "," Shipping_code "," supplier_code "," name "," primary_location ","}}}, {"order_number", "name", "approvate_number": ["," street_name "]}, {" type ": [" order_number "]}}, {" order_number "," order_number "," number "," status "," name ": [", "]}}}, {", { "name", ",", "order_number", "name": [",", "," name ",", ","] }}}}}, {"status", {",", ",", ",", ", {" status "," name ",", "," name ",", ",", "}}}}}}}}, { ", {", {", ",", {", {", ", { " name ",", ",", ",", ",", ",", ", { ", ",", {"name", "}}}}}}}}}}, {", {", {", {", {", {", { ", {",}}}}},},},}, {",},},}, {",},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},},}

Lieferanten-API

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

Beispiel für verschachtelte Felder:

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

Lieferantenartikel-API

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

Risk Aware-Feed-API des Lieferanten

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

Beispiel für verschachtelte Felder:

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

Tasks API

https://.coupahost.com/api/tasks? &<customer> 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", "status", "owner_id", "due_date", "start_date", "duration", "percentage", "linkable_type", "linkable_id", {"owner": ["id"]}, {"resolved_by": ["id"]}, {"linkable": ["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", "name": "custom_fields"}, "Benutzername": {"}}," Benutzername "," {"}}}}, {" customity_name ": {"}}}, {"{"}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}}} á) á) á) á) á á) á) á) á á á á á á á á á á á á á á á á á á á á á á á á á á á á á á á á á á á á á á á á á á á á á á á á á á á á á á á á á á á á á í í í í

Benutzer-API

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

Beispiel für verschachtelte Felder:

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

API-Filterreferenzdokument

Success Portal-Artikel: https://success.coupa.com/Integrate/Integration_Knowledge_Articles/API_Response_Filters#As_an_operator

Parts or all of this page might have been machine-translated. We apologize for any inaccuracies.