Particle publish event

hi
i have a question related to particle publish, when an event is called i can get it to show up in the event log using particle publish, is there a way to keep it in the log, when i log out or go on the app i can see it live but wont stay if i exit out and log back in,

is this just how it works? or it there a way of having a log of events that are saved ?
i am using it for a door open or closed so i know where it is and its easy if it records and stays saved so i can view last movement

thanks Karl

HI @k_bankier

Would the above be what you are looking for? Using which, you can retrieve and archive the event stream.

hi @particle7888
this is what i found so im thinking the ttl part is 60 sec meaning when published it will stay for 60 sec,

  • ttl number
    How long the event should persist
    $ curl https://api.particle.io/v1/devices/events
    -d “name=myevent”
    -d “data=Hello World”
    -d “private=true”
    -d “ttl=60”
    -d “access_token=1234”

this is my part of code for publish so can i add ttl= 60 under this or have i got it wrong or a way so that it keeps either open or closed in the event until it sees another event?

Particle.publish(event, curState ? “OPEN” : “CLOSED”);

eventually i want to try do a push notification but for now just getting it working how i think it should be
thanks

TTL is a parameter that never had any meaning or purpose.

While this feature is on the wish list since the inception of Particle.publish() it hasn’t been implemented for anything but tracking events of Tracker devices.

Currently the only thing you can do is to have your own service that subscribes to these events and stores them somehow else.

1 Like