Problems with Math JS POST

I’m having issues with a POST request through api.mathjs.org I’m hoping someone can help me out with

it’s been a part of my app for a long time without issues, but started to see an error when running a particular workflow which I have traced back to the math.js plugin

it’s a simple POST request, which takes some numbers and performs some basic arithmetic, but when i go to ‘Initialize Call’ through the Bubble API connector page I get the following response:

There was an issue setting up your call.

Raw response for the API
Status code 404

Error
Cannot POST /v4///

When i try to run the same request through the math.js site directly it runs fine, so I don’t think it’s an issue with their servers or anything. In fact, all of the individual calls I have tested return the same error, so I don’t think it’s anything wrong with the call itself either.

Including some screenshots of my API settings, hoping it might give someone a clue as to what’s going on.

Would really appreciate some help!
Lee



The first screeshot is wrong because you are doing POST where you should do a GET with two url parameters (expr and precision) like http://api.mathjs.org/v4/?expr=2%2F3&precision=3

But POST should work with your second screenshot, however, the url need to be http://api.mathjs.org/v4/

thanks @Jici - it’s all the same POST request, just two screenshots as it wouldn’t fit in one.

that is the URL i am using? might be missing something obvious…

In the first screenshot, you tried to add url parameters. This will work if you use GET request
The url should be http://api.mathjs.org/v4/for both and in GET request, url parameters are expr and precision. In expr you will set (for value) your full expression. Bubble will encode it for you. OR you could also just set dynamic part in the url like http://api.mathjs.org/v4/?expr=[weight]*(1+(([reps] + [rir]/30))

If you use POST, you can use JSON, but again, your url is the same. Actually your url have / / in it after /v4/ leading to an endpoint that doesn’t exist and this is why you are getting 404.

You can test just by setting the simple url without anybody, and you will probably get a different error message/code.

By the way, why are you using API for something that can be done in Bubble expression?