I am new to NodeRED and I'm testing out the APIs. I am trying to Post/trigger a flow on nodeRED through postman.
According to the api documentation, something like this should work:
curl --location --request POST 'http://localhost:1880/flows' \
--header 'Content-Type: application/json' \
--header 'Node-RED-Deployment-Type: full' \
--data-raw
[
{
"id": "01ef5ccf5a7ea370",
"type": "tab",
"label": "Flow 2",
"disabled": false,
"info": "",
"env": []
},
{
"id": "58ffae9d.a7005",
"type": "debug",
"z": "01ef5ccf5a7ea370",
"name": "",
"active": true,
"complete": false,
"x": 550,
"y": 180,
"wires": []
},
{
"id": "17626462.e89d9c",
"type": "inject",
"z": "01ef5ccf5a7ea370",
"name": "",
"repeat": "",
"once": false,
"topic": "",
"payload": "",
"x": 150,
"y": 180,
"wires": [
[
"2921667d.d6de9a"
]
]
},
{
"id": "2921667d.d6de9a",
"type": "function",
"z": "01ef5ccf5a7ea370",
"name": "Format timestamp",
"func": "// Create a Date object from the payload\nvar date = new Date(msg.payload);\n// Change the payload to be a formatted Date string\nmsg.payload = date.toString();\n// Return the message so it can be sent on\nreturn msg;",
"outputs": 1,
"x": 350,
"y": 180,
"wires": [
[
"58ffae9d.a7005"
]
]
}
]
But when I send this on postman, I get a 204 No Content
response. And on NodeRED UI, I get the notification:
The flows on the server have been updated.
And i am asked to review changes.
What I want is to trigger the flow from postman. I can't see anything that allows that in the documentation or perhaps, I am missing something.