Current RMS

Very simple flow for interacting with the Current RMS API.
This example shows number of ongoing projects and uses API keys to authenticate
but OAuth2 is preferred whenever possible due to security reasons.
Will possibly be revised with OAuth2 support.

[{"id":"ba6ef039.d96c6","type":"tab","label":"Current RMS API","disabled":false,"info":"Copyright (C) 2021 Johan Nilsson\nhttps://gobo.ws"},{"id":"b4a62cda.c65b1","type":"function","z":"ba6ef039.d96c6","name":"set headers","func":"msg.headers = {};\nmsg.headers['X-SUBDOMAIN'] = 'yoursubdomain';\nmsg.headers['X-AUTH-TOKEN'] = 'yourapikey';\n\nreturn msg;","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":310,"y":320,"wires":[["f9f3fd13.0beca"]]},{"id":"c4d71994.7aad58","type":"inject","z":"ba6ef039.d96c6","name":"","props":[{"p":"payload","v":"","vt":"date"},{"p":"topic","v":"","vt":"string"}],"repeat":"","crontab":"","once":false,"topic":"","payload":"","payloadType":"date","x":160,"y":320,"wires":[["b4a62cda.c65b1"]]},{"id":"f9f3fd13.0beca","type":"http request","z":"ba6ef039.d96c6","name":"connect to API endpoint","method":"GET","ret":"obj","paytoqs":"ignore","url":"https://api.current-rms.com/api/v1/projects?page=1&per_page=20&filtermode=live&view_id=1","tls":"","persist":false,"proxy":"","authType":"","x":510,"y":320,"wires":[["965f9b89.328568"]]},{"id":"abc83d2e.2dc5c","type":"debug","z":"ba6ef039.d96c6","name":"debug","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":830,"y":320,"wires":[]},{"id":"965f9b89.328568","type":"template","z":"ba6ef039.d96c6","name":"","field":"payload","fieldType":"msg","format":"handlebars","syntax":"mustache","template":"Currently {{payload.meta.total_row_count}} ongoing projects","output":"str","x":700,"y":320,"wires":[["abc83d2e.2dc5c"]]},{"id":"81b6c6c.118cd38","type":"comment","z":"ba6ef039.d96c6","name":"Ongoing projects","info":"","x":160,"y":260,"wires":[]}]

Flow Info

Created 4 years, 7 months ago
Rating: not yet rated

Owner

Actions

Rate:

Node Types

Core
  • comment (x1)
  • debug (x1)
  • function (x1)
  • http request (x1)
  • inject (x1)
  • template (x1)
Other
  • tab (x1)

Tags

  • Current RMS
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option