@itbv : Sorry, my code was broken.
I extracted parts of my flow to put it in one function block for you, and forgot to change bssid & rssi names.
Here is a working (and tested) example:
[{"id":"6e1ad3d3.689614","type":"function","z":"10b053c.e54872c","name":"Prepare Query","func":"msg.headers = {};\nmsg.headers['Ocp-Apim-Subscription-Key'] = 'YOUR_API_KEY';\nmsg.headers['Content-Type'] = 'application/json';\n\nvar access_points = msg.ttn.payload_fields.access_points;\nvar gateways = msg.ttn.metadata.gateways;\nmsg.payload = [];\n\n// Extract fine timestamps\nfor ( var i = 0; i < gateways.length; i++ ) {\n // Build gateway\n var gateway = {\n 'gatewayId': gateways[i].gtw_id.replace( 'eui-', 'lora_' ),\n 'antennaId': gateways[i].antenna,\n 'rssi': gateways[i].rssi,\n 'snr': gateways[i].snr,\n \n };\n \n // Add loc data if it exists\n if ( typeof gateways[i].latitude !== 'undefined' ) {\n gateway.antennaLocation = gateway.antennaLocation || {};\n gateway.antennaLocation.latitude = gateways[i].latitude;\n }\n if ( typeof gateways[i].longitude !== 'undefined' ) {\n gateway.antennaLocation = gateway.antennaLocation || {};\n gateway.antennaLocation.longitude = gateways[i].longitude;\n }\n if ( typeof gateways[i].altitude !== 'undefined' ) {\n gateway.antennaLocation = gateway.antennaLocation || {};\n gateway.antennaLocation.altitude = gateways[i].altitude;\n }\n // Add etimestamp if it exists\n if ( typeof gateways[i].fine_timestamp_encrypted !== 'undefined' ) {\n gateway.encryptedToa = gateways[i].fine_timestamp_encrypted;\n }\n \n msg.payload.push( gateway );\n}\n\nif ( typeof access_points !== 'undefined' ) {\n msg.payload.wifiAccessPoints = msg.ttn.payload_fields.access_points;\n msg.payload.wifiAccessPoints.forEach( elt=> {\n elt.macAddress = elt.bssid;\n delete elt.bssid;\n elt.signalStrength = elt.rssi;\n delete elt.rssi;\n })\n}\n\nif ( msg.payload.length > 0 ) {\n msg.collosQuery = msg.payload;\n \n msg.payload = {\n 'gatewayReceptions': msg.collosQuery,\n 'wifiAccessPoints': access_points\n };\n\n return msg;\n}\n\n\n\n\n \n","outputs":1,"noerr":0,"x":220,"y":180,"wires":[["1919540a.625d2c","f922d9f5.1e147"]]},{"id":"1919540a.625d2c","type":"http request","z":"10b053c.e54872c","name":"Collos - LoraSkyhook","method":"POST","ret":"txt","url":"https://api.preview.collos.org/localization-lora-recipes/v1/loraSkyhook","tls":"1014c3fa.a8617c","x":420,"y":180,"wires":[["d3af59a1.2289d8"]]},{"id":"d3af59a1.2289d8","type":"json","z":"10b053c.e54872c","name":"","pretty":false,"x":610,"y":180,"wires":[["f25df97f.4bdfa"]]},{"id":"f25df97f.4bdfa","type":"debug","z":"10b053c.e54872c","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":790,"y":180,"wires":[]},{"id":"f922d9f5.1e147","type":"debug","z":"10b053c.e54872c","name":"Query","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","x":430,"y":240,"wires":[]},{"id":"43b71b09.c8f014","type":"comment","z":"10b053c.e54872c","name":"Input from TTN","info":"","x":170,"y":120,"wires":[]},{"id":"1014c3fa.a8617c","type":"tls-config","z":"","name":"Mozilla-Certificate","cert":"","key":"","ca":"/data/ca-certificates.crt","certname":"","keyname":"","caname":"","verifyservercert":true}]