Skip to content
Go to Micro

Send a test event

client.Webhooks.Ping(ctx, webhookID, params) (*WebhookPingResponse, error)
POST/v2/webhooks/{teamId}/{webhookId}/ping

Fire-and-forget test delivery through the async dispatcher. The webhook must be enabled and verified.

ParametersExpand Collapse
webhookID string
formatuuid
params WebhookPingParams
TeamID param.Field[string]Optional

Path param

formatuuid
Data param.Field[map[string, unknown]]Optional

Body param: Arbitrary JSON payload body.

Event param.Field[string]Optional

Body param: Event name to send.

ReturnsExpand Collapse
type WebhookPingResponse struct{…}
Dispatched bool
Event string
WebhookID string
formatuuid

Send a test event

package main

import (
  "context"
  "fmt"

  "github.com/micro-so/micro-sdk-go"
  "github.com/micro-so/micro-sdk-go/option"
)

func main() {
  client := micro.NewClient(
    option.WithAPIKey("My API Key"),
    option.WithTeamID("My Team ID"),
  )
  response, err := client.Webhooks.Ping(
    context.TODO(),
    "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
    micro.WebhookPingParams{

    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", response.WebhookID)
}
{
  "dispatched": true,
  "event": "event",
  "webhook_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
}
Returns Examples
{
  "dispatched": true,
  "event": "event",
  "webhook_id": "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e"
}