Publishing to an event

I have an electron that collects water quality data remotely. I need to find a way to send data values to the electron. I am planning on creating an event with particle webhooks and publishing files from my PC to the Particle cloud and then subscribing the Electron to the events. Do I need to have another device (Photon or Electron) to publish to an event?


Great question. The answer is no, you do not need another physical device to publish an event to the cloud. You can publish an event using the CLI (see or using direct cloud calls (see

You should be able to publish events through any simple post web request. Just add the content to the post. I do the following in C#

var requestContent = new KeyValuePair<string, string>[] {
    new KeyValuePair<string, string> ("name", eventName),
    new KeyValuePair<string, string> ("data", data),
    new KeyValuePair<string, string> ("ttl", timeToLive.ToString()),
    new KeyValuePair<string, string> ("isPrivate", privateString),

    using (var client = new HttpClient(new NativeMessageHandler()))
        var response = await client.PostAsync(
        "" + "?access_token=" + AccessToken.Token,
        new FormUrlEncodedContent(requestContent));

        var particleResponse = await response.Content.ReadAsStringAsync();

        if (particleResponse.Contains("\"ok\": true"))
            return "Ok";

        return "Error";
    catch (Exception e)

Thank you, this is really helpful.