Forums

A custom endpoint that receives a HTTP POST

Hi.

I have some process running on remote server. On completion this server will send post request that triggers my PA script. Is it possible? If so how can I proceed? Below is snaphot from docs. describing endpoint requirements.

Finish webhook URL {finishWebhookUrl: String} A custom endpoint that receives a HTTP POST right after every run of the crawler ends, regardless of its status, i.e. whether it finished, failed, was stopped, etc. The POST payload is a JSON object defining an _id property which contains an execution ID of the crawler run, e.g. {_id: "S76d9xzpvY7NLfSJc"}. You can use this ID to query the crawl status and results using the API. Beware that the JSON object might be extended with other properties in the future.

The response to the POST request must have a HTTP status code in 2XX range. Otherwise it is considered an error and the request is periodically retried every hour. If the request does not succeed after 48 hours, the system gives up and stops sending the requests.

Sure. That's just a view in a web app that you can write to do what you want.

Is there something more straightforwrd without web apps?

No. Responding to a POST request is what webapps are for (among other things). Any "more straightforward" solution you might come up with would throw away all the useful stuff that's already built in to web apps.