# How to get Events

**URL:** <https://forum.genieacs.com/t/how-to-get-events/2902>\
**Category:** Uncategorized\
**Created:** [August 28, 2022, 8:28pm UTC](https://forum.genieacs.com/t/how-to-get-events/2902 "2022-08-28T20:28:48Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![MarkAtAgilliance](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/markatagilliance/32/833_2.png) [@MarkAtAgilliance](https://forum.genieacs.com/u/MarkAtAgilliance)\
**Post date:** [August 28, 2022, 8:28pm UTC](https://forum.genieacs.com/t/how-to-get-events/2902/1 "2022-08-28T20:28:48Z")

</div>

I want to read last bootstrap, boot, inform dates using getParameterValues

query = {  
“name”: “getParameterValues”,  
“parameterNames”: [  
“Events.0\_BOOTSTRAP”  
]  
}

e.g. tried getting parameters through the API like  
Events.0\_BOOTSTRAP  
\_events.0\_BOOTSTRAP  
\_events.\_0\_BOOTSTRAP

Is there a way to retrieve these as a getParameterValues query or another interface?

Thank you.

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [August 29, 2022, 2:41am UTC](https://forum.genieacs.com/t/how-to-get-events/2902/2 "2022-08-29T02:41:33Z")

</div>

If you are using the API, the data will be returned in the payload. If you are using a provision script, then in a declare.

With the API, you can also do a projection so you only return the data that you need. This is useful if you only care about a few pieces of data. `curl -i 'http://localhost:7557/devices?query=%7B%22_id%22%3A%22202BC1-BM632w-000000%22%7D&projection=Events.0_BOOTSTRAP,Events.1_BOOT,_lastInform'` This will give you the last bootstrap, last boot, and last inform.

In a provision script, you would do it like this:

```auto
const lastBootstrap = declare('Events.0_BOOTSTRAP', {value: 1}).value[0];
const lastBoot = declare('Events.1_BOOT', {value: 1}).value[0];
const lastInform = declare('Events.Inform', {value: 1}).value[0];

```

---

<div class="post-metadata">

**Author:** ![MarkAtAgilliance](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/markatagilliance/32/833_2.png) [@MarkAtAgilliance](https://forum.genieacs.com/u/MarkAtAgilliance)\
**Post date:** [August 29, 2022, 4:33pm UTC](https://forum.genieacs.com/t/how-to-get-events/2902/3 "2022-08-29T16:33:43Z")

</div>

Thank you. It was the API I was using (and it has been a while since I used it). I was using the wrong method (task vs query).

My query now is like yours: The path (without host) is:

`"/devices?query=%7B%22_id%22%3A%22104738-XS%252D2426G%252DA-ALCLFC00FF91%22%7D&projection=Events.0_BOOTSTRAP,Events.1_BOOT,_lastInform"`

I do get the \_lastInform time but not the Events.0\_BOOTSTRAP,Events.1\_BOOT.  
[  
{“\_id”:“104738-XS%2D2426G%2DA-ALCLFC00FF91”,“\_lastInform”:“2022-08-29T15:50:42.660Z”}  
]

I am using latest version, npm install. Here is what the device page shows.

 ![image](https://canada1.discourse-cdn.com/flex035/uploads/genieacs/original/1X/41f3c1cd86b4fb7de10e18f733934ba812a77d5b.png)

---

<div class="post-metadata">

**Author:** ![akcoder](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/akcoder/32/11_2.png) [@akcoder](https://forum.genieacs.com/u/akcoder)\
**Post date:** [August 29, 2022, 6:14pm UTC](https://forum.genieacs.com/t/how-to-get-events/2902/4 "2022-08-29T18:14:50Z")

</div>

Try these:  
`_lastInform,_lastBootstrap,_lastBoot,_registered`

---

<div class="post-metadata">

**Author:** ![MarkAtAgilliance](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.genieacs.com/markatagilliance/32/833_2.png) [@MarkAtAgilliance](https://forum.genieacs.com/u/MarkAtAgilliance)\
**Post date:** [August 29, 2022, 8:39pm UTC](https://forum.genieacs.com/t/how-to-get-events/2902/5 "2022-08-29T20:39:37Z")

</div>

Thank you very much, those worked.  
Regards,  
Mark.
