Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webhooks in golang sdk #280

Open
lastzidanemagaba opened this issue Jul 24, 2023 · 2 comments
Open

Webhooks in golang sdk #280

lastzidanemagaba opened this issue Jul 24, 2023 · 2 comments

Comments

@lastzidanemagaba
Copy link

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

authorization bearer token

@davidzhao
Copy link
Member

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

@lastzidanemagaba
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants