Incoming Webhooks
An incoming webhook is a method of bringing information from a third-party service or an API request to Zoho Procurement on occurrence of an event. In Zoho Procurement, you can use the action performed in the third-party service as a trigger to perform a task in Zoho Procurement.
Let’s understand this better with the help of a scenario.
Scenario: Patricia, the Procurement Manager at Zylker, organizes a corporate event where the company’s vendors and suppliers visit her booth. She collects the details of vendors who provide quotes for services or materials. After the event, she provides the vendors forms to submit their details and quotations. When a vendor fills in the form and clicks Submit, an incoming webhook is triggered, and the vendor’s information is automatically added to Zoho Procurement for easy tracking.
Create Incoming Webhooks
To receive notifications in your Zoho Procurement organization when a pre-configured action occurs in a third-party service, you need to create incoming webhooks. Here’s how:
- Go to Settings in the top right corner of the page.
- Click Incoming Webhooks under Developer Data.
- Click + New Incoming webhooks in the top right corner.
- Enter the Name and Description for the incoming webhook.
- Drag and drop the required components from the Elements Menu on the left to the Builder Area in the center to build the Deluge script required for the incoming webhook.
- Click Save.
OAuth and ZAPI Key URLs
Once you click Save, two URLs will be generated and displayed in a pop-up.
- OAuth URL: Securely authenticates requests sent to Zoho Procurement using OAuth-based authorization.
- ZAPI Key URL: Authenticates requests using a static API key, without requiring an OAuth flow.
These URLs are required for authenticating incoming webhook requests from third-party services. You can copy these URLs directly from the pop-up.
Warning: Ensure that only authorised users have access to these URLs. If exposed, any user who has access to the URLs can access the associated data.
You can also copy the URLs later. Here’s how:
- Go to Settings in the top right corner of the page.
- Click Incoming Webhooks under Developer Data.
- Hover the incoming webhook whose URLs you want to copy.
- Click the Dropdown icon and select Copy OAuth URL to copy the OAuth URL.
- Click the Dropdown icon and select Copy ZAPI URL URL to copy the ZAPI Key URL.
Configure Incoming Webhooks in Third-Party Services
After creating an incoming webhook, you must configure the generated OAuth and ZAPI Key URLs in the third-party service to complete the setup. If you wish to add any attributes in the script, you can do so at the time of the API call. The following request components are supported:
- Header: The header of the API request.
- Params: Parameters are the variable parts of the script given by the third-party API request.
- Body: It is a string that contains the request data of the API call. Once configured, the incoming webhook will be created. Now, when an activity takes place in the third-party service, the incoming webhook will be triggered and the action mentioned in the function will be executed.
Regenerate ZAPI Key URLs
If an incoming webhook’s ZAPI Key URL is exposed, shared unintentionally, or needs to be rotated for security reasons, you can regenerate it. Here’s how:
- Go to Settings in the top right corner of the page.
- Click Incoming Webhooks under Developer Data.
- Hover over the incoming webhook whose URL you want to regenerate.
- Click the Dropdown icon and select Edit.
- On the Edit Incoming Webhook, click Regenerate next to the ZAPI Key URL.
- In the following pop-up, click Regenerate again to confirm your action. New URL will be generated, and the old URL will be invalidated. Ensure that you update the new URL wherever it is used.
View Logs
You can get a history of the incoming webhooks received by your Zoho Procurement organization. Here’s how:
- Go to Settings in the top right corner of the page.
- Click Incoming Webhooks under Developer Data.
- Click View Logs in he top right corner.
- To view the logs of a particular incoming webhook, click the webhook’s name and click View Logs on the top right corner of the Edit Incoming Webhook page.
- You can filter incoming webhooks by their status, Success or Failure. Click the filter next to Status and select the required option.
Edit Incoming Webhooks
You can update the details of incoming webhooks by editing them. Here’s how:
- Go to Settings in the top right corner of the page.
- Click Incoming Webhooks under Developer Data.
- Hover over the incoming webhook you want to edit.
- Click the Dropdown icon and select Edit.
- Make the necessary changes and click Save.
Delete Incoming Webhooks
If you no longer need certain incoming webhooks, you can delete them. Here’s how:
- Go to Settings in the top right corner of the page.
- Click Incoming Webhooks under Developer Data.
- Hover over the incoming webhook you want to delete.
- Click the Dropdown icon and select Delete.
- In the following pop-up, confirm your action by clicking Delete again.