Webhook routes
-
Say I have a webhook below:
<base braincloud webhook url>Now, I want to call this, but at the same time I want to append a route depending on the state:
- /game/join
or - /game/create
How can I manage this in braincloud when the server (Photon) that is attempting to call the webhook can't be modified and is essentially a blackbox to customers?
Does braincloud support this type of "routing" from a single base url?
- /game/join
-
That clears up some confusion! Thanks.
-
-
Unfortunately, I won't be able to use BrainCloud with Photon webhooks at all which is a shame, your end-point names also don't allow '/'s so I can't even create two different URLs.
-
For what its worth - plenty of apps on brainCloud are using Photon - so I would expect it is possible... (though as you say - our webhooks are a single route each. As @JasonL indicates - you should be able to indicate the different functions via a parameter?)
-
This post is deleted!
-
Apparently what I thought was working was actually just photon's default behavior when it doesn't receive the appropriate response from the webhook.
@Paul-Winterhalder
Plenty may use photon but the Quantum 3 sdk is quite new and uses a new webhooks plugin that is restricted to a single base url and some static settings.. the way it works is appending the request type to the base url, ie join/create which I can't just include as a parameter since this happens dynamically within the photon server outside my control.While I have had success using postman to receive an expected returned result and logs accordingly in BrainCloud, I don't actually see Any of photon's attempts to contact the Same url in the logs, which I'm guessing makes this a no-go?
I would at least expect to see something log in the Unreadable Requests section of logs? The fact it's ignoring photon completely but not postman is really bizarre, or maybe intended as the above comments indicate.. either way I need this functionality so that's unfortunate.
https://docs.braincloudservers.com/api/cc/writingscripts/webhooks
-
Hi @devsleeper - if you contact us through the chat widget we can go through your logs with you and see if we can get to the bottom of this. Thanks.
-
Update - @devsleeper was able to resolve this issue by providing the webhook secret as part of the URL instead of via header parameters.
Correct me if I got that wrong @devsleeper !
-
After an email with a member on the Photon team, it turns out I was using the wrong key. In order for BC to obtain the secret with it's specific name, I should have been using using WebHookCustomHttpHeaders where instead I was using WebHookSecret which forced the name to X-Secret - this change allowed me to include the BC secret in the header rather than URL (which was working but obviously in the header is preferred)
No errors on Quantum's side (they have no logs forwarded in dashboard) left me thinking it was on BC, when in fact all was working on their end.
Thanks again !
-
Cool. Thanks for sharing the solution here @devsleeper !