# SmartRest2.0 to update Status of operation

**URL:** <https://community.cumulocity.com/t/smartrest2-0-to-update-status-of-operation/7420>\
**Category:** Forum\
**Tags:** device-connectivity, cumulocity\
**Created:** [August 15, 2022, 12:47pm UTC](https://community.cumulocity.com/t/smartrest2-0-to-update-status-of-operation/7420 "2022-08-15T12:47:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon18601492](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@anon18601492](https://community.cumulocity.com/u/anon18601492)\
**Post date:** [August 15, 2022, 12:47pm UTC](https://community.cumulocity.com/t/smartrest2-0-to-update-status-of-operation/7420/1 "2022-08-15T12:47:00Z")

</div>

Dear Team,  
I am trying to add SmartRest2.0 template to update Status of Operations.  
Below capture is my configuration for the template.

 ![smartRest2_0_operation_update](https://europe1.discourse-cdn.com/flex005/uploads/cumulocity/original/3X/2/e/2edcfc0e641acb4be89d03cd727fd74edf751cc7.png)

But the status of operation can’t be updated after sending ‘501’ to C8Y with MQTT.  
Topic: s/uc/json\_mqtt\_template  
payload: 501

---

<div class="post-metadata">

**Author:** ![Korbinian\_Butz](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/korbinian_butz/32/10473_2.png) [@Korbinian\_Butz](https://community.cumulocity.com/u/Korbinian_Butz)\
**Post date:** [August 15, 2022, 1:11pm UTC](https://community.cumulocity.com/t/smartrest2-0-to-update-status-of-operation/7420/2 "2022-08-15T13:11:19Z")

</div>

Hi Weihan,

updating an operation status to EXECUTING/SUCCESSFUL/FAILED is covered by the inbuilt Smart Rest 2 templates - is there a specific reason to add it to your SR templates?

You can find the in-built templates [here](https://cumulocity.com/guides/reference/smartrest-two/#mqtt-static-templates). To update an operation to EXECUTING you would send `501,<<your operation type>>` to topic `s/us`

---

<div class="post-metadata">

**Author:** ![Philipp\_Emmel](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/philipp_emmel/32/19455_2.png) [@Philipp\_Emmel](https://community.cumulocity.com/u/Philipp_Emmel)\
**Post date:** [August 15, 2022, 1:32pm UTC](https://community.cumulocity.com/t/smartrest2-0-to-update-status-of-operation/7420/3 "2022-08-15T13:32:22Z")

</div>

In order to be able to update operation status properly it is important that the status parameter is declared as “OPERATION STATUS” not as “STRING”.

---

<div class="post-metadata">

**Author:** ![anon18601492](https://avatars.discourse-cdn.com/v4/letter/a/85f322/32.png) [@anon18601492](https://community.cumulocity.com/u/anon18601492)\
**Post date:** [August 15, 2022, 1:41pm UTC](https://community.cumulocity.com/t/smartrest2-0-to-update-status-of-operation/7420/4 "2022-08-15T13:41:51Z")

</div>

yes, because only one uplink topic can be configured for the gateway, we have used smartRest2.0 templates to upload measurements in one command. We can’t use static topic s/us for another uplink topic.

获取 [Outlook for iOS](https://aka.ms/o0ukef)

---

<div class="post-metadata">

**Author:** ![Philipp\_Emmel](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/philipp_emmel/32/19455_2.png) [@Philipp\_Emmel](https://community.cumulocity.com/u/Philipp_Emmel)\
**Post date:** [August 15, 2022, 3:35pm UTC](https://community.cumulocity.com/t/smartrest2-0-to-update-status-of-operation/7420/5 "2022-08-15T15:35:27Z")

</div>

This limitation increases the complexity of your device integration very much. You will have to cover all the simplifications that are usually covered with static templates by creating many custom templates. You will also discover that certain essential features for a production level device integration (like software management) will become impossible. If you must choose between custom and static templates I’d rather use only static templates.

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/system/32/31990_2.png) [@system](https://community.cumulocity.com/u/system)\
**Post date:** [February 11, 2023, 3:36pm UTC](https://community.cumulocity.com/t/smartrest2-0-to-update-status-of-operation/7420/6 "2023-02-11T15:36:04Z")

</div>

Closed on February 11, 2023, 3:36pm UTC

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.
