Hello!
The issue:
It seems the HTTP IN node is truncating the body if it's too large. When I attempt to
JSON.parse(msg.payload.files)
I get SyntaxError: Unexpected token ' in JSON at position 1
Which makes sense, since msg.payload.files is truncated.
Details
I have an https in endpoint that is open to my carrier (VoIP)
This endpoint accepts two types of data, SMS and MMS. I have a switch node added to switch between
msg.payload.type ('incomingWebhookSMS' or 'incomingWebhookMMS')
The data that my carrier sends me is this format:
SMS
{
"type": "incomingWebhookSMS",
"destination_number": "XXXXXXXXXX",
"caller_id_number": "XXXXXXXXXX",
"text": "Hello world!"
}
MMS
{
"type": "incomingWebhookMMS",
"to": "XXXXXXXXXX",
"from": "XXXXXXXXXX",
"text": "",
"files": "{'d3c4090f-d23f-4945-8f44-faee2fb7af3c_123_1.jpeg': '/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAUDBAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChALCAgOCQgIDRUNDhERExMTCAsWGBYSGBASExIBBQUFCAcIDwkJDxIPDw8SEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEhISEv/AABEICtoFBAMBIgACEQEDEQH/xAAdAAEAAAcBAQAAAAAAAAAAAAAAAgMEBQYHCAEJ/8QAbhAAAQMCAQYIBgoKDQcKBQIHAQACAwQRBQYSEyExUQcIFEFhkaHRIjJScYGxFSNCU2JyksHS4RYzNXSCk7KztPAJGCQ0NlRVc3WUosLTF0OVo8PU1SVERWNkg4SFxPEmN6SlteNW4nbFRmblZf/EABwBAQADAQEBAQEAAAAAAAAAAAABAgMEBQYHCP/EAEgRAQABAwEEBggEBAMGBQUBAQABAgMRBBIhMVEFE0FhcZEUIjJSgaGx0RUzwfA0QnLhBiOyYnOCkqLxB0NTY8IWJCWz4tJ0/9oADAMBAAIRAxEAPwDeyIi818uzWkkz42O8pjT6SBdTVb8n5M6Bvw...",
"destination_number": "XXXXXXXXXX",
"caller_id_number": "XXXXXXXXXX"
}
As you can see, "files" is being truncated. How can I fix this?
Things I have tried
I have set
/** The maximum size of HTTP request that will be accepted by the runtime api.
* Default: 5mb
*/
apiMaxLength: '1000mb',
I started out with 50mb, then 100mb, and 1000mb and still no luck.
Thanks for reading!