Skip to main content

Sends message to a communication channel

POST 

https://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.

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

Message is accepted for processing.

Authorization: http

name: bearerTokentype: httpscheme: bearerin: headerdescription: Authorization Header: `Authorization: Bearer <user_token>`
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());
Request Collapse all
Base URL
https://apis.<domain>
Auth
Parameters
— pathrequired
— path
Body required
[
  {
    "bn": "string",
    "bt": 0,
    "bu": 0,
    "bv": 0,
    "n": "string",
    "u": "string",
    "v": 0,
    "vs": "string",
    "vb": true,
    "vd": "string",
    "s": 0,
    "t": 0
  }
]