API Connection problem

Wappler Version : Latest.
Operating System : Mac
NodeJS, MySql8.

Error:

This is the endpoint (Batch Request) I’m trying to connect to: https://docs.usebouncer.com/#!/batch/createBatchUsingPOST

I have a POST Api
I’m trying to send JSON Schema (simple, and reproduced exactly as per the endpoints example - and this is working in Postman)
Click define schema
Click Fetch Schema

Then the error is returned.

This is about the 3rd/4th known, still persisting issue with the API Action’s both server and client side, these really need some love. Powerful, reliable API’s are critical in todays world.

What takes me about 45 seconds to setup correctly in Postman, just never seems to work in a straight forward manner, or at all in Wappler.

Could you please post more information? Like how you setup it in Wappler and also postman.
Seems to me like the API is receiving invalid input, but can’t say for sure if we can’t see the input you have given it.

Hi @George of course - I didn’t post too much, as it’s a very simple call and I basically cloned the exact setup from Postman to Wappler, I always test in Postman first.

So in Wappler:



The full JSON example.

x-api-key in the header, value hidden for obviously reasons.
Screen Shot 2020-10-09 at 5.51.48 pm

And it’s an exact clone in Postman, with the JSON in the ‘body’ as raw.

Server Action - API Action
Header
Name: x-api-key
Value: our API Key
URL: https://api.usebouncer.com/v1/email/verify/batch
Method: POST
Data Type: JSON
JSON in the output:

[
      {
    "email": "john@usebouncer.com",
    "name": "John Doe"
      }
]

So to confirm, this works perfectly in Postman.

1 Like

@George bumping this - I can’t deliver this feature due to the error. I provided additional information as you requested but have not heard back for 11 days now.

@George / @Teodor another bump.

@George tried this again this morning.

This is the JSON I am using in JSON data, which is exactly the same as in Postman:

[
   {
    "email": "jane@usebouncer.com"
   },
   {
    "email": "john@usebouncer.com"
   }
]

Postman returns a successful result. Wappler errors the above error. Please advise.

The problem here is that when using Fetch Schema, the json body is not sent. If you run the entire server action, the json body is sent properly and will work fine.

So @George will have to look at that bug.

In the meantime, you can simply copy the sample response provided by the vendor into the Source area and press the play button. This will allow you to pick the response items using data bindings downstream.

1 Like

Thank you @mebeingken !! Didn’t realise that was what the bug was (no reply from the team) - but I also learnt something, I didn’t realise I could do that with source and play. Very helpful, thank you! Will see if I can now close the loop on this.

1 Like

The way to troubleshoot this is to use webhook.site. You just grab the url they provide you, and temporarily use that for the URL of the api action. It simply captures everything that was sent and displays it for you. Then trigger the Fetch Schema, and you see that no body was sent. Run the entire server connect file, and you can see the body…voila. No need to guess what is going on.

1 Like

Thanks @mebeingken - I actually use and used beeceptor to test exactly that - which is why I was probing the team to tell me what’s going on, as well as this being a bug report - the expected outcome was that it works as per Postman.

Another thanks @mebeingken - this is now working! :slight_smile:

Now to figure out how to convert nested JSON response into csv columns! :slight_smile:

1 Like

That’s how the API Connector currently works

We are working on improving the API connector, so that the fetch schema runs the server action and fetches the schema without having to manually copy/paste the schema in the dialog.