# How to call rest API and subscribe for notification/event from custom widget

**URL:** <https://community.cumulocity.com/t/how-to-call-rest-api-and-subscribe-for-notification-event-from-custom-widget/7774>\
**Category:** Forum\
**Tags:** Angular, cumulocity-edge, mqtt, cumulocity\
**Created:** [April 18, 2023, 12:13pm UTC](https://community.cumulocity.com/t/how-to-call-rest-api-and-subscribe-for-notification-event-from-custom-widget/7774 "2023-04-18T12:13:54Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Stefan\_Witschel](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/stefan_witschel/32/31955_2.png) [@Stefan\_Witschel](https://community.cumulocity.com/u/Stefan_Witschel)\
**Post date:** [April 18, 2023, 12:42pm UTC](https://community.cumulocity.com/t/how-to-call-rest-api-and-subscribe-for-notification-event-from-custom-widget/7774/2 "2023-04-18T12:42:16Z")

</div>

Hi @sudarshan.karande

there is not REST API over MQTT just the REST API which you might use in your widget.

I would urge you to read either the documentation or the following knowledge base articles:

> **[Cumulocity documentation](https://cumulocity.com/docs/)**
>
> This documentation offers comprehensive information on the Cumulocity platform both from a user and from a developer perspective. It reflects the latest state of the Cumulocity platform and is continuously updated to align with recent software...

> [@Cumulocity IoT Web Development Tutorial - Part 3: Query data from Cumulocity IoT](https://community.cumulocity.com/t/cumulocity-iot-web-development-tutorial-part-3-query-data-from-cumulocity-iot/7678):
>
> [Cumulocity IoT Web Development Tutorial - Part 1: Start your journey](https://community.cumulocity.com/t/cumulocity-iot-web-development-tutorial-part-1-start-your-journey/4124)[Cumulocity IoT Web Development Tutorial - Part 2: Create your first component](https://community.cumulocity.com/t/cumulocity-iot-web-development-tutorial-part-2-create-your-first-component/5569) Cumulocity IoT Web Development Tutorial - Part 3: Query data from Cumulocity IoT [Cumulocity IoT Web Development Tutorial - Part 4: Convert component into a widget](https://community.cumulocity.com/t/cumulocity-iot-web-development-tutorial-part-4-convert-component-into-a-widget/2873)[Cumulocity IoT Web Development Tutorial - Part 5: Provide widget as a UI Plugin](https://community.cumulocity.com/t/cumulocity-iot-web-development-tutorial-part-5-provide-widget-as-a-ui-plugin/3926)Part 3 has finally arrived! [about-time] In the [last part](https://community.cumulocity.com/t/cumulocity-web-development-tutorial-part-2-create-your-first-component/5569) you have implemented your first componen…

[http://resources.cumulocity.com/documentation/websdk/client/classes/alarmservice.html](http://resources.cumulocity.com/documentation/websdk/client/classes/alarmservice.html)  
[http://resources.cumulocity.com/documentation/websdk/client/classes/eventservice.html](http://resources.cumulocity.com/documentation/websdk/client/classes/eventservice.html)

It is pretty simple to use the @c8y/client to read alarms (even on real-time) and visualize them in any widget / ui component.

---

_[View the full topic](https://community.cumulocity.com/t/how-to-call-rest-api-and-subscribe-for-notification-event-from-custom-widget/7774)._
