server-sdk-go icon indicating copy to clipboard operation
server-sdk-go copied to clipboard

Webhooks in golang sdk

Open lastzidanemagaba opened this issue 2 years ago • 2 comments

to receive a data from webhook , get this error invalid character '\x05' looking for beginning of value

authorization bearer token

lastzidanemagaba avatar Jul 24 '23 10:07 lastzidanemagaba

please provide more details.. what are you trying to do.. which versions of the SDK and livekit-server, etc.

davidzhao avatar Jul 27 '23 00:07 davidzhao

i'm trying to get data webhook

  • sdk version : 1.5.10 ( "github.com/livekit/protocol/auth" )
  • using live kit cloud
  • already add webhook from dashboard

this is the code from documentation ( golang version ) import ( "github.com/livekit/protocol/auth" "github.com/livekit/protocol/livekit" "github.com/livekit/protocol/webhook" )

func ServeHTTP(w http.ResponseWriter, r *http.Request) { authProvider := auth.NewSimpleKeyProvider( apiKey, apiSecret, ) // event is a livekit.WebhookEvent{} object event, err := webhook.ReceiveWebhookEvent(r, authProvider) if err != nil { // could not validate, handle error return } // consume WebhookEvent }

and here the result invalid character '\x05' looking for beginning of value

lastzidanemagaba avatar Jul 27 '23 09:07 lastzidanemagaba