<?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[Minimum required Mango REST V2 API JSON values documentation]]></title><description><![CDATA[<p dir="auto">To start with there is nothing at <a href="http://MANGO-IP:8080/rest/v2/swagger/v2/api-docs" rel="nofollow ugc">http://MANGO-IP:8080/rest/v2/swagger/v2/api-docs</a></p>
<p dir="auto">Nor can I find any detailed information.</p>
<p dir="auto">Specifically I would like to know the required minimum json values for</p>
<p dir="auto">PUT /rest/v2/data-points (create data-point)</p>
<p dir="auto">The example in Swagger lists all values, but there is no indication which values are required and which values are set to default when left out. The full PUT request to create a point is (relatively) large 1634 bytes for the request data below.</p>
<p dir="auto">Also, I am looking for a list of error codes for each API.</p>
<pre><code>{
  "xid": "Dummy12345-1",
  "name": "Dummy12345-1",
  "enabled": true,
  "deviceName": "dummy12345",
  "readPermission": "",
  "setPermission": "",
  "pointFolderId": 0,
  "purgeOverride": false,
  "pointLocator": {
    "max": 100,
    "min": 0,
    "maxChange": 0.1,
    "startValue": "50",
    "modelType": "PL.VIRTUAL",
    "dataType": "NUMERIC",
    "settable": true,
    "changeType": "BROWNIAN",
    "values": []
  },
  "chartColour": "",
  "loggingProperties": {
    "cacheSize": 1,
    "loggingType": "INTERVAL",
    "tolerance": 0,
    "discardExtremeValues": false,
    "intervalLoggingType": "AVERAGE",
    "intervalLoggingPeriod": {
      "periods": 1,
      "type": "MINUTES"
    },
    "overrideIntervalLoggingSamples": false
  },
  "textRenderer": {
    "type": "textRendererAnalog",
    "format": "0.00",
    "suffix": "",
    "useUnitAsSuffix": false
  },
  "chartRenderer": {
    "type": "chartRendererImage",
    "timePeriod": {
      "periods": 1,
      "type": "DAYS"
    }
  },
  "rollup": "NONE",
  "simplifyType": "NONE",
  "simplifyTolerance": "NaN",
  "simplifyTarget": 1000,
  "templateXid": null,
  "dataSourceXid": "dummy12345",
  "tags": {},
  "plotType": "SPLINE",
  "dataSourceTypeName": "VIRTUAL"
}
</code></pre>
]]></description><link>https://forum.mango-os.com/topic/4644/minimum-required-mango-rest-v2-api-json-values-documentation</link><generator>RSS for Node</generator><lastBuildDate>Wed, 16 Sep 2026 15:06:33 GMT</lastBuildDate><atom:link href="https://forum.mango-os.com/topic/4644.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 19 Dec 2019 08:46:49 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Minimum required Mango REST V2 API JSON values documentation on Sat, 21 Dec 2019 00:36:19 GMT]]></title><description><![CDATA[<p dir="auto">No worries,</p>
<p dir="auto">Sorry about that you are right, that was a node.js code snippet not JSON.  And yes those codes are also very common.  In v3 of the REST api we are going to put some effort into making the Swagger output accurate AND useful...</p>
]]></description><link>https://forum.mango-os.com/post/24383</link><guid isPermaLink="true">https://forum.mango-os.com/post/24383</guid><dc:creator><![CDATA[terrypacker]]></dc:creator><pubDate>Sat, 21 Dec 2019 00:36:19 GMT</pubDate></item><item><title><![CDATA[Reply to Minimum required Mango REST V2 API JSON values documentation on Sat, 21 Dec 2019 00:13:47 GMT]]></title><description><![CDATA[<p dir="auto">Thanks Terry,</p>
<p dir="auto">Almost. Mango API needs double quotes around names and values. Anyway this works:</p>
<pre><code>{
  "name": "emon3175585-19",
  "xid": "emon3175585-19", &lt;-- no need if you want Mango to auto create
  "dataSourceXid" : "emon3175585",
  "enabled": true,
  "pointLocator" : {
       "startValue" : "0",
       "modelType" : "PL.VIRTUAL",
       "dataType" : "NUMERIC",
       "settable" : true,
       "changeType" : "NO_CHANGE"
    }
}
</code></pre>
<p dir="auto">To add a few more codes:<br />
201 - Created<br />
403 - no authorization</p>
]]></description><link>https://forum.mango-os.com/post/24382</link><guid isPermaLink="true">https://forum.mango-os.com/post/24382</guid><dc:creator><![CDATA[Balistar]]></dc:creator><pubDate>Sat, 21 Dec 2019 00:13:47 GMT</pubDate></item><item><title><![CDATA[Reply to Minimum required Mango REST V2 API JSON values documentation on Fri, 20 Dec 2019 00:07:08 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/balistar" aria-label="Profile: Balistar">@<bdi>Balistar</bdi></a> there are many permutations of creating a data point but this should give you a decent start:</p>
<p dir="auto"><a href="https://github.com/infiniteautomation/ma-modules-public/blob/85658f8eed2e681c00c0511c9264c4901be87670/Mango%20API/api-test/dataPoint.spec.js#L167" rel="nofollow ugc">https://github.com/infiniteautomation/ma-modules-public/blob/85658f8eed2e681c00c0511c9264c4901be87670/Mango API/api-test/dataPoint.spec.js#L167</a></p>
<p dir="auto">specifically:</p>
<pre><code>{
  name: 'Node mango client test 2',
  dataSourceXid : 'mango_client_test',
  pointLocator : {
       startValue : '0',
       modelType : 'PL.VIRTUAL',
       dataType : 'NUMERIC',
       settable : false,
       changeType : 'BROWNIAN',
       max: 100,
       maxChange: 0.01,
       min: 0
    }
}
</code></pre>
<p dir="auto">As for error code documentation, our Swagger documentation isn't complete so that will have to be trial and error, Generally these are the only errors you will get from our controllers:</p>
<p dir="auto">500 - Server error<br />
422 - Validation error<br />
404 - item not found<br />
400 - Bad Request</p>
]]></description><link>https://forum.mango-os.com/post/24376</link><guid isPermaLink="true">https://forum.mango-os.com/post/24376</guid><dc:creator><![CDATA[terrypacker]]></dc:creator><pubDate>Fri, 20 Dec 2019 00:07:08 GMT</pubDate></item></channel></rss>