Thanks for the valuable details and for your will to help, appreciated.
allow me to clarify that we have a public instance on the cloud, as far as i know the new Cumulocity MQTT Service will be publicly available on our public cloud instances in few weeks and it is not available right now
in addition the MQTT packets are received from the positioning engine (which is the publisher/broker) → we receive them on a middleware → from there we were doing REST API calls for every device ID → now with smart REST we are trying to push multiple device IDs lines together using CSV
2nd part: I agree with you that with POST/PUT I don’t need the answer, but how to get rid of this “41,1,Bad response template definition” when I do a post using smart REST? how to remove the response template from being a road block? Initially I didn’t have any response template created and I created it after seeing the “41,1,Bad response template definition” message, my priority for now to see the event created on Cumulocity which is still not happening
for your reference providing the very simple python code issuing smart rest API call (POST):
import requests
# Define the Smart REST API endpoint
url = "https://xxx.emea.cumulocity.com/smartrest/1001" # '1001' is our Smart REST template ID
headers = {
"Authorization": "Basic TVFUVxxxAAAAA", credentials
"Content-Type": "text/plain" # Smart REST generally uses plain text payloads
}
# Smart REST payload (formatted as per the template)
# Message ID 10 followed by time,altitude,longitude,latitude,sourceId,
payload ="10,2025-05-1T00:00:47.000+02:00,0,55.2957114,25.1878645,7742688525"
# Perform the POST request
try:
response = requests.post(url, headers=headers, data=payload)
# Check response status
if response.status_code == 200:
print("Request successful!", response.status_code)
print("Response:", response.text)
else:
print("Error:", response.status_code)
print("Response:", response.text)
except Exception as e:
print("An error occurred:", e)
and that is our template:
Finally just by curiosity why I am receiving response code 200 for the API call is the undelying message payload contains 41 error code which indicates that the post was not successful