Insights Hub Visual Flow Creator - http request node

2024-01-02T10:43:59.000-0500
Applications

Summary

VFC http request, http request put, http request patch, http request delete, WriteLocationToAsset, VFC update description, Error 403, cannot parse JSON SyntaxError: Unexpected end of JSON input


Details

HTTP request PUT

following example can be used and adjusted accordingly:
https://github.com/mindsphere/vfc-examples/tree/main/WriteLocationToAsset

Note that in case only some of the variables (e.g. longitude and latitude) will be updated via PUT, then the rest of the variables under "location", variables that are not include in the PUT request, will be set to null:
image.png

HTTP request PATCH

in order to update only a single field, for example the "description" field, then in the github example above one needs to change the method to "Patch" (inside the http request node) and add following line:
msg.headers["Content-Type"] = "application/merge-patch+json";
in the function node:
image.png

Error 403

in case of 403 error, please make sure the option "Extended scopes" is enabled:

image.png
 

Error cannot parse JSON SyntaxError: Unexpected end of JSON input

in case of json syntax-error, please make sure the "Return" value is set to "a UTF string" inside the http request node:

image.png

KB Article ID# KB000128865_EN_US

Contents

SummaryDetails

Associated Components

Insights Hub Visual Flow Creator