Okay, this is awesome. Thank you both for helping me out, I really appreciate it. I'm still relatively new at all of this. Running into some weird issues but sorting through them. Not ironically enough, the service I'm connecting to that I don't control is running Node. I know this because I got a Node error when testing in POSTman. Guess it shouldn't be surpising, Node in general seems to be the best for dynamic APIs.
Anyway, here's the new issue I'm working on. I have been changing things around and modifying based on the suggestions to get a new error. Now it is telling me a header is missing but it's not. Check this out.
Logon request response:
{"_msgid":"a462e36c74f078ac","payload":{"version":"7.44.0","session":"82CEE509-23BF-4936-BD96-B8E409A77D1C"},"topic":"","headers":{"cache-control":"no-cache","keep-alive":"timeout=5","content-type":"application/json; charset=utf-8","set-cookie":["session=82CEE509-23BF-4936-BD96-B8E409A77D1C; Secure; HttpOnly; Path=/;samesite=none","AV-Cookie=!h0K7l+7wJaOuvbBEpB17PCYniylded024VTS7y4R/Yx3wwyAj2nkGVKIQIafGa3zdlCFPHcuoB/pOQ==; path=/; Httponly; Secure;samesite=none","TS01a6bd37=01cf42f8a6fe90faa7ac977ef0a4aadce1d9f8019506b98aa562ef5924c51499b77b689b1a53b69dffdb418af987099fcf03b200fa53b9e423b7c7f1216a77e6d2eb35840bd06c73ee7a6445b38e27a683091f6580; Path=/; Secure; HTTPOnly;samesite=none"],"date":"Thu, 24 Feb 2022 05:11:40 GMT","content-length":"69","connection":"close","x-frame-options":"SAMEORIGIN","x-xss-protection":"1; mode=block","x-content-type-options":"nosniff","content-security-policy":"script-src 'unsafe-inline' 'unsafe-eval' 'self' https://*; object-src 'self'","strict-transport-security":"max-age=16070400; includeSubDomains","vary":"Accept-Encoding"},"statusCode":200}
Lookup content:
{"_msgid":"a462e36c74f078ac","payload":{"actions":[{"method":"mark","params":{"ticket_number":"13780448510"}}],"set":{"Options::performance_ids":"AE104AF2-EE91-4BD4-8919-62262CAF0778","Options::marking_options":"status"},"get":["Ticket","Seat","Order","Customer","Options","Items","ItemDetails","Result"],"objectname":"myticket"},"headers":{"cache-control":"no-cache","keep-alive":"timeout=5","content-type":"application/json; charset=utf-8","set-cookie":["session=82CEE509-23BF-4936-BD96-B8E409A77D1C; Secure; HttpOnly; Path=/;samesite=none","AV-Cookie=!h0K7l+7wJaOuvbBEpB17PCYniylded024VTS7y4R/Yx3wwyAj2nkGVKIQIafGa3zdlCFPHcuoB/pOQ==; path=/; Httponly; Secure;samesite=none","TS01a6bd37=01cf42f8a6fe90faa7ac977ef0a4aadce1d9f8019506b98aa562ef5924c51499b77b689b1a53b69dffdb418af987099fcf03b200fa53b9e423b7c7f1216a77e6d2eb35840bd06c73ee7a6445b38e27a683091f6580; Path=/; Secure; HTTPOnly;samesite=none"],"date":"Thu, 24 Feb 2022 05:11:40 GMT","connection":"close","x-frame-options":"SAMEORIGIN","x-xss-protection":"1; mode=block","x-content-type-options":"nosniff","content-security-policy":"script-src 'unsafe-inline' 'unsafe-eval' 'self' https://*; object-src 'self'","strict-transport-security":"max-age=16070400; includeSubDomains","vary":"Accept-Encoding","accept":"application/json"}}
The funniest part is the response from the lookup.
{"_msgid":"a462e36c74f078ac","payload":{"version":"7.44.0","session":"E1B60202-FF64-473B-B5ED-21A68BA93840","errorCode":"2","message":"The 'Accept' header must be 'application/json'"},"headers":{"cache-control":"no-cache","keep-alive":"timeout=5","content-type":"application/json; charset=utf-8","set-cookie":["session=E1B60202-FF64-473B-B5ED-21A68BA93840; Secure; HttpOnly; Path=/;samesite=none","AV-Cookie=!ka+Js+whGN8z6vlEpB17PCYniyldef/8RpFCvRBd/zrkSY8a7oxLhHsGQ3wSG9G5v4iXqTHjNOQ8imc=; path=/; Httponly; Secure;samesite=none","TS01a6bd37=01cf42f8a6a9c6f93adae53747f5c917d71ffb1d099d9fdec469e5a69ea1f885deb654d92d2625cb1e72e9feba5e0b6f6d0ef9335ee0023051c55f36b12b2460642e4f51e074f27d7c719413d5b6d07b72fd8be506; Path=/; Secure; HTTPOnly;samesite=none"],"date":"Thu, 24 Feb 2022 05:11:40 GMT","content-length":"144","connection":"close","x-frame-options":"SAMEORIGIN","x-xss-protection":"1; mode=block","x-content-type-options":"nosniff","content-security-policy":"script-src 'unsafe-inline' 'unsafe-eval' 'self' https://*; object-src 'self'","strict-transport-security":"max-age=16070400; includeSubDomains","vary":"Accept-Encoding"},"statusCode":400}
Also yes, I started using the function node to delete content to get to this point. Specifically that content length was throwing a JSON error on their side. Also, it doesn't seem to matter if I capitalize Accept.
msg.headers = msg.headers || {}; //make headers an object if empty
msg.headers["accept"] = 'application/json';
delete msg.topic;
delete msg.statusCode;
delete msg.headers["content-length"];
return msg;