Check out the dev guide for sample code. If it does not work, post the body payload (remove real and sensitive info i.e the real phone number etc.)
I’ve used the sample code as guide for implementing it in my next JS app, I only modified to have mapped fax numbers to file names. I had a similar python code where I also used the sample python code as guide, and it works fine. I did a workaround where I used the existing python file as an API but its very inconvenient and has delayed responses. Can I clarify what you mean by posting the body payload?