添付ファイルAPI
添付ファイルAPIを使用して、Coupa参照オブジェクトと取引オブジェクトの添付ファイルを管理します。
アクション
ほとんどのCoupaリソースでは、リソースに関するコメントと、コアリソースの両方に添付ファイルを追加できます。 詳しくは、コメント APIをご覧ください。
添付ファイルAPIでは以下のアクションが可能です。
| 動詞 | パス | アクション | 説明 |
|---|---|---|---|
| POST | /api/contracts/:contract_id/attachments | 作成 | 添付ファイルを作成 |
| POST | /api/invoices/:invoice_id/attachments | 作成 | 添付ファイルを作成 |
| POST | /api/expense_reports/:expense_report_id/attachments | 作成 | 添付ファイルを作成 |
| POST | /api/purchase_orders/:purchase_order_id/attachments | 作成 | 添付ファイルを作成 |
| POST | /api/users/:user_id/attachments | 作成 | 添付ファイルを作成 |
| POST | /api/requisitions/:requisition_id/attachments | 作成 | 添付ファイルを作成 |
| GET | /api/contracts/:contract_id/attachments | インデックス | 添付書類を検索 |
| GET | /api/inventory_transactions/:id/attachments/:id | 表示 | 添付ファイルを表示 |
| GET | /api/invoices/:invoice_id/attachments | インデックス | 添付書類を検索 |
| GET | /api/expense_reports/:expense_report_id/attachments | インデックス | 添付書類を検索 |
| GET | /api/purchase_orders/:purchase_order_id/attachments | インデックス | 添付書類を検索 |
| GET | /api/users/:user_id/attachments | インデックス | 添付書類を検索 |
| GET | /api/requisitions/:requisition_id/attachments | インデックス | 添付書類を検索 |
| GET | /api/contracts/:contract_id/attachments/:id | 表示 | 添付ファイルを表示 |
| GET | /api/invoices/:invoice_id/attachments/:id | 表示 | 添付ファイルを表示 |
| GET | /api/expense_reports/:expense_report_id/attachments/:id | 表示 | 添付ファイルを表示 |
| GET | /api/purchase_orders/:purchase_order_id/attachments/:id | 表示 | 添付ファイルを表示 |
| GET | /api/users/:user_id/attachments/:id | 表示 | 添付ファイルを表示 |
| GET | /api/requisitions/:requisition_id/attachments/:id | 表示 | 添付ファイルを表示 |
| GET | /api/attachments/:attachment_id | 表示 | 添付書類IDに基づいて添付書類を表示します。 注: 添付ファイルが関連付けられているオブジェクトを明示的に定義するには、 |
| PATCH | /api/contracts/:contract_id/attachments/:id | 更新 | API経由では添付ファイルを更新できません |
| PUT | /api/contracts/:contract_id/attachments/:id | 更新 | API経由では添付ファイルを更新できません |
| PATCH | /api/invoices/:invoice_id/attachments/:id | 更新 | API経由では添付ファイルを更新できません |
| PUT | /api/invoices/:invoice_id/attachments/:id | 更新 | API経由では添付ファイルを更新できません |
| PATCH | /api/expense_reports/:expense_report_id/attachments/:id | 更新 | API経由では添付ファイルを更新できません |
| PUT | /api/expense_reports/:expense_report_id/attachments/:id | 更新 | API経由では添付ファイルを更新できません |
| PATCH | /api/purchase_orders/:purchase_order_id/attachments/:id | 更新 | API経由では添付ファイルを更新できません |
| PUT | /api/purchase_orders/:purchase_order_id/attachments/:id | 更新 | API経由では添付ファイルを更新できません |
| PATCH | /api/users/:user_id/attachments/:id | 更新 | API経由では添付ファイルを更新できません |
| PUT | /api/users/:user_id/attachments/:id | 更新 | API経由では添付ファイルを更新できません |
| PATCH | /api/requisitions/:requisition_id/attachments/:id | 更新 | API経由では添付ファイルを更新できません |
| PUT | /api/requisitions/:requisition_id/attachments/:id | 更新 | API経由では添付ファイルを更新できません |
| DELETE | /api/requisitions/:requisition_id/attachments/:id | delete | 申請書ヘッダーから添付ファイルを削除する(発注などの他の文書タイプにも機能します) |
| DELETE | /api/requisition_lines/:requisition_line_id/attachments/:id | delete | 申請書明細から添付ファイルを削除する(発注などの他の文書タイプにも機能します) |
| DELETE | /api/attachments/:attachment_id | delete | 添付ファイルを削除 |
| POST | /api/quote_requests/:quote_request_id/attachments | 作成 | イベントに添付ファイルを追加します。 |
| DELETE | /api/quote_requests/:quote_request_id/attachments/:id | 削除 | イベントに関連付けられた添付ファイルを削除します。 |
| GET | /api/quote_requests/:quote_request_id/attachments | インデックス | イベントに関連付けられた添付ファイルを取得します。 |
| POST | /api/quote_request_lines/:quote_request_line_id/attachments | 作成 | イベント明細に添付ファイルを追加します。 |
| DELETE | /api/quote_request_lines/:quote_request_line_id/attachments/:id | 削除 | イベント明細に関連付けられた添付ファイルを削除します。 |
| GET | /api/quote_request_lines/:quote_request_line_id/attachments | インデックス | イベント明細に関連付けられた添付ファイルを取得します。 |
| POST | /api/quote_request_attachments/:quote_request_attachment_id/attachments | 作成 | イベントの詳細セクションに添付ファイルを追加します。 |
| DELETE | /api/quote_request_attachments/:quote_request_attachment_id/attachments/:id | 削除 | イベントの詳細セクションの添付ファイルを削除します。 |
| GET | /api/quote_request_attachments/:quote_request_attachment_id/attachments | インデックス | イベントの詳細セクションの添付ファイルを取得します。 |
Elements
添付ファイルAPIでは、次の要素を使用できます。
| 要素 | Description | 必須フィールド? | 一意? | 許容値 | Api_Inフィールド? | Api_Outフィールド? | データタイプ |
|---|---|---|---|---|---|---|---|
| 作成日時 | CoupaがYYY-MM-DDTHH:MM:SS+HH:MMZの形式で自動的に作成します | yes | datetime | ||||
| file-url | 添付ファイルのURL | yes | yes | 文字列 | |||
| ID | Coupaの一意の識別子 | yes | yes | 整数 | |||
| 目的 | 目的 | yes | yes | string(40) | |||
| linked-to | 特定の機能へのリンク | yes | string(255) | ||||
| テキスト | テキスト | yes | テキスト | ||||
| type | type | yes | yes | yes | string(255) | ||
| updated-at | CoupaがYYY-MM-DDTHH:MM:SS+HH:MMZの形式で自動的に作成します | yes | datetime | ||||
| URL | URL | yes | string(255) |
契約の添付ファイルを作成
- メソッド
POST
/api/requisitions /: id/attachments- cURLリクエスト例
curl -X POST \ https://<INSTANCE>/api/requisitions/12345/attachments \ -H "Accept: application/xml" \ -H "content-type: multipart/form-data" \ -H "x-coupa-api-key: <API KEY>" \ -F "attachment[file]=@/Users/IntegrationAdmin/Contracts/Standard_Terms_Conditions.pdf" \ -F "attachment[type]=file" -F "attachment[intent]=Supplier"
ソーシングイベントの詳細セクションに添付ファイルを追加します
- メソッド
- POST
/api/quote_request_attachments/10058/attachments - リクエストパラメーター
- リクエストパラメーターを次の値に設定します。
添付ファイル[ファイル]:添付ファイルをアップロード添付[タイプ]:ファイルattachment[intent]: Supplier添付[linked_to]: quote_request_attachment
- cURLリクエスト例
curl --location 'https://<your-instance>.com/api/quote_request_attachments/10058/attachments ' \ --header 'Accept: application/xml' \ --header 'Accept: application/json' \ --header 'Authorization: ••••••' \ --form 'attachment[file]=@"/file-path.png"' \ --form 'attachment[type]="file"' \ --form 'attachment[intent]="Supplier"' \ --form 'attachment[linked_to]="quote_request_attachment"'
ソーシングイベントに関連付けられた添付ファイルを取得
- メソッド
- GET
/api/quote_requests/10153/attachments/4712295 - cURLリクエスト例
curl --location 'https://<your-instance>.com/api/quote_requests/10153/attachments/4712295' \ --header 'Accept: application/xml' \ --header 'Accept: application/json' \ --header 'Authorization: ••••••' \ --header 'Cookie: _mkra_ctxt=c7e24ee9dd42c97a2bbfd26a2215079d12490dcfb828c19c332fdef146268332--200'
ソーシングイベントに関連付けられた添付ファイルを作成
- メソッド
- POST
/api/quote_requests/10153/attachments/4712295 - リクエストパラメーター
- イベント利用規約セクションの添付ファイルの場合、
linked_totoattachment_to_suppliersを設定します。 イベント利用規約セクションの添付ファイルの場合は、linked_totoevent_termsを設定します。{" type ":" text "," text ":" Event info attachment text "," linked_to ":" attachment_to_suppliers ",// For attachments under event info "intent ":" Supplier "} - cURLリクエスト例
curl --location 'https://<your-instance>.com/api/quote_requests/10153/attachments/4712295' \ --header 'Accept: application/xml' \ --header 'Accept: application/json' \ --header 'Authorization: ••••••' \ --header 'Cookie: _mkra_ctxt=c7e24ee9dd42c97a2bbfd26a2215079d12490dcfb828c19c332fdef146268332--200'