[ { "id": "f6f2187d.f17ca8", "type": "tab", "label": "Flow 1", "disabled": false, "info": "" }, { "id": "d1db19fcbfa380c9", "type": "group", "z": "f6f2187d.f17ca8", "name": "Airship REST examples", "style": { "label": true }, "nodes": [ "048d6573330ae9e1", "1a727a113052adc9", "0f5a87beaf975c52", "382fb17230bacffb", "19453c032a27538f", "24942ca71a55e34b", "ab562cf7738e9278", "0b69bbf7b9e4195e", "04242047f35c04b7", "56a6afeb11469433", "4c04fa2ca89f6bd7", "e6eeb22cdcc571f7", "3ae09512be2ee7e9", "ef08bba91c0303a4", "da9248b854410d94" ], "x": 74, "y": 79, "w": 812, "h": 342 }, { "id": "048d6573330ae9e1", "type": "inject", "z": "f6f2187d.f17ca8", "g": "d1db19fcbfa380c9", "name": "POST Contact", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payloadType": "date", "x": 200, "y": 140, "wires": [ [ "1a727a113052adc9" ] ] }, { "id": "1a727a113052adc9", "type": "function", "z": "f6f2187d.f17ca8", "g": "d1db19fcbfa380c9", "name": "Payload", "func": "var contact = {\n \"email\": \"notmyemail@gmail.com\",\n \"first_name\": \"Andre\"\n //Other info here\n}\n\nmsg.payload = {\n \"token\" : \"Your API Token here\",\n \"contact\": contact\n};\n\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 440, "y": 140, "wires": [ [ "ab562cf7738e9278" ] ] }, { "id": "0f5a87beaf975c52", "type": "function", "z": "f6f2187d.f17ca8", "g": "d1db19fcbfa380c9", "name": "Payload", "func": "var body = {\n \"account_id\": 1,\n \"booking_id\": 123\n //Other info here\n}\n\nmsg.payload = {\n \"token\" : \"Your API Token here\",\n \"body\": body\n};\n\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 440, "y": 240, "wires": [ [ "0b69bbf7b9e4195e" ] ] }, { "id": "382fb17230bacffb", "type": "inject", "z": "f6f2187d.f17ca8", "g": "d1db19fcbfa380c9", "name": "POST booking (using body)", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payloadType": "date", "x": 240, "y": 240, "wires": [ [ "0f5a87beaf975c52" ] ] }, { "id": "19453c032a27538f", "type": "function", "z": "f6f2187d.f17ca8", "g": "d1db19fcbfa380c9", "name": "Payload", "func": "var body = {\n \"account_id\": 1,\n \"element_01\": \"My-Booking-Reference\"\n //Other info here\n}\n\nmsg.payload = {\n \"token\" : \"Your API Token here\",\n \"body\": body\n};\n\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 440, "y": 360, "wires": [ [ "04242047f35c04b7" ] ] }, { "id": "24942ca71a55e34b", "type": "inject", "z": "f6f2187d.f17ca8", "g": "d1db19fcbfa380c9", "name": "GET booking (using body)", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payloadType": "date", "x": 230, "y": 360, "wires": [ [ "19453c032a27538f" ] ] }, { "id": "ab562cf7738e9278", "type": "Airship REST", "z": "f6f2187d.f17ca8", "g": "d1db19fcbfa380c9", "name": "", "version": "v1", "method": "contact", "env": "", "x": 610, "y": 140, "wires": [ [ "56a6afeb11469433" ], [ "4c04fa2ca89f6bd7" ] ] }, { "id": "0b69bbf7b9e4195e", "type": "Airship REST", "z": "f6f2187d.f17ca8", "g": "d1db19fcbfa380c9", "name": "", "version": "v1", "method": "post_bookings", "env": "", "x": 610, "y": 240, "wires": [ [ "e6eeb22cdcc571f7" ], [ "3ae09512be2ee7e9" ] ] }, { "id": "04242047f35c04b7", "type": "Airship REST", "z": "f6f2187d.f17ca8", "g": "d1db19fcbfa380c9", "name": "", "version": "v1", "method": "get_bookings", "env": "", "x": 610, "y": 360, "wires": [ [ "ef08bba91c0303a4" ], [ "da9248b854410d94" ] ] }, { "id": "56a6afeb11469433", "type": "debug", "z": "f6f2187d.f17ca8", "g": "d1db19fcbfa380c9", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 770, "y": 120, "wires": [] }, { "id": "4c04fa2ca89f6bd7", "type": "debug", "z": "f6f2187d.f17ca8", "g": "d1db19fcbfa380c9", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 770, "y": 160, "wires": [] }, { "id": "e6eeb22cdcc571f7", "type": "debug", "z": "f6f2187d.f17ca8", "g": "d1db19fcbfa380c9", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 770, "y": 220, "wires": [] }, { "id": "3ae09512be2ee7e9", "type": "debug", "z": "f6f2187d.f17ca8", "g": "d1db19fcbfa380c9", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 770, "y": 260, "wires": [] }, { "id": "ef08bba91c0303a4", "type": "debug", "z": "f6f2187d.f17ca8", "g": "d1db19fcbfa380c9", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 770, "y": 340, "wires": [] }, { "id": "da9248b854410d94", "type": "debug", "z": "f6f2187d.f17ca8", "g": "d1db19fcbfa380c9", "name": "", "active": true, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 770, "y": 380, "wires": [] } ]