契約APIコールの例
契約の異なるクエリオプション
契約APIを使用して必要な結果セットをクエリして取得する方法の例を以下に示します。
このクエリは無効な契約を表示します
https://<instance>.coupahost.com/api/contracts?status=inactive
このクエリは、番号= 1、名前= test & city = Seattleのサプライヤーの契約を提供します
https://<instance>.coupahost.com/api/contracts?number=1&name=test&supplier[primary_address[city]]=Seattle
このクエリは、指定された名前= Allisonの代表連絡先を持つサプライヤーのすべての契約を表示します
https://<instance>.coupahost.com/api/contracts?supplier[primary-contact[name-given]]=Allison
契約APIの取得例
この例では、IDが2の単一の契約レコードをクエリしました。
URLにGETしました:
https://<instance url>/api/contracts/2
または
https://<instance url>/api/contracts?id=2
検索条件に一致する回答は次のとおりです。
<?xml version="1.0" encoding="UTF-8"?>
<contract>
<id type="integer">2</id>
<created-at type="datetime">2008-10-27T13:26:13-07:00</created-at>
<updated-at type="datetime">2014-03-20T15:20:45-07:00</updated-at>
<name>Amazon.com</name>
<number>2</number>
<version nil="true" />
<start-date type="datetime">2008-10-26T17:00:00-07:00</start-date>
<end-date type="datetime">2012-10-26T17:00:00-07:00</end-date>
<status>inactive</status>
<minimum-value type="decimal">0.00</minimum-value>
<maximum-value type="decimal">0.00</maximum-value>
<terms nil="true" />
<preferred nil="true" />
<savings-pct type="decimal">10.0</savings-pct>
<min-commit type="decimal">0.00</min-commit>
<max-commit type="decimal">0.00</max-commit>
<supplier-invoiceable type="boolean">false</supplier-invoiceable>
<is-default type="boolean">false</is-default>
<supplier-account nil="true" />
<use-order-windows type="boolean">false</use-order-windows>
<order-window-tz nil="true" />
<requisition-message nil="true" />
<po-message nil="true" />
<supplier>
<id type="integer">4</id>
<name>Amazon.com</name>
<number nil="true" />
<supplier-diversity />
<primary-contact>
<id type="integer">4</id>
<created-at type="datetime">2008-10-27T12:56:39-07:00</created-at>
<updated-at type="datetime">2008-10-27T12:56:39-07:00</updated-at>
<email>upgrade@coupa.com</email>
<name-prefix nil="true" />
<name-suffix nil="true" />
<name-additional nil="true" />
<name-given>Allison</name-given>
<name-family>Livingston</name-family>
<name-fullname nil="true" />
<notes nil="true" />
<created-by>
<id type="integer">1</id>
<login>coupasupport</login>
<email>upgrade@coupa.com</email>
<employee-number nil="true" />
<firstname>Coupa</firstname>
<lastname>Support</lastname>
<salesforce-id nil="true" />
<mycustom-userfield />
</created-by>
<updated-by>
<id type="integer">1</id>
<login>coupasupport</login>
<email>upgrade@coupa.com</email>
<employee-number nil="true" />
<firstname>Coupa</firstname>
<lastname>Support</lastname>
<salesforce-id nil="true" />
<mycustom-userfield />
</updated-by>
</primary-contact>
<primary-address>
<id type="integer">4</id>
<created-at type="datetime">2008-10-27T12:56:39-07:00</created-at>
<updated-at type="datetime">2009-08-20T09:35:04-07:00</updated-at>
<name>Amazon.com</name>
<street1>1516 2nd Ave</street1>
<street2 />
<city>Seattle</city>
<state>WA</state>
<postal-code>98101</postal-code>
<attention nil="true" />
<active type="boolean">true</active>
<business-group-name nil="true" />
<country>
<id type="integer">223</id>
<code>US</code>
<name>United States</name>
</country>
<created-by>
<id type="integer">1</id>
<login>coupasupport</login>
<email>upgrade@coupa.com</email>
<employee-number nil="true" />
<firstname>Coupa</firstname>
<lastname>Support</lastname>
<salesforce-id nil="true" />
<mycustom-userfield />
</created-by>
<updated-by>
<id type="integer">16</id>
<login>rohit</login>
<email>rohit.jalisatgi@coupa.com</email>
<employee-number />
<firstname>Rohit</firstname>
<lastname>Jalisatgi</lastname>
<salesforce-id nil="true" />
<mycustom-userfield />
</updated-by>
</primary-address>
</supplier>
<content-groups type="array">
<content-group>
<id type="integer">1</id>
<created-at type="datetime">2006-08-27T19:40:04-07:00</created-at>
<updated-at type="datetime">2013-03-29T21:11:14-07:00</updated-at>
<name>Everyone</name>
<description>All users can see documents assigned to this group</description>
<updated-by>
<id type="integer">1</id>
<login>coupasupport</login>
<email>upgrade@coupa.com</email>
<employee-number nil="true" />
<firstname>Coupa</firstname>
<lastname>Support</lastname>
<salesforce-id nil="true" />
<mycustom-userfield />
</updated-by>
</content-group>
<content-group>
<id type="integer">6</id>
<created-at type="datetime">2013-10-09T10:15:01-07:00</created-at>
<updated-at type="datetime">2013-10-09T10:15:01-07:00</updated-at>
<name>What Pattern</name>
<description nil="true" />
<created-by>
<id type="integer">69</id>
<login>coupasupport+rohitdemo@coupa.com</login>
<email>coupasupport+rohitdemo@coupa.com</email>
<employee-number nil="true" />
<firstname>Integration</firstname>
<lastname>User</lastname>
<salesforce-id nil="true" />
<mycustom-userfield />
</created-by>
<updated-by>
<id type="integer">69</id>
<login>coupasupport+rohitdemo@coupa.com</login>
<email>coupasupport+rohitdemo@coupa.com</email>
<employee-number nil="true" />
<firstname>Integration</firstname>
<lastname>User</lastname>
<salesforce-id nil="true" />
<mycustom-userfield />
</updated-by>
</content-group>
</content-groups>
<schedule>
<day0>anytime</day0>
<day1>anytime</day1>
<day2>anytime</day2>
<day3>anytime</day3>
<day4>anytime</day4>
<day5>anytime</day5>
<day6>anytime</day6>
</schedule>
<contract-terms type="array" />
<created-by>
<id type="integer">1</id>
<login>coupasupport</login>
<email>upgrade@coupa.com</email>
<employee-number nil="true" />
<firstname>Coupa</firstname>
<lastname>Support</lastname>
<salesforce-id nil="true" />
<mycustom-userfield />
</created-by>
<updated-by>
<id type="integer">69</id>
<login>coupasupport+rohitdemo@coupa.com</login>
<email>coupasupport+rohitdemo@coupa.com</email>
<employee-number nil="true" />
<firstname>Integration</firstname>
<lastname>User</lastname>
<salesforce-id nil="true" />
<mycustom-userfield />
</updated-by>
</contract>
すべての契約を検索するクエリ
https://<instance>/api/contracts/
無効な契約を見つけるためのクエリ
/api/contracts?status=<
特定のサプライヤーの契約を検索するクエリ
https://<instance>/api/contracts?number=<>&name=<>&supplier[primary_address[city]]=<>
https://<instance>/api/contracts?supplier[primary_address[city]]=<>
契約作成 – 非アクティブステータス
この例では、非アクティブステータスの契約を作成しています。コンテンツグループ参照オブジェクトにCoupaシステムIDを使用しています。
URLに投稿しました: https://<instance url>/api/contracts.
これにより、契約が非アクティブステータスで作成されました
<?xml version="1.0" encoding="UTF-8"?>
<contract>
<name>YRIAmazon.com</name>
<number>119</number>
<start-date>2014-04-01T17:00:00-07:00</start-date>
<end-date>2014-04-26T17:00:00-07:00</end-date>
<status>inactive</status>
<supplier>
<name>Amazon.com</name>
</supplier>
<content-groups>
<content-group>
<id>1</id>
<name>Everyone</name>
<description>All users can see documents assigned to this group</description>
</content-group>
</content-groups>
</contract>
契約API PUTの例
契約のステータス更新のサンプルコード
<?xml version="1.0" encoding="UTF-8"?>
<contract>
<id>73</id>
<status>published</status>
</contract>
契約名を更新するためのサンプルコード
<?xml version="1.0" encoding="UTF-8"?>
<contract>
<name>Amazon.com</name>
</contract>
このページに表示されている一部、または全ての内容は、機械翻訳によるものです。ご了承ください。