The minimum configuration has needs the top 2 requred fields: name and topic. The name is the name of the webhook, and the topic is the topic that the webhook will publish to.
Your output should look similar to this. We’ll cover sending data to this url.
Webhook "my-webhook" created with url: https://infinyon.cloud/webhooks/v1/[random string]
If you need this url again, you can run this command to list your webhooks, and their urls.
$ fluvio cloud webhook list
Example output
NAME TOPIC URL
my-webhook my-webhook-topic https://infinyon.cloud/webhooks/v1/[random string]
Send data to webhook
We’ll be sending json data {"key": "value"} to our webhook using curl. Replace the url so [random string] matches your unique url. Keep this command close because we’ll refer to this example curl command later.
$ curl -v -X POST -d 'Hello World!' https://infinyon.cloud/webhooks/v1/[uri-key]
In another terminal, star a consumer that reads form the beginning:
$ fluvio consume my-webhook-topic -B
We should see the folloing output:
Hello World!
Create a JSON Webhook and embed HTTP parts
Next we’ll send json records, but before we do that we’ll modify outputParts, outputType, and outputUri in the example-webhook.yaml configuration file: