Template Events
Template event management
Retrieve all events defined in a template.
Required permissions, when user-scoped authentication is used: PRODUCT_VIEW.
OAuth2 Bearer token obtained from authentication endpoint
Template ID
List of events
Event ID
4Event name
High TemperatureEvent code for triggering
HIGH_TEMPEvent type
Bad request
Forbidden
Template not found or access denied
Too many requests
Internal server error
GET /api/v1/organization/template/events?templateId=1 HTTP/1.1
Host: blynk.cloud
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
[
{
"id": 4,
"name": "High Temperature",
"eventCode": "HIGH_TEMP",
"type": "ONLINE"
}
]Add a new event to a template.
Only the original (root) template can be edited (the one with parentId = null). Sub-organizations cannot modify templates that were created by a parent organization. Event names and codes must be unique within the template.
Required permissions, when user-scoped authentication is used: PRODUCT_EDIT. Also, when the user-scoped authentication is used, user should have developer mode enabled.
OAuth2 Bearer token obtained from authentication endpoint
Template ID
101Event type
Event name. Can only contain letters, digits, spaces, underscores, backslashes and punctuations.
High TemperatureEvent code for triggering. Can only contain letters, digits, underscores and hyphens.
HIGH_TEMPEvent color in HEX format (e.g.
#FF0000Event description.
Temperature is too high.Whether the event should be displayed in the timeline widget
Event created successfully
Event ID
4Event name
High TemperatureEvent code for triggering
HIGH_TEMPEvent type
Bad request
Forbidden
Template not found or access denied
Too many requests
Internal server error
POST /api/v1/organization/template/event/create HTTP/1.1
Host: blynk.cloud
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 164
{
"productId": 101,
"type": "INFORMATION",
"name": "High Temperature",
"code": "HIGH_TEMP",
"color": "#FF0000",
"description": "Temperature is too high.",
"showInTimeline": true
}{
"id": 4,
"name": "High Temperature",
"eventCode": "HIGH_TEMP",
"type": "ONLINE"
}Update an event in a template.
Only the original (root) template can be edited (the one with parentId = null). Sub-organizations cannot modify templates that were created by a parent organization. Event names and codes must be unique within the template.
Required permissions, when user-scoped authentication is used: PRODUCT_EDIT. Also, when the user-scoped authentication is used, user should have developer mode enabled.
OAuth2 Bearer token obtained from authentication endpoint
Template ID
101Event ID, that should be updated
1Event type
Event name. Can only contain letters, digits, spaces, underscores, backslashes and punctuations.
High TemperatureEvent code for triggering. Can only contain letters, digits, underscores and hyphens.
HIGH_TEMPEvent color in HEX format (e.g.
#FF0000Event description.
Temperature is too high.Whether the event should be displayed in the timeline widget
Event updated successfully
Event ID
4Event name
High TemperatureEvent code for triggering
HIGH_TEMPEvent type
Bad request
Forbidden
Template/event not found or access denied
Too many requests
Internal server error
PUT /api/v1/organization/template/event HTTP/1.1
Host: blynk.cloud
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 171
{
"productId": 101,
"id": 1,
"type": "INFORMATION",
"name": "High Temperature",
"code": "HIGH_TEMP",
"color": "#FF0000",
"description": "Temperature is too high.",
"showInTimeline": true
}{
"id": 4,
"name": "High Temperature",
"eventCode": "HIGH_TEMP",
"type": "ONLINE"
}Remove an event from a template.
Only the original (root) template can be edited (the one with parentId = null). Sub-organizations cannot modify templates that were created by a parent organization.
Required permissions, when user-scoped authentication is used: PRODUCT_EDIT. Also, when the user-scoped authentication is used, user should have developer mode enabled.
OAuth2 Bearer token obtained from authentication endpoint
Template ID
Event ID
Event deleted successfully
No content
Bad request
Forbidden
Template/event not found or access denied
Too many requests
Internal server error
DELETE /api/v1/organization/template/event?templateId=1&eventId=1 HTTP/1.1
Host: blynk.cloud
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
No content
Last updated
Was this helpful?

