Webhook Integration
Overview
PRIZM Cloud provides a webhook integration to send real-time IoT device data to your API server. This allows you to receive and process device updates as they occur.
How It Works
- PRIZM Cloud sends a
POSTrequest to the URL you specify. - The request includes headers and a JSON payload with device data.
- Your server should be configured to handle these incoming requests.
Request Format
HTTP Method:
POST
Headers:
The request will include standard headers. You may expect additional authentication headers if configured.
Payload Example:
[
{
"time": "1970-01-01T00:00:00Z",
"companyId": "uuid",
"deviceId": "uuid",
"value": {
"temperature": 22.5,
"humidity": 60
}
}
]Payload Fields:
| Field | Type | Description |
|---|---|---|
time | string | ISO 8601 timestamp of the data event. |
companyId | string | Unique identifier for the company. |
deviceId | string | Unique identifier for the device. |
value | object | Key-value pairs of device data. |
Configuring Your Webhook
To set up your webhook, provide PRIZM Cloud with the API endpoint URL where you want to receive data. Ensure your server is:
- Accepting
POSTrequests. - Handling incoming JSON payloads.
- Responding with a
200 OKstatus on successful receipt.
Handling Requests
Your server should:
- Validate the request (e.g., check for authentication if required).
- Parse the JSON payload to extract device data.
- Process the data according to your business logic.
- Respond with a success status (
200 OK) to acknowledge receipt.
Example Response:
{
"status": "success",
"message": "Data received"
}Error Handling
If your server cannot process the request, respond with an appropriate HTTP status code (400, 500, etc.) and an error message. PRIZM Cloud may retry failed deliveries depending on the configuration.
Example Error Response:
{
"status": "error",
"message": "Invalid data format"
}Security Considerations
- Use HTTPS for webhook URLs.
- Implement authentication (e.g., API keys, HMAC signatures) if needed.
- Validate and sanitize incoming data to prevent injection attacks.
- Use custom header key-value pairs for additional security validation.
For further assistance, contact PRIZM Cloud support.
Last updated on