• 最終編集日時: 24 June 2020

契約APIの呼び出しの例

契約のためのさまざまなクエリオプション

Contracts APIを使用して、必要な結果セットをクエリして取得する方法の詳細な例を次に示します。

このクエリでは、非アクティブな
https ://.coupahost.com/api/contracts?status=inactiveの契約が表示され<instance>ます

このクエリでは、番号= 1、名前= test & city = Seattle
https ://.coupahost.com/api/contracts?number=1&name=test&supplier [primary_address [city]]<instance> = Seattleのサプライヤーの契約が表示されます

このクエリでは、主要な連絡先の名前= Allison
https ://.coupahost.com/api/contracts?supplier [primary - contact [name - given]] = Allisonを<instance>持つサプライヤーのすべての契約が表示されます

Contracts APIのGETの例

この例では、IDが2の単一の契約レコードを照会しました。

次のURLにアクセスしました:
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>

	 2008 <created-at type="datetime">-10 -27 T 13:26:13 - 07:00</created-at>

	 2014 <updated-at type="datetime">-03 -20 T 15:20:45 - 07:00</updated-at>

	 <name>Amazon.com</name>

	 <number>2</number>

	 <version nil="true" />

	 <start-date type="datetime">2008 -10 -26 T 17:00:00 - 07:00</start-date>

	 <end-date type="datetime">2012 -10 -26 T 17:00:00 - 07:00</end-date>

	 <status>非有効</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">偽</supplier-invoiceable>

	 <is-default type="boolean">偽</is-default>

	 <supplier-account nil="true" />

	 <use-order-windows type="boolean">偽</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>

				 2008 <created-at type="datetime">-10 -27 T 12:56:39 - 07:00</created-at>

				 2008 <updated-at type="datetime">-10 -27 T 12: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>アリソン</name-given>

				 <name-family>リビングストン</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>サポート</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>サポート</lastname>

						<salesforce-id nil="true" />

						<mycustom-userfield />

				 </updated-by>

			</primary-contact>

			<primary-address>

				 <id type="integer">4</id>

				 2008 <created-at type="datetime">-10 -27 T 12:56:39 - 07:00</created-at>

				 2009 <updated-at type="datetime">-08 -20 T 09:35:04 - 07:00</updated-at>

				 <name>Amazon.com</name>

				 <street1>1516 2 nd Ave</street1>

				 <street2 />

				 <city>シアトル</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>米国</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>サポート</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>ロヒット</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>

				 2006 <created-at type="datetime">-08 -27 T 19:40:04 - 07:00</created-at>

				 2013 <updated-at type="datetime">-03 -29 T 21:11:14 - 07:00</updated-at>

				 <name>全員</name>

				 <description>すべてのユーザーがこのグループに割り当てられたドキュメントを見ることができます</description>

				 <updated-by>

						<id type="integer">1</id>

						<login>coupasupport</login>

						<email>upgrade@coupa.com</email>

						<employee-number nil="true" />

						<firstname>Coupa</firstname>

						<lastname>サポート</lastname>

						<salesforce-id nil="true" />

						<mycustom-userfield />

				 </updated-by>

			</content-group>

			<content-group>

				 <id type="integer">6</id>

				 2013 <created-at type="datetime">-10 -09 T 10:15:01 - 07:00</created-at>

				 2013 <updated-at type="datetime">-10 -09 T 10:15:01 - 07:00</updated-at>

				 <name>なにをパターン化するか</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>統合</firstname>

						<lastname>ユーザー</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>連携</firstname>

						<lastname>ユーザー</lastname>

						<salesforce-id nil="true" />

						<mycustom-userfield />

				 </updated-by>

			</content-group>

	 </content-groups>

	 <schedule>

			<day0>いつでも</day0>

			<day1>いつでも</day1>

			<day2>いつでも</day2>

			<day3>いつでも</day3>

			<day4>いつでも</day4>

			<day5>いつでも</day5>

			<day6>いつでも</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>サポート</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>連携</firstname>

			<lastname>ユーザー</lastname>

			<salesforce-id nil="true" />

			<mycustom-userfield />

	 </updated-by>

</contract>

すべての契約を調べるためのクエリ
https ://<instance>/api/contracts/ 

非アクティブな
/api/contractの契約を見つけるためのクエリ? 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 -01 T 17:00:00 - 07:00</start-date>

	 <end-date>2014 -04 -26 T 17:00:00 - 07:00</end-date>

	 <status>非有効</status>

	 <supplier>

			<name>Amazon.com</name>

	 </supplier>

	 <content-groups>

			<content-group>

				 <id>1</id>

				 <name>全員</name>

				 <description>すべてのユーザーがこのグループに割り当てられたドキュメントを見ることができます</description>

			</content-group>

	 </content-groups>

</contract>

Contracts 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>

 

関連アイテム


Coupa Core API

CoupaのRESTful APIは、お客様のデータをCoupaプラットフォームで読み取り、編集し、統合するための堅牢なアクセスを提供します。

APIの開始

Coupa APIの使用に関する一般情報、およびCSVの使用を検討するタイミング。

OAuth 2.0およびOIDCへの移行

Coupaは従来のAPIキーを廃止し、OAuth 2.0 / OIDCの使用を必要としています。R34以降、新しいAPIキーは発行されず、R35ではAPIキーはサポートされなくなります。

リソース

参照データ、トランザクションデータ、共有リソースなど、オブジェクトのタイプ別にAPIエンドポイントを整理しました。