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
Custom variable support in Webhook URLs #1005
Comments
Based on how the fields look, I suspect that you were planning on implementing this with |
I think we can cache the template itself using the Webhook ID + |
I think two options;
|
If we go for the second, then we should probably not use the Go template syntax at all, because that would just confuse people (why the dot? is it padded with spaces?). If we want to keep the validation rules the same, we could consider using placeholders like |
The standard (as per RFC 6570, see 1.2 and 2.2) syntax for URI templates is |
What do you mean with "allow one variable"? I also think that user experience-wise, it's nicer not to use |
The standard mentioned above would allow expressions such as |
|
Summary
Currently the final URL of a webhook is static, it does not support custom variables such as
JoinEUI
,DevID
,DevEUI
andDevAddr
. The result should be that a base URL for webhook such ashttp://example.com/app1/wh1
can becomehttp://example.com/app1/wh1/{{.DevEUI}}
and allow the Webhook endpoint to route the uplinks better. This should also be applicable inside the message specific URLs (uplink message, downlink queued etc.)Why do we need this?
This will allow better routing of the Webhooks and also enable us to write certain integrations (such as OpenSensors) only as WebHooks.
What is already there? What do you see now?
Static URL support -
BaseURL
is joined with the topic based on the uplink type, but there are no custom routing fields.What is missing? What do you want to see?
The custom routing fields
{{.AppEUI}}
,{{.JoinEUI}}
,{{.DevID}}
,{{.DevEUI}}
,{{.DevAddr}}
.Environment
Not applicable.
How do you propose to implement this?
Replace custom variables in the URL after the base URL + config URL join occurs in
newRequest.
Can you do this yourself and submit a Pull Request?
Yes.
The text was updated successfully, but these errors were encountered: