2

Parsehub provides the webhook feature. But currently I'm testing my Rails app locally. So how could I provide the webhook url for a project on Parsehub to point to my local server or any specific method in my controller.

Parsehub Doc Webhook: https://www.parsehub.com/docs/ref/api/v2/#webhooks

Webhook Url option Screenshot:

enter image description here

Syed Asad Abbas Zaidi
  • 1,006
  • 1
  • 17
  • 32

2 Answers2

0

The way I usually test webhooks is by using Request Bin http://requestb.in/ Essentially you get a url from them, you give this as your webhook address and anything that is posted to this URL will be caught by the website for further inspection!

You can then get these parameters and post them to your application manually, thus mimicking the entire process.

rii
  • 1,578
  • 1
  • 17
  • 22
  • But @rii whenever I call a post request using PostMan to the RequestBin url provided, it stops the parsehub process in between and returns the response as "OK"... No extra useful parameters are returned and also I want that just the status of Parsehub run should be returned and if the parsehub process is completed then only it should return the run_token. – Syed Asad Abbas Zaidi Aug 25 '16 at 04:09
  • You should be pasting the RequestBin url in that webhook field you show in your post. Then "ParseHub will send a POST request to that url whenever any of the project’s runs’ status or data_ready fields change. The POST body will be the run object." So you should be getting the run object in RequestBin, that should give you an idea of what to expect from ParseHub. I am not sure why you are trying to Post to the RequestBin url, it's PArseHub who should be posting there. Then you get the ParseHub Post and you can use it as an example to post it to your application... – rii Aug 25 '16 at 14:51
0

In order to use a webhook, you need to provide a publicly visible IP address for ParseHub to make requests to. You can get one by registering for a cheap VPS host (e.g. DigitalOcean for $5/month).

On that host, you want to run a webserver, and put the endpoint that the webserver listens on into the webhook textbox in ParseHub. To inspect the details of what ParseHub sends, you can just make your webserver log all the request data. You can also check out our API docs which have a description of all the fields: https://www.parsehub.com/docs/ref/api/v2/#run

Sergiu Toarca
  • 2,697
  • 20
  • 24