Note: This article is technical, so we recommend involving someone with the right technical expertise. If you have any questions, contact us at support@azumuta.com.
A webhook peripheral lets an external system fill in the answer of a product check. When the operator reaches the step, Azumuta calls your webhook, reads the value from the response, and uses it as the answer. For example, a measurement service can return the measured value of a part, so the operator doesn’t type it.
Azumuta’s servers call the webhook, so you don’t need the Hub or any software on the workstation.
What you need
- A webhook endpoint that Azumuta’s servers can reach. It must be reachable from the internet, not only from the operator’s computer. To fill in an answer, it has to return JSON.
- The rights to manage peripherals and devices under Management, and to edit work instructions.
- A supported check. A webhook peripheral works with the OK/NOK, Number, Single Line, and Paragraph checks. The Procedure check can use one too, or its own webhook action. See Procedure check.
Create the peripheral
- Click Peripherals under Management.
- Click the yellow plus button.
- Type a Name and select or create the Peripheral group.
- Under How to connect?, select Webhook
- Fill in the webhook fields.
- When you’re done, click Add.
Webhook fields
- Webhook URL: the full http or https address of your endpoint.
- Method: POST, GET, PUT or PATCH.
- Authentication: how Azumuta identifies itself to your endpoint: None, Header, Basic or OAuth client credentials. These work in the same way for webhook triggers. See Authentication.
- Payload format and Webhook payload: With Azumuta format, your payload is sent inside Azumuta’s JSON body, next to the event fields. With JSON, XML, CSV or Text, only your payload is sent, with the matching content type. You can use parameters in the payload.
-
When to run the webhook:
- Automatic on first visit: the first time the operator opens the step.
- Automatic on every visit: every time the operator opens the step.
- Manual: the operator presses a button.
- Response format: JSON.
-
Webhook result parameter: where Azumuta finds the answer in the JSON response, for example
data.result.valuefor a response like{ "data": { "result": { "value": 17.3 } } }. Leave it empty to use the whole response. - Webhook remark parameter: where Azumuta finds a remark message in the JSON response.
Azumuta adds the product order number and the work instruction and recording IDs (when applicable) to the call: as URL parameters for GET, and in the JSON body for the Azumuta format.
Add the peripheral to a device
A check finds its peripheral through the device and the peripheral group. Add the peripheral to every device where operators run the work instruction:
- Click Devices under Management.
- Click the ⋮ (three-dot) icon next to the device, and click Edit device.
- Click the Peripherals tab.
- Under Peripherals for instruction checks, select the webhook peripheral.
- Click Save.
Use the peripheral on a check
- Open the instruction step and click the Check tab.
- Select a supported check.
- Under Peripheral options, select the Peripheral group of your webhook peripheral. You can also apply a peripheral preset.
- Adjust the options if needed:
- Payload: replaces the payload set on the peripheral for this check. Leave it empty to use the one on the peripheral. Write it in the payload format of the peripheral.
- Automatically submit answer after: submits the answer 0 to 10 seconds after it is filled in. Not available for the OK/NOK check.
- Allow manually entering answer: lets the operator type or change the answer. This is on by default.
Example
A quality service returns the measured value of a part. Your endpoint is https://qc.example.com/api/measurement and answers with:
{
"data": {
"value": 17.3,
"remark": "Within tolerance"
}
}
To use it on a Number check:
- Create a peripheral group for the Number check, for example "External measurement".
- Create a webhook peripheral in that group, with Method POST, Webhook result parameter
data.value, Webhook remark parameterdata.remark, and When to run the webhook set to Automatic on first visit. - Add the peripheral to the device that operators use.
- Add a Number check to the instruction step, and select the group under Peripheral options.
When the operator opens the step, Azumuta calls the endpoint and fills in 17.3 as the answer.
If your endpoint is unavailable
To let operators continue while your endpoint is down, tick Disable peripheral temporarily on the peripheral. Operators can then type the answers by hand. See Use a peripheral device.
Choose the right webhook
- To fill in the answer of a check from an external system, use a webhook peripheral, as described here.
- To validate a step, use the webhook action of a Procedure check.
- To notify another system when something happens, use a webhook trigger.