# Using webdev API to Ack alarms and expose alarmjournal for 3rd party

**URL:** <https://forum.inductiveautomation.com/t/using-webdev-api-to-ack-alarms-and-expose-alarmjournal-for-3rd-party/62614>\
**Category:** Ignition\
**Tags:** ignition81, scripting\
**Created:** [August 3, 2022, 5:50am UTC](https://forum.inductiveautomation.com/t/using-webdev-api-to-ack-alarms-and-expose-alarmjournal-for-3rd-party/62614 "2022-08-03T05:50:47Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![johannes\_myrvoll](https://avatars.discourse-cdn.com/v4/letter/j/df705f/32.png) [@johannes\_myrvoll](https://forum.inductiveautomation.com/u/johannes_myrvoll)\
**Post date:** [August 3, 2022, 5:50am UTC](https://forum.inductiveautomation.com/t/using-webdev-api-to-ack-alarms-and-expose-alarmjournal-for-3rd-party/62614/1 "2022-08-03T05:50:47Z")

</div>

I am looking to create an API in the webdev module that lets you do the following:

- API endpoint where 3rd parties can request the alarm journal between a from - To date.
- Webdev module does a POST to a microservice when an alarm is active/unactive/acked
- If there is an active alarm, and the someone wants to acknowledge their alarm, they can do so with doing a POST to the API endpoint with a message “ACK alarm 123455”, to acknowledge the alarm remotely.

I know this isnt the best design for alarm handling, however it is the solution already chosen. Of course I’m not removing the normal alarmhandling the users use, and they will get a notification if the API Ack’d an alarm.

Does anyone know of existing solutions that does in part let you do some of what I’ve mentioned above? Always nice to know before starting from scratch!

I’ve looked into the Alarm pipeline as well, and am considering using it.

Thanks in advance!

---

<div class="post-metadata">

**Author:** ![jlandwerlen](https://avatars.discourse-cdn.com/v4/letter/j/bc8723/32.png) [@jlandwerlen](https://forum.inductiveautomation.com/u/jlandwerlen)\
**Post date:** [August 3, 2022, 1:24pm UTC](https://forum.inductiveautomation.com/t/using-webdev-api-to-ack-alarms-and-expose-alarmjournal-for-3rd-party/62614/2 "2022-08-03T13:24:59Z")

</div>

Not sure if this is helpful, but the linked post explains the use of an alarm listener.

> [@New Alarm Alert as a Popup](https://forum.inductiveautomation.com/t/new-alarm-alert-as-a-popup/15828):
>
> Hello All. I am new to the Ignition and I have a scenario where I would need to show a popup window with a Message saying that there is a new active unack alarm. Let me tell what I am trying in brief. Getting the alarm count in the timer script and trying to do a popup based on the difference in number of alarms. The script seems to work in Script Console but it doesnt work when it is inside action performed of Timer script. Here is the sample code: import system global lastcount alarms = s…

Maybe this will define a small piece of what you are trying to do.

---

<div class="post-metadata">

**Author:** ![bkarabinchak.psi](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bkarabinchak.psi/32/83567_2.png) [@bkarabinchak.psi](https://forum.inductiveautomation.com/u/bkarabinchak.psi)\
**Post date:** [August 3, 2022, 1:36pm UTC](https://forum.inductiveautomation.com/t/using-webdev-api-to-ack-alarms-and-expose-alarmjournal-for-3rd-party/62614/3 "2022-08-03T13:36:14Z")

</div>

@jlandwerlen 's answer should help you with the second requirement you have. You would just want to use [system.net.httpClient - Ignition User Manual 8.1 - Ignition Documentation](https://docs.inductiveautomation.com/display/DOC81/system.net.httpClient) in conjunction with catching the alarm state change to post to your micrososervice.

The first requirement you have should be pretty - seems like it should be something like

```auto
startDate = # startDate from get request
endDate = # endDate from get request
results = system.alarm.queryJournal(journalName="someJournal", startDate=startDate, endDate=endDate)
# parse results variable into suitable returnValue - depends on how you want to send it back

return returnValue

```

---

<div class="post-metadata">

**Author:** ![johannes\_myrvoll](https://avatars.discourse-cdn.com/v4/letter/j/df705f/32.png) [@johannes\_myrvoll](https://forum.inductiveautomation.com/u/johannes_myrvoll)\
**Post date:** [August 3, 2022, 1:41pm UTC](https://forum.inductiveautomation.com/t/using-webdev-api-to-ack-alarms-and-expose-alarmjournal-for-3rd-party/62614/4 "2022-08-03T13:41:26Z")

</div>

Thank you!

---

<div class="post-metadata">

**Author:** ![johannes\_myrvoll](https://avatars.discourse-cdn.com/v4/letter/j/df705f/32.png) [@johannes\_myrvoll](https://forum.inductiveautomation.com/u/johannes_myrvoll)\
**Post date:** [August 3, 2022, 1:43pm UTC](https://forum.inductiveautomation.com/t/using-webdev-api-to-ack-alarms-and-expose-alarmjournal-for-3rd-party/62614/5 "2022-08-03T13:43:17Z")

</div>

Cheers! yeah saw a couple of examples like this.
