Using Webhook

Hello,

I have an http request that works from a browser:

https://apirest.isendpro.com/cgi-bin/sms?keyid=xxx&num=9999999999&sms=Text&nostop=1&sandbox=1

How to configure a webhook to run it?

All my tries result in a (400) Bad Request error

Thank you for your help !

0 10 360
10 REPLIES 10

Need a bit more info. Screenshots or configuration settings?

Hello !

Thanks ! Here is a screen shot. !

You need to check the HTTP Verb - I think the endpoint is expecting a GET.

If so, you will have to change your Url to be what you currently have in the Body, leave the Body blank.

Also, the HTTP Content Type seems incorrect as well - my guess is it should be JSON.

Is there a documentation page for this web service?

Here is the (french) documentation !

https://www.isendpro.com/api-sms-documentation

You are trying to send an SMS, it appears. For that, you need to do a POST.

The Python code is given:

import requests

url = 'https://apirest.isendpro.com/cgi-bin/sms'
params = {
    'keyid':    'a296464ce012b8ab710a',
    'num':      '33601020304',
    'sms':      'Bonjour! Bienvenue sur iSendPro!',
    'emetteur': 'isendpro'
}
response = requests.post(url, params)
print(response.text)

You need to configure your webhook as follows:

Url: https://apirest.isendpro.com/cgi-bin/sms
HTTP Verb: POST
HTTP Content Type: JSON
Body: {
โ€˜keyidโ€™: โ€˜a296464ce012b8ab710aโ€™,
โ€˜numโ€™: โ€˜33601020304โ€™,
โ€˜smsโ€™: โ€˜Bonjour! Bienvenue sur iSendPro!โ€™,
โ€˜emetteurโ€™: โ€˜isendproโ€™
}

Itโ€™s better but there is an error !

โ€œErrorsโ€: โ€œError: Failed to parse JSON due to Invalid property identifier character: โ€˜. Path โ€˜โ€™, line 1, position 1โ€ฆ Invalid JSON value starts with: โ€˜keyidโ€™: โ€˜au73aoQgHk98kvoLzmP75NQ3g8TmKK2jโ€™,โ€˜numโ€™: โ€˜0695390116โ€™,โ€˜smsโ€™: โ€˜Bonjour! Bienvenue sur iSendโ€,

Check your quotes - are you using the correct quote character? Try double quotes instead of single quotes.

With this body :
{
โ€œkeyidโ€: โ€œau73aoxxxxxxx75NQ3g8TmKK2jโ€,
โ€œnumโ€: โ€œ0695390116โ€,
โ€œsmsโ€: โ€œBonjour! Bienvenue sur iSendPro!โ€
}

โ€œExceptionโ€: "Webhook HTTP post request failed with exception The remote server returned an error: (400) Bad Request. ",

At this point, I can no longer help - you will have to check the logs in your isendpro dashboard or contact their support. Good luck.

Thanks !

Top Labels in this Space