Post events

Definition

https://api.yodiwo.com/api/1.0/NODEKEY/SECRETKEY/porteventmsg


Parameters

Name Type
nodekey
required
string n/a
NodeKey (received during Node pairing)
secretkey
required
string n/a
SecretKey (received during Node pairing)

Examples

C#.
            
public void PostRestMsg(Tuple target_msg)
{
  try
  {
    //add base route
    string worker = "https://" + ActiveCfg.RestServer + ":443/api/";
    //add API ver
    worker += "v1.0/";
    //add nodekey
    worker += ActiveCfg.nodeKey + "/";
    //add secretkey
    worker += ActiveCfg.nodeSecret + "/";
    //add msg name
    worker += target_msg.Item1;
    
    var client = new HttpClient();
    
    client.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/json"));
    var task = client.PostAsync(worker, new StringContent(target_msg.Item2, Encoding.UTF8, "application/json"));
    task.Wait();
    
    HttpResponseMessage rsp = task.Result;
    if (rsp.StatusCode == System.Net.HttpStatusCode.OK)
    {
      Console.WriteLine("All ok!");
    }
  }
  catch {}
}
            
        

Result Format

Accepted

Documentation

Posts a new trigger to the cloud server. The message contains an array of port events that the cloud server should act on. Look into API event passing for more info.