diff --git a/plugins/coupa-look-up-my-approvals-history/.codeblocks/block_0.sh b/plugins/coupa-look-up-my-approvals-history/.codeblocks/block_0.sh new file mode 100644 index 00000000..c3b61abd --- /dev/null +++ b/plugins/coupa-look-up-my-approvals-history/.codeblocks/block_0.sh @@ -0,0 +1,3 @@ +curl --location 'https:///api/approvals?created_at[gt_or_eq]={{start_date}}&created_at[lt_or_eq]={{end_date}}&limit=100&offset=0&order_by=desc' \ +--header 'Accept: application/json' \ +--header 'Authorization: Bearer {{access_token}}' diff --git a/plugins/coupa-look-up-my-approvals-history/.codeblocks/block_1.sh b/plugins/coupa-look-up-my-approvals-history/.codeblocks/block_1.sh new file mode 100644 index 00000000..21d2bef0 --- /dev/null +++ b/plugins/coupa-look-up-my-approvals-history/.codeblocks/block_1.sh @@ -0,0 +1,3 @@ +curl --location 'https:///api/{{approvable_type}}/{{approvable_id}}' \ +--header 'Accept: application/json' \ +--header 'Authorization: Bearer {{access_token}}' diff --git a/plugins/coupa-look-up-my-approvals-history/README.md b/plugins/coupa-look-up-my-approvals-history/README.md index 31acbd27..ee0dcb95 100644 --- a/plugins/coupa-look-up-my-approvals-history/README.md +++ b/plugins/coupa-look-up-my-approvals-history/README.md @@ -5,8 +5,10 @@ description: A plugin that allows users to instantly review their past approval the Moveworks AI Assistant. domain: - Finance - Other -fidelity: IDEA +fidelity: GUIDE name: Look Up My Approvals History +difficulty_level: INTERMEDIATE +time_in_minutes: 25 purple_chat_link: https://marketplace.moveworks.com/purple-chat?conversation=%7B%22messages%22%3A%5B%7B%22role%22%3A%22user%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22Show+my+approvals+history%22%7D%5D%7D%2C%7B%22role%22%3A%22assistant%22%2C%22parts%22%3A%5B%7B%22reasoningSteps%22%3A%5B%7B%22status%22%3A%22pending%22%2C%22richText%22%3A%22Validating+user+consent+for+%3Cb+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3ECoupa%3C%2Fb%3E...%22%7D%2C%7B%22status%22%3A%22success%22%2C%22richText%22%3A%22Consent+confirmed.%22%7D%5D%7D%2C%7B%22richText%22%3A%22%3Cp%3EI+can+help+with+that%2C+to+narrow+down+your+search%2C+what+type+of+approvals+are+you+interested+in+%28e.g.%2C+%3Cstrong%3Erequisitions%3C%2Fstrong%3E%2C+%3Cstrong%3Einvoices%3C%2Fstrong%3E%2C+%3Cstrong%3Eexpense+reports%3C%2Fstrong%3E%2C+or+all%29%3F+Also+specify+the+time+period+I+should+I+look+at.%3C%2Fp%3E%22%7D%5D%7D%2C%7B%22role%22%3A%22user%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22Just+expense+reports+for+the+past+month.%22%7D%5D%7D%2C%7B%22role%22%3A%22assistant%22%2C%22parts%22%3A%5B%7B%22reasoningSteps%22%3A%5B%7B%22status%22%3A%22success%22%2C%22richText%22%3A%22Retrieving+%3Cb+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3Eexpense+report+approvals%3C%2Fb%3E+from+the+%3Cb+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3Epast+month%3C%2Fb%3E.%22%7D%2C%7B%22status%22%3A%22success%22%2C%22richText%22%3A%22Found+3+expense+report+approvals+from+the+past+month.%22%7D%5D%7D%2C%7B%22richText%22%3A%22%3Cp%3EHere+are+your+3+expense+report+approvals+from+the+past+month+%28October+24+-+November+24%2C+2024%29%3A%3C%2Fp%3E%3Cp%3E%3C%2Fp%3E%3Cp%3E%3Cstrong%3E1.+Client+Dinner+-+Project+Alpha%3C%2Fstrong%3E%3C%2Fp%3E%3Cul%3E%3Cli%3E%3Cp%3E%3Cstrong%3EDate%3A%3C%2Fstrong%3E+November+20%2C+2024%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3EItem+Type%3A%3C%2Fstrong%3E+Expense+Report%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3EDescription%3A%3C%2Fstrong%3E+Client+Dinner+-+Project+Alpha%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3EAmount%3A%3C%2Fstrong%3E+%24125.50%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3ERequester%3A%3C%2Fstrong%3E+John+Doe%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3EFinal+Status%3A%3C%2Fstrong%3E+Approved%3C%2Fp%3E%3C%2Fli%3E%3C%2Ful%3E%3Cp%3E%3C%2Fp%3E%3Cp%3E%3Cstrong%3E2.+Software+Subscription+Renewal%3C%2Fstrong%3E%3C%2Fp%3E%3Cul%3E%3Cli%3E%3Cp%3E%3Cstrong%3EDate%3A%3C%2Fstrong%3E+November+15%2C+2024%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3EItem+Type%3A%3C%2Fstrong%3E+Expense+Report%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3EDescription%3A%3C%2Fstrong%3E+Software+Subscription+Renewal%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3EAmount%3A%3C%2Fstrong%3E+%24499.00%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3ERequester%3A%3C%2Fstrong%3E+John+Doe%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3EFinal+Status%3A%3C%2Fstrong%3E+Approved%3C%2Fp%3E%3C%2Fli%3E%3C%2Ful%3E%3Cp%3E%3C%2Fp%3E%3Cp%3E%3Cstrong%3E3.+Travel+to+HQ%3C%2Fstrong%3E%3C%2Fp%3E%3Cul%3E%3Cli%3E%3Cp%3E%3Cstrong%3EDate%3A%3C%2Fstrong%3E+October+28%2C+2024%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3EItem+Type%3A%3C%2Fstrong%3E+Expense+Report%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3EDescription%3A%3C%2Fstrong%3E+Travel+to+HQ%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3EAmount%3A%3C%2Fstrong%3E+%24780.20%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3ERequester%3A%3C%2Fstrong%3E+John+Doe%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3EFinal+Status%3A%3C%2Fstrong%3E+Approved%3C%2Fp%3E%3Cp%3E%3C%2Fp%3E%3C%2Fli%3E%3C%2Ful%3E%3Cp%3EIs+there+anything+else+you%27d+like+to+filter+by%2C+or+would+you+like+to+see+approvals+for+a+different+period%3F%3C%2Fp%3E%22%7D%2C%7B%22citations%22%3A%5B%7B%22connectorName%22%3A%22coupa%22%2C%22citationTitle%22%3A%22Expense+Report+-+Client+Dinner+-+Project+Alpha%22%7D%2C%7B%22connectorName%22%3A%22coupa%22%2C%22citationTitle%22%3A%22Expense+Report+-+Software+Subscription+Renewal%22%7D%2C%7B%22connectorName%22%3A%22coupa%22%2C%22citationTitle%22%3A%22Expense+Report+-+Travel+to+HQ%22%7D%5D%7D%5D%7D%5D%7D solution_tags: - Finance - Other @@ -14,3 +16,73 @@ systems: - coupa --- +## **Introduction** + +The **“Look Up My Approvals History”** plugin allows employees to instantly review their past approval actions in Coupa — including requisitions, invoices, and expense reports — directly through the Moveworks AI Assistant. Instead of navigating through Coupa, users can quickly retrieve a clean, consolidated history of the items they have approved or rejected within a selected time range. + +This guide will walk you through how to configure and customize the plugin within Agent Studio in just a few minutes. Let’s get started! + +## **Prerequisites** + +• Access to **Agent Studio** + +## **What are we building?** + +### **Agent Design** + +This [purple chat](https://marketplace.moveworks.com/purple-chat?conversation=%7B%22messages%22%3A%5B%7B%22role%22%3A%22user%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22Show+my+approvals+history%22%7D%5D%7D%2C%7B%22role%22%3A%22assistant%22%2C%22parts%22%3A%5B%7B%22reasoningSteps%22%3A%5B%7B%22status%22%3A%22pending%22%2C%22richText%22%3A%22Validating+user+consent+for+%3Cb+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3ECoupa%3C%2Fb%3E...%22%7D%2C%7B%22status%22%3A%22success%22%2C%22richText%22%3A%22Consent+confirmed.%22%7D%5D%7D%2C%7B%22richText%22%3A%22%3Cp%3EI+can+help+with+that%2C+to+narrow+down+your+search%2C+what+type+of+approvals+are+you+interested+in+%28e.g.%2C+%3Cstrong%3Erequisitions%3C%2Fstrong%3E%2C+%3Cstrong%3Einvoices%3C%2Fstrong%3E%2C+%3Cstrong%3Eexpense+reports%3C%2Fstrong%3E%2C+or+all%29%3F+Also+specify+the+time+period+I+should+I+look+at.%3C%2Fp%3E%22%7D%5D%7D%2C%7B%22role%22%3A%22user%22%2C%22parts%22%3A%5B%7B%22richText%22%3A%22Just+expense+reports+for+the+past+month.%22%7D%5D%7D%2C%7B%22role%22%3A%22assistant%22%2C%22parts%22%3A%5B%7B%22reasoningSteps%22%3A%5B%7B%22status%22%3A%22success%22%2C%22richText%22%3A%22Retrieving+%3Cb+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3Eexpense+report+approvals%3C%2Fb%3E+from+the+%3Cb+xmlns%3D%5C%22http%3A%2F%2Fwww.w3.org%2F1999%2Fxhtml%5C%22%3Epast+month%3C%2Fb%3E.%22%7D%2C%7B%22status%22%3A%22success%22%2C%22richText%22%3A%22Found+3+expense+report+approvals+from+the+past+month.%22%7D%5D%7D%2C%7B%22richText%22%3A%22%3Cp%3EHere+are+your+3+expense+report+approvals+from+the+past+month+%28October+24+-+November+24%2C+2024%29%3A%3C%2Fp%3E%3Cp%3E%3C%2Fp%3E%3Cp%3E%3Cstrong%3E1.+Client+Dinner+-+Project+Alpha%3C%2Fstrong%3E%3C%2Fp%3E%3Cul%3E%3Cli%3E%3Cp%3E%3Cstrong%3EDate%3A%3C%2Fstrong%3E+November+20%2C+2024%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3EItem+Type%3A%3C%2Fstrong%3E+Expense+Report%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3EDescription%3A%3C%2Fstrong%3E+Client+Dinner+-+Project+Alpha%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3EAmount%3A%3C%2Fstrong%3E+%24125.50%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3ERequester%3A%3C%2Fstrong%3E+John+Doe%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3EFinal+Status%3A%3C%2Fstrong%3E+Approved%3C%2Fp%3E%3C%2Fli%3E%3C%2Ful%3E%3Cp%3E%3C%2Fp%3E%3Cp%3E%3Cstrong%3E2.+Software+Subscription+Renewal%3C%2Fstrong%3E%3C%2Fp%3E%3Cul%3E%3Cli%3E%3Cp%3E%3Cstrong%3EDate%3A%3C%2Fstrong%3E+November+15%2C+2024%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3EItem+Type%3A%3C%2Fstrong%3E+Expense+Report%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3EDescription%3A%3C%2Fstrong%3E+Software+Subscription+Renewal%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3EAmount%3A%3C%2Fstrong%3E+%24499.00%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3ERequester%3A%3C%2Fstrong%3E+John+Doe%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3EFinal+Status%3A%3C%2Fstrong%3E+Approved%3C%2Fp%3E%3C%2Fli%3E%3C%2Ful%3E%3Cp%3E%3C%2Fp%3E%3Cp%3E%3Cstrong%3E3.+Travel+to+HQ%3C%2Fstrong%3E%3C%2Fp%3E%3Cul%3E%3Cli%3E%3Cp%3E%3Cstrong%3EDate%3A%3C%2Fstrong%3E+October+28%2C+2024%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3EItem+Type%3A%3C%2Fstrong%3E+Expense+Report%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3EDescription%3A%3C%2Fstrong%3E+Travel+to+HQ%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3EAmount%3A%3C%2Fstrong%3E+%24780.20%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3ERequester%3A%3C%2Fstrong%3E+John+Doe%3C%2Fp%3E%3C%2Fli%3E%3Cli%3E%3Cp%3E%3Cstrong%3EFinal+Status%3A%3C%2Fstrong%3E+Approved%3C%2Fp%3E%3Cp%3E%3C%2Fp%3E%3C%2Fli%3E%3C%2Ful%3E%3Cp%3EIs+there+anything+else+you%27d+like+to+filter+by%2C+or+would+you+like+to+see+approvals+for+a+different+period%3F%3C%2Fp%3E%22%7D%2C%7B%22citations%22%3A%5B%7B%22connectorName%22%3A%22coupa%22%2C%22citationTitle%22%3A%22Expense+Report+-+Client+Dinner+-+Project+Alpha%22%7D%2C%7B%22connectorName%22%3A%22coupa%22%2C%22citationTitle%22%3A%22Expense+Report+-+Software+Subscription+Renewal%22%7D%2C%7B%22connectorName%22%3A%22coupa%22%2C%22citationTitle%22%3A%22Expense+Report+-+Travel+to+HQ%22%7D%5D%7D%5D%7D%5D%7D) shows the experience we are going to build. + +## **Installation Steps** + +We recommend setting up the Coupa before installing this plugin. Please follow the [**Coupa Connector**](https://marketplace.moveworks.com/connectors/coupa) guide to configure the connection. + +**User Consent Authentication Benefits** + +With OAuth 2.0 User Consent Authentication enabled, users can securely access their own Coupa data (approvals, requisitions, invoices, expenses) directly through Moveworks without sharing credentials. Each user authenticates once via Coupa’s login page, granting the bot permission to act on their behalf. This ensures data privacy, role-based access control, and a seamless self-service experience—users only see what they’re authorized to view in Coupa. + +**Note:** To enable access to the Coupa API endpoints used in this plugin, ensure that your Coupa API client has the required OAuth scopes and permissions assigned under: + + **Setup → OAuth2/OpenID Connect Clients → [Your Client]**. + +Specifically, confirm that the following **API scopes** are granted: + +- **core.approval.read** +- **core.requisition.read** +- **core.invoice.read** +- **core.expense.read** +- **core.common.read** + +These permissions are required to retrieve approval history data from Coupa environment using the API. + +After you have configured the connector, please refer to our [plugin installation documentation](https://help.moveworks.com/docs/ai-agent-marketplace-installation) for more details on how to install a plugin in Agent Studio. + +## **Appendix** + +### **API #1: Get Approvals History** + +```bash +curl --location 'https:///api/approvals?created_at[gt_or_eq]={{start_date}}&created_at[lt_or_eq]={{end_date}}&limit=100&offset=0&order_by=desc' \ +--header 'Accept: application/json' \ +--header 'Authorization: Bearer {{access_token}}' +``` + +**Query Parameters:** + +- `start_date` – Returns approval records created **on or after** this timestamp (Example: `2024-01-01T00:00:00-07:00`) +- `end_date` – Returns approval records created **on or before** this timestamp (Example: `2024-10-01T00:23:59-07:00`) +- `limit` – Maximum number of approval records per page (default: 100) +- `offset` – Pagination offset for fetching the next batch of records +- `order_by` – Sorting order for results, typically `"desc"` for latest approvals first + +### **API #2: Get Approvable Item Details** + +```bash +curl --location 'https:///api/{{approvable_type}}/{{approvable_id}}' \ +--header 'Accept: application/json' \ +--header 'Authorization: Bearer {{access_token}}' +``` + +**Path Parameters:** + +- `approvable_type` - The Coupa API resource type. Example values: `invoices`, `requisitions`, `expense_reports`. +- `approvable_id` **-** The unique numeric ID of the approvable item. \ No newline at end of file