Solved

Unable to Get Automated Webhook to Trigger

  • 25 June 2021
  • 6 replies
  • 52 views

Badge

I am wanting to trigger a very simple automation using a webhook. There is no need to pass any parameters - I just need the automation to run two workspaces. When I set up the webhook, copy the webhook url, and then start the automation, the webhook fails to run if I call it.

 

What puzzles me is that configuring a webhook using the automations (as opposed to creating a webhook for a specific workspace) doesn't add a token that I can manage under User Settings >> Manage Tokens. I found this token management to be essential to ensuring that the webhook had the correct permissions to run successfully.

 

Please advise on what I am missing or doing incorrectly.

 

Note that I am using FME Server 2020.0 (Win64)

 

Thanks

icon

Best answer by hollyatsafe 30 June 2021, 20:50

View original

6 replies

Badge +2

Hi @brent_frakes​ ,

 

In FME Server there are two types of Webhook.

 

1. Create a Webhook from a Workspace

This is a URL endpoint generated to send data to FME Server via a GET or POST request. The data being the workspace submission under a specific transformation service.

 

This type of Webhook will generate a token because FME Server authorization is required to grant access to the service, workspace, and any other items used by the workspace e.g. resources or connections.

 

2. Webhook Trigger in Automations

This is a URL endpoint that is unique to the Webhook trigger and can be set up to receive data from another application. As it is receiving rather than sending data, it must be requested using POST, and the upload body must include the message.

 

This webhook type does not generate an API token because there are no permissions required on specific items in FME Server to be able to receive the incoming message.

 

When you say are testing the webhook trigger - are you submitting this request using POST and specifying the message body e.g. using the HTTPCaller or some other application like Postman?

Badge

Hi Holly,

 

I think I am confused about what I should provide in the message body since there isn't anything I want to communicate other than to trigger the process to run. What I am currently doing (albeit incorrectly) is:

 

First, copy the following webhook url --> e.g.,

 

<WebhookURL>

 

Second, call it using python:

import requests as r

r.post('<WebhookURL>',

   verify=False)

 

 

Badge +2

Hi Holly,

 

I think I am confused about what I should provide in the message body since there isn't anything I want to communicate other than to trigger the process to run. What I am currently doing (albeit incorrectly) is:

 

First, copy the following webhook url --> e.g.,

 

<WebhookURL>

 

Second, call it using python:

import requests as r

r.post('<WebhookURL>',

   verify=False)

 

 

Hi @brent_frakes​ ,

 

It is not possible to trigger a webhook without including a message, you'll receive a 500 Internal Server Error reporting 'an unhandled exception has occurred due to some unexpectedly omitted information'.

 

So in this case you'll need to specify something in the body, then in FME Server don't use the 'Message Content' key and nothing will be done with the message value, but it should trigger successfully.

 

In later versions of FME Server I think we have made some improvements to the workflow you are looking to create. We have introduced a manual trigger that has a Rest API endpoint, and this does not require a message value to perform the trigger.

Badge

Whoop! That worked. Here is the python snippet using the requests package and the webhook url that I copied from FME Server. As suggested, I just created a dummy message:

 

import requests as r

r.post(

    '<WebhookURL>',

   verify=False, 

data = {'thanks': 'for the help'})

 

I get a 202 warning, but everything ran successfully

 

Badge

Hi @brent_frakes​ ,

 

It is not possible to trigger a webhook without including a message, you'll receive a 500 Internal Server Error reporting 'an unhandled exception has occurred due to some unexpectedly omitted information'.

 

So in this case you'll need to specify something in the body, then in FME Server don't use the 'Message Content' key and nothing will be done with the message value, but it should trigger successfully.

 

In later versions of FME Server I think we have made some improvements to the workflow you are looking to create. We have introduced a manual trigger that has a Rest API endpoint, and this does not require a message value to perform the trigger.

Hi,

Would you please do me a favor regarding the posts I added regarding webhooks: would you please obfuscate the webhook url and scrub out the domain information

Thanks,

Brent

Badge +2

Hi @brent_frakes​ ,

 

It is not possible to trigger a webhook without including a message, you'll receive a 500 Internal Server Error reporting 'an unhandled exception has occurred due to some unexpectedly omitted information'.

 

So in this case you'll need to specify something in the body, then in FME Server don't use the 'Message Content' key and nothing will be done with the message value, but it should trigger successfully.

 

In later versions of FME Server I think we have made some improvements to the workflow you are looking to create. We have introduced a manual trigger that has a Rest API endpoint, and this does not require a message value to perform the trigger.

Hi @brent_frakes​ ,

Sorry I just saw this message! I've updated your previous comment and this one. For future reference I believe you can edit your own posts by clicking on the downward-facing arrow in the top right corner of each post.

Reply