#mmmmjjjj - Webhook URLs
1 messages · Page 1 of 1 (latest)
Hello! You should be able to set that in the Webhook Endpoint's URL, yes, but you can't change/set it dynamically.
so I can set the param in a static value right?
You should be able to, yep. Are you having issues doing so?
i can see the query string in dashboard. but I can't get it from my project request.query_param(). I am wondering there are some setting in my project. thank you Rubeus
But i see in webhook cli it cant get the query string
Hi 👋 I'm jumping in as my teammate needed to step away. Can you help me understand where you're at now? Are you using stripe listen from the CLI to listen for events locally, or something else?
Hi toby, Yes, I am using stripe listen form the CLI. And I am going to add a query string in the webhook endpoint like hooks/invoice-created?param=123 I can see stripe did pass the event to the endpoint with query string. but the forward url for the local listener is missing
Just making sure I understand, when testing with the Stripe CLI you used the --forward option to set a forwarding URL and you included a query param on that URL which you aren't seeing being passed from the CLI to your local listener?
Yes, That's correct
Gotcha, I'm going to run some tests to see if I can reproduce that behavior.
Thank you so much mr meeseeks
Thank you for your patience while I continue to look into this. I set up a quick sample, and the information that the CLI is echoing hints that is including the query params, but my endpoint refused the request so I couldn't log it the way that I was hoping to. It'll take me a little while to test more thoroughly.
Okay no problem. Please keep me update about your testing results
I have a teammate looking into this with me, and so far they say they are not able to replicate that behavior. Can you provide the full line that you're using to start stripe listen so I can review what value you're passing into the --forward option?
stripe listen --api-key="$STRIPE_CLI_API_KEY" --device-name="$1" --load-from-webhooks-api --forward-to localhost:"$PORT"
base on you result. you can get the query string?
Oh, so that won't include the query param. Since you're passing localhost:"$PORT" into the --forward-to option, the CLI will use localhost:[port] as the endpoint where the events will go. You will also need to include the query params that you want included in the value that you pass for --forward-to.
Okay, let me make some tests on it. Thank you Toby
how's the correct implement to pass the query params to --forward-to?
My understanding is that they would go after the port number, this is the syntax that my teammate used:
stripe listen --forward-to "localhost:8000/webhook?fname=someone&lname=testing"
I am using --load-from-webhooks-api all webhooks will go to this endpoint. like invoice-create payment-succeed . is your case only for one webhooks?
Correct, I thought you were providing the entire URL in the forward-to parameter initially, and didn't realize you were leveraging --load-from-webhook-api to also parse the path info from an existing endpoint. When my teammate tested that approach, they saw the same behavior that you encountered and we'll work on submitting a bug report for that.
Thank you toby. In this point. I think nothing I can do with the problem and need to wait for the update patch stripe cli release. Is it correct?
Yes, based on the tags in your command it looks like you might be trying to script or automate some flows, and that will likely be tricky to do while the query params aren't being pulled in.
If you're trying to do some one-off testing then you can look into providing the --forward-to information explicitly while we look into the behavior that you reported.