1. Tasks
  2. Create Webhook

Tasks

Create Webhook

Create an explicit webhook for stubs. Webhook will be in the format https://webhooks.stubber.com/ex/{{uuid}}

Basic usage

Create a simple webhook to trigger a task called example_task

loading...

Parameters

action_name

required
String

  • Name of the task the webhook will execute
  • The webhook will not execute a task that is not in state

stubref

required
String

  • This is a reference for what stub to execute in
  • You can only create webhooks for stubs your org owns

webhookuuid

optional
UUID

  • A custom uuid you would like to use for your webhook.
  • If not provided, a random uuid will be generated and returned as a result of this task.

This is useful if you want to provide a link to your webhook before even creating it.

Result

        POST /ex/{{uuid}} HTTPS/1.1
Host: webhooks.stubber.com
Content-Type: application/json

{
  "some": "data",
}

      
loading...

Properties

lid

UUID

A predefined set of data used in webhooks

payload

JSON

  • Will contain all query parameters if the webhook is called via GET
  • Will contain request body if the webhook is called via POST

Examples

Here is some more complex examples

Executing webhook with GET request

GET requests query params gets passed through as payload

        GET /ex/{{uuid}}?some=data HTTPS/1.1
Host: webhooks.stubber.com
Content-Type: application/json
Authorization: Bearer token

      
Result
loading...

Executing webhook with POST request

GET requests body gets passed through as payload

        POST /ex/{{uuid}} HTTPS/1.1
Host: webhooks.stubber.com
Content-Type: application/json
Authorization: Bearer token

{
  "some": "data",
}

      
Result
loading...

Creating a webhook with basic auth

loading...
Result
        POST /ex/{{uuid}} HTTPS/1.1
Host: webhooks.stubber.com
Content-Type: application/json
Authorization: Basic dXNlcjpwYXNz

{
  "some": "data",
}

      
loading...

Creating a webhook with bearer auth

loading...
Result
        POST /ex/{{uuid}} HTTPS/1.1
Host: webhooks.stubber.com
Content-Type: application/json
Authorization: Bearer custom_token

{
  "some": "data",
}

      
loading...