<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[🔌 REST + JSON in IoT projects]]></title><description><![CDATA[<p dir="auto">Devices speak MQTT. Everything else — dashboards, scripts, platform config, phone apps — speaks REST and JSON. You'll meet this layer the moment a webhook never arrives, a platform call returns 403, or firmware chokes on a field that's suddenly <code>null</code>.</p>
<h3>Three stories you'll live through</h3>
<p dir="auto"><strong>"It works in Postman but not on the device."</strong> Postman hides memory limits. On an ESP32, parsing a 4 KB JSON payload with the wrong strategy fragments the heap or blows the stack. Stream or bound your parsing, check every field's presence and type before use, and never assume a key exists because it did yesterday. The device side has its own rules — when to reach for REST over MQTT, how to keep the memory footprint flat:<br />
→ <a href="https://embiq.grapesiot.com/embedded-iot/block3/3-5-1" rel="nofollow ugc">HTTP and REST from the device side</a></p>
<p dir="auto"><strong>"The API returns 403 and I don't know why."</strong> Almost always auth scope, an expired token, or a path that doesn't match your device ID exactly. Read the status code properly — 401 means prove who you are, 403 means you proved it and still can't, 429 means slow down — then reproduce with curl before touching firmware. The underlying principles are worth learning once, properly:<br />
→ <a href="https://embiq.grapesiot.com/application-development/30-rest-api-development/chapter-01" rel="nofollow ugc">HTTP and REST architectural principles</a><br />
→ <a href="https://embiq.grapesiot.com/application-development/30-rest-api-development/chapter-03" rel="nofollow ugc">Validation, errors and authentication</a></p>
<p dir="auto"><strong>"The payload shape keeps changing."</strong> Firmware v1 sends this:</p>
<pre><code class="language-json">{ "t": "v1", "temp": 27.4, "hum": 62.1 }
</code></pre>
<p dir="auto">Firmware v2 sends this:</p>
<pre><code class="language-json">{ "t": "v2", "temperature_c": 27.4, "humidity_rh": 62.1, "vbat_mv": 3910 }
</code></pre>
<p dir="auto">The dashboard breaks for half the fleet. Contracts matter: version your payloads (<code>t</code> or <code>v</code> on every message), accept missing optional fields with defaults, never crash on extra fields, and reject unknown major versions with a counted alert instead of silent garbage. Design the shape deliberately up front and this class of bug disappears:<br />
→ <a href="https://embiq.grapesiot.com/application-development/30-rest-api-development/chapter-02" rel="nofollow ugc">Resource modelling and API contracts</a></p>
<h3>Symptom → what to learn</h3>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>Symptom</th>
<th>What to learn</th>
</tr>
</thead>
<tbody>
<tr>
<td>401/403 from a platform API</td>
<td>Auth, tokens and scopes</td>
</tr>
<tr>
<td>Payload too big or shape drifting</td>
<td>Resource modelling and contracts</td>
</tr>
<tr>
<td>Works on desktop, fails on ESP32</td>
<td>JSON parsing under RAM limits</td>
</tr>
</tbody>
</table>
<hr />
<p dir="auto"><em>Start at <a href="https://embiq.grapesiot.com/application-development/30-rest-api-development/" rel="nofollow ugc">REST API Development</a> and work through it in order. Post the method + URL + status code + body (redact secrets), and what curl says. Tag with <code>api</code> or <code>json</code>.</em></p>
]]></description><link>https://forum.grapesiot.com/topic/75/rest-json-in-iot-projects</link><generator>RSS for Node</generator><lastBuildDate>Thu, 19 Nov 2026 13:02:48 GMT</lastBuildDate><atom:link href="https://forum.grapesiot.com/topic/75.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 03 Oct 2026 11:29:40 GMT</pubDate><ttl>60</ttl></channel></rss>