# How to perform bulk upload from Thin Edge to Cumulocity?

**URL:** <https://community.cumulocity.com/t/how-to-perform-bulk-upload-from-thin-edge-to-cumulocity/5538>\
**Category:** Forum\
**Tags:** cumulocity\
**Created:** [April 27, 2023, 9:55am UTC](https://community.cumulocity.com/t/how-to-perform-bulk-upload-from-thin-edge-to-cumulocity/5538 "2023-04-27T09:55:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Harshil\_Gandhi](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/harshil_gandhi/32/6222_2.png) [@Harshil\_Gandhi](https://community.cumulocity.com/u/Harshil_Gandhi)\
**Post date:** [April 27, 2023, 9:55am UTC](https://community.cumulocity.com/t/how-to-perform-bulk-upload-from-thin-edge-to-cumulocity/5538/1 "2023-04-27T09:55:15Z")

</div>

#### _Product/components used and version/fix level are you on:_

#### _Detailed explanation of the problem:_

Hi everyone,

I’m currently working on a task where I need to upload large amounts of data from multiple devices connected to a Thin Edge platform to Cumulocity. I was wondering if anyone could provide some guidance on how to perform bulk uploads from Thin Edge to Cumulocity using the Cumulocity REST API or MQTT protocol.

Specifically, I’m looking for information on how to:

- Create batch requests in the Cumulocity REST API to perform operations on multiple objects at once
- Use MQTT publish topics to efficiently upload large amounts of data in batches

Any tips, advice, or sample code would be greatly appreciated. Thank you in advance for your help!

#### _Error messages / **full error** message screenshot / log fileL_

#### _Is your question related to the free trial, or to a production (customer) instance?_

#### _Have you installed all the latest fixes for the products and systems you are using?_

---

<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 28, 2023, 8:55am UTC](https://community.cumulocity.com/t/how-to-perform-bulk-upload-from-thin-edge-to-cumulocity/5538/2 "2023-04-28T08:55:20Z")

</div>

To answer your questions specifically:

> - Create batch requests in the Cumulocity REST API to perform operations on multiple objects at once

The REST API only supports batching on some APIs like Measurements [Cumulocity IoT - OpenAPI Specification](https://cumulocity.com/api/core/10.15.0/#operation/postMeasurementCollectionResource). For other like inventory, events etc. you need to do single requests

> - Use MQTT publish topics to efficiently upload large amounts of data in batches

Thin-edge has multiple ways to integrate data. You can either use thin-edge format [https://thin-edge.github.io/thin-edge.io/html/architecture/thin-edge-json.html](https://thin-edge.github.io/thin-edge.io/html/architecture/thin-edge-json.html) or using smartREST directly e.g. `tedge mqtt pub c8y/s/us 211,20`.

For the second you can send multiple different static SmartREST Messages within one MQTT Message (just add multiple lines in your payload) But you have to be aware of the 16 KB payload size.

REST doesn’t have that limit so for large amount of data I would suggest REST for data integration.

---

<div class="post-metadata">

**Author:** ![Harshil\_Gandhi](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/harshil_gandhi/32/6222_2.png) [@Harshil\_Gandhi](https://community.cumulocity.com/u/Harshil_Gandhi)\
**Post date:** [May 3, 2023, 2:45pm UTC](https://community.cumulocity.com/t/how-to-perform-bulk-upload-from-thin-edge-to-cumulocity/5538/3 "2023-05-03T14:45:53Z")

</div>

Thanks for the answer

is there any guide to follow to push data in batch using SMART Rest

---

<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 3, 2023, 2:57pm UTC](https://community.cumulocity.com/t/how-to-perform-bulk-upload-from-thin-edge-to-cumulocity/5538/4 "2023-05-03T14:57:51Z")

</div>

No, but it’s pretty simple. Just make sure to use line breaks for each message e.g.  
Publish s/us (timestamp is optional, when not provided it’s likely they will get the same server timestamp and overwrite themselves on same measurements).

```auto
211,20,2019-09-30T12:21:30.593Z
211,40,2019-09-30T12:21:45.593Z

```

you can also mix messages:  
Publish s/us (Creates a measurement + event)

```auto
211,20,2019-09-30T12:21:30.593Z
400,c8y_MyEvent,"Something was triggered"

```

---

<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:** [October 30, 2023, 2:58pm UTC](https://community.cumulocity.com/t/how-to-perform-bulk-upload-from-thin-edge-to-cumulocity/5538/5 "2023-10-30T14:58:00Z")

</div>

Closed on October 30, 2023, 2:58pm UTC

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