For the complete documentation index, see llms.txt. This page is also available as Markdown.

Template Events

Template event management

Get template events

get

Retrieve all events defined in a template.

Required permissions, when user-scoped authentication is used: PRODUCT_VIEW.

Authorizations
AuthorizationstringRequired

OAuth2 Bearer token obtained from authentication endpoint

Query parameters
templateIdinteger · int32Required

Template ID

Responses
200

List of events

application/json
idinteger · int32Required

Event ID

Example: 4
namestringRequired

Event name

Example: High Temperature
eventCodestringOptional

Event code for triggering

Example: HIGH_TEMP
typestring · enumRequired

Event type

Possible values:
get/api/v1/organization/template/events
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"
  }
]

Create template event

post

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.

Authorizations
AuthorizationstringRequired

OAuth2 Bearer token obtained from authentication endpoint

Body
productIdinteger · int32Required

Template ID

Example: 101
typestring · enumRequired

Event type

Possible values:
namestring · min: 1 · max: 200Required

Event name. Can only contain letters, digits, spaces, underscores, backslashes and punctuations.

Example: High Temperature
codestring · min: 1 · max: 200Required

Event code for triggering. Can only contain letters, digits, underscores and hyphens.

Example: HIGH_TEMP
colorstring · min: 1 · max: 200Required

Event color in HEX format (e.g.

Example: #FF0000
descriptionstring · max: 1024Optional

Event description.

Example: Temperature is too high.
showInTimelinebooleanOptional

Whether the event should be displayed in the timeline widget

Responses
201

Event created successfully

application/json
idinteger · int32Required

Event ID

Example: 4
namestringRequired

Event name

Example: High Temperature
eventCodestringOptional

Event code for triggering

Example: HIGH_TEMP
typestring · enumRequired

Event type

Possible values:
post/api/v1/organization/template/event/create
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 template event

put

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.

Authorizations
AuthorizationstringRequired

OAuth2 Bearer token obtained from authentication endpoint

Body
productIdinteger · int32Required

Template ID

Example: 101
idinteger · int32Required

Event ID, that should be updated

Example: 1
typestring · enumRequired

Event type

Possible values:
namestring · min: 1 · max: 200Required

Event name. Can only contain letters, digits, spaces, underscores, backslashes and punctuations.

Example: High Temperature
codestring · min: 1 · max: 200Required

Event code for triggering. Can only contain letters, digits, underscores and hyphens.

Example: HIGH_TEMP
colorstring · min: 1 · max: 200Required

Event color in HEX format (e.g.

Example: #FF0000
descriptionstring · max: 1024Optional

Event description.

Example: Temperature is too high.
showInTimelinebooleanOptional

Whether the event should be displayed in the timeline widget

Responses
200

Event updated successfully

application/json
idinteger · int32Required

Event ID

Example: 4
namestringRequired

Event name

Example: High Temperature
eventCodestringOptional

Event code for triggering

Example: HIGH_TEMP
typestring · enumRequired

Event type

Possible values:
put/api/v1/organization/template/event
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"
}

Delete template event

delete

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.

Authorizations
AuthorizationstringRequired

OAuth2 Bearer token obtained from authentication endpoint

Query parameters
templateIdinteger · int32Required

Template ID

eventIdinteger · int32Required

Event ID

Responses
204

Event deleted successfully

No content

delete/api/v1/organization/template/event
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?