Sends message to a communication channel
POSThttps://apis.<domain>/iot/http/channels/:id/messages/:subtopic
Sends message to a communication channel.
Authorization Action:
core:channels:publish
Request
Path Parameters
id uuidrequired
Unique connectable's channel identifier.
subtopic string
Message subtopic.
Follow these instructions to target a specific custom service runnig on an edge device.
- application/json
Body arrayrequired
Message to be sent.
- Array [
- ]
bnstring
Base Name
btnumber<double>
Base Time
bunumber<double>
Base Unit
bvnumber<double>
Base Value
nstring
Name
ustring
Unit
vnumber<double>
Value
vsstring
String Value
vbboolean
Boolean Value
vdstring
Data Value
snumber<double>
Value Sum
tnumber<double>
Time
Responses
- 202
- 400
- 401
- 500
Message is accepted for processing.
Bad request.
Unauthorized.
Unexpected server-side error occurred.
- application/json
- Schema
- Example (auto)
Schema
stringstring<byte>
"string"
Authorization: http
name: bearerTokentype: httpscheme: bearerin: headerdescription: Authorization Header: `Authorization: Bearer <user_token>`
- csharp
- curl
- dart
- go
- http
- java
- javascript
- kotlin
- c
- nodejs
- objective-c
- ocaml
- php
- powershell
- python
- r
- ruby
- rust
- shell
- swift
- HTTPCLIENT
- RESTSHARP
var client = new HttpClient();
var request = new HttpRequestMessage(HttpMethod.Post, "https://apis.<domain>/iot/http/channels/:id/messages/:subtopic");
request.Headers.Add("Authorization", "Bearer <token>");
var content = new StringContent("[\n {\n \"bn\": \"string\",\n \"bt\": 0,\n \"bu\": 0,\n \"bv\": 0,\n \"n\": \"string\",\n \"u\": \"string\",\n \"v\": 0,\n \"vs\": \"string\",\n \"vb\": true,\n \"vd\": \"string\",\n \"s\": 0,\n \"t\": 0\n }\n]", null, "application/json");
request.Content = content;
var response = await client.SendAsync(request);
response.EnsureSuccessStatusCode();
Console.WriteLine(await response.Content.ReadAsStringAsync());