I’m tying to setup API calls to this service called Who Knows. They have a search API which I’m able to test in my code editor. I want to build this into my bubble website so I’m trying to build a plugin for it. When I copy over the exact API call here and try to initialize, I get an error. Any advice on what I’m doing wrong here? Thanks!
I suggest to create a requestbin.com and try to send data from both call (in Bubble but also in code editor). This way you will be able to compare each call and find the difference.
Thanks! I was not aware that this tool exists, seems like a great one for troubleshooting.
I did this, but I’m still confused. As you can see below, the only differences are user-agent header is absent (can this cause the issue?) and content-length is different (I don’t know why this is, since the body is exactly the same). What would you suggest please? Thanks
Try to add the user-agent missing header. I know some API that requiered it to identify the origin of request. Because it’s the only difference, You should give it a chance. If not, I suggest you to contact the API service because a 500 error is normally on the API service side (but not always).
The API service support team is asking to share the curl equivalent of the API call from bubble for them to help me. Do you know how I can generate that on my end with bubble? Thanks.
Thanks for helping me with this. That is so strange that it works for you but not for me.
I tried copying the text you provided, but it’s still the same. I even tried typing out the whole thread from scratch to ensure no invalid characters, but still doesn’t work.
Is there any way you can share the plugin with me so that I can try using it from my side with my key and see if it works?
Just a quick update. @manikandan has helped me to resolve the issue.
I was using http as the endpoint, and when we changed to https it seems to work. Somehow this does not make a difference when calling the API from VS code, but from Bubble IO it seems like it is mandatory to use https in order to correctly receive the response.
Will mark this issue as resolved. If anyone has more info on why the above difference exists, please do share. Thanks!