Exact Synergy REST service POC

A proof of concept for automating Exact Synergy Enterprise using a database connection and the Synergy REST API.

You will need https://flows.nodered.org/node/node-red-contrib-mssql

[{"id":"22bea925.5a0d36","type":"inject","z":"91100229.a5529","name":"Trigger","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":90,"y":60,"wires":[["ee8aba5e.1db9a8"]]},{"id":"ee8aba5e.1db9a8","type":"MSSQL","z":"91100229.a5529","mssqlCN":"e3e4a2f0.37c91","name":"SQL Input","query":"SELECT EmpID\n    ,Description\nFROM Absences (NOLOCK)\nWHERE Type = 0\n    AND SysCreated >= DATEADD(hh, -1, GETDATE())","outField":"payload","x":240,"y":60,"wires":[["ece77361.f09eb"]]},{"id":"ece77361.f09eb","type":"split","z":"91100229.a5529","name":"Split rows","splt":"\\n","spltType":"str","arraySplt":1,"arraySpltType":"len","stream":false,"addname":"","x":400,"y":60,"wires":[["797d9bf6.78bc54"]]},{"id":"797d9bf6.78bc54","type":"function","z":"91100229.a5529","name":"Parameters","func":"//Enter the Synergy URL here:\nvar url = 'http://MySynergy/demo';\n\n//Enter the webservice topic here:\nvar topic= 'Resource';\n\n//Leave this part:\nvar arr = msg.payload;\nmsg.payload = {};\n\n//Enter the target fields and the data. e.g.:\n//msg.payload.targetfield = arr.sourcefield\nmsg.payload.ID = arr.EmpID;\nmsg.payload.PhoneWorkMobile = arr.Description;\n\n//Leave this part:\nmsg.url = url + '/services/exact.entity.rest.svc/' + topic;\nmsg.headers = {};\nmsg.headers['Content-Type'] = 'application/json';\nmsg.headers.Accept = 'application/json';\nreturn msg;","outputs":1,"noerr":0,"x":570,"y":60,"wires":[["ec9b0244.ea025"]]},{"id":"ec9b0244.ea025","type":"http request","z":"91100229.a5529","name":"Request","method":"POST","ret":"obj","url":"","tls":"","x":740,"y":60,"wires":[["7ad82980.2a5268"]]},{"id":"7ad82980.2a5268","type":"debug","z":"91100229.a5529","name":"Response","active":true,"console":"false","complete":"payload","x":900,"y":60,"wires":[]},{"id":"e3e4a2f0.37c91","type":"MSSQL-CN","z":"","name":"MyDatabase","server":"MyDatabase.exactsoftware.com","encyption":false,"database":"Demo"}]
JMHellendoorn

Flow Info

created 3 weeks ago
updated 2 weeks, 2 days ago

Node Types

Core
  • debug (x1)
  • function (x1)
  • http request (x1)
  • inject (x1)
Other
  • MSSQL (x1)
  • MSSQL-CN (x1)
  • split (x1)

Tags

  • Exact
  • Synergy
  • Enterprise
  • REST
  • API
  • MSSQL
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option