# How to receive response on cumulocity of a api

**URL:** <https://community.cumulocity.com/t/how-to-receive-response-on-cumulocity-of-a-api/941>\
**Category:** Forum\
**Tags:** cumulocity\
**Created:** [May 19, 2022, 5:36am UTC](https://community.cumulocity.com/t/how-to-receive-response-on-cumulocity-of-a-api/941 "2022-05-19T05:36:29Z")\
**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:** [May 19, 2022, 9:04am UTC](https://community.cumulocity.com/t/how-to-receive-response-on-cumulocity-of-a-api/941/2 "2022-05-19T09:04:04Z")

</div>

Hi Sumit,

have a look here: [SmartREST - Cumulocity IoT Guides](https://cumulocity.com/guides/reference/smartrest-two/#operation-templates)  
You receive a messsage/Operation via MQTT so what you have to do is actually setting the status to EXECUTING, FAILED, SUCCESSUFL by sending 501 (Executing), 502 (Failed) or 503 (Successful)

All of them must contain the Fragment of the Operation you’ve created in Cumulocity. So if you use Remote Shell this is ‘c8y\_Command’  
As an example for Shell Command the messages should look like:

- 501,c8y\_Command
- 502,c8y\_Commands,Failed because of unknown command
- 503,c8y\_Command,{{result of you command}} → in my example the show help response text.

The result is shown in the shell tab of Device Management.

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/cumulocity/original/3X/4/9/4938e3e8106be0e5f383e7a63ba0a8a136ebb1e2.png)

In Device Control in Device Management Application you can see the lifecycle of all operations.

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/cumulocity/original/3X/8/e/8e0cbfa03f2e81a92193d25c8ec73cdc4d9ab7f7.png)

---

_[View the full topic](https://community.cumulocity.com/t/how-to-receive-response-on-cumulocity-of-a-api/941)._
