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..17873c4d --- /dev/null +++ b/plugins/coupa-look-up-my-approvals-history/.codeblocks/block_0.sh @@ -0,0 +1,3 @@ +curl --location 'https:///api/approvals?approvable-type={{approvable_type}}&created_at[gt_or_eq]={{start_date}}&created_at[lt_or_eq]={{end_date}}&status={{status}}&limit=50&offset=0' \ +--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..bd00feb5 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: BEGINNER +time_in_minutes: 15 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,59 @@ systems: - coupa --- +## Introduction + +The **“Look Up My Approvals History”** plugin enables users to instantly review their past approval actions in Coupa through the Moveworks AI Assistant. This automation allows employees to view details of previously approved, rejected, or pending items—such as requisitions, invoices, and expense reports—without leaving the Moveworks chat. This plugin enhances visibility, streamlines follow-ups, and reduces the need to manually navigate Coupa’s interface. + +This guide will walk you through installing and configuring the plugin in **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. + +Once the connector is successfully configured, follow our [**plugin installation documentation**](https://help.moveworks.com/docs/ai-agent-marketplace-installation) for detailed steps on how to install and activate the plugin in Agent Studio. + +## **Appendix** + +### **API #1 : Get Approvals History** + +```bash +curl --location 'https:///api/approvals?approvable-type={{approvable_type}}&created_at[gt_or_eq]={{start_date}}&created_at[lt_or_eq]={{end_date}}&status={{status}}&limit=50&offset=0' \ +--header 'Accept: application/json' \ +--header 'Authorization: Bearer {{access_token}}' +``` + +**Query Parameters:** + +- **`approvable-type`** (string) – Filters the approval records by object type. Supported values include `RequisitionHeader`, `InvoiceHeader`, and `ExpenseHeader`. +- **`startDate`** — Fetches the approval records (any selected type) created after this date (e.g., 2024-01-01T00:00:00-07:00) +- **`endDate`** — Fetches the approval records (any selected type) created before this date (e.g., 2024-10-01T00:23:59-07:00) +- **`status`** (string) – Filters the approval records by their current status. +- **`limit=50`** — Restricts the number of selected approval record returned per page +- **`offset=0`** — Defines the starting point. \ No newline at end of file