Webhook api request not working in chatbot but works via browser

(Fabio) #1

I have created an api to handle some of the validation etc.

e.g.

https://url.com/api/api.php

firstly in the webhook do I enter the url with or without the ? (I have tried both)

if I send a request https://www.url.com/api/api.php?idnumber=8004095138089 via the browser directly it works and returns the following JSON result on successfull validation:

{“status”:200,“status_message”:“Validation Successfull.”,“data”:“True”}

and on unsuccessfull validation returns:

{“status”:200,“status_message”:“ID Number Failed Validation.”,“data”:false}

I want to then use just the data, either True or False.

When I set it up on a webhook as follows:

and use the result of data:

The above keeps getting the error in the output log:
Status Code
400
Body
{“status”:400,“status_message”:“Invalid Request”,“data”:null}
Data
{
“status”: 400,
“status_message”: “Invalid Request”,
“data”: null
}

This error will occur if we use a value that does not exist, for instance if I sent id in the request it would give me the above as id is not correct and it is in fact idnumber.

It would seem that for some reason the request is not keeping the idnumber value correct.

(Daniel Beckett) #2

Hi @fabzster

I can see you sent this into the support team. I’ve responded over there :slight_smile: