• Categories
  • Recent
  • Tags
  • Popular
  • Solved
  • Unsolved
  • Users
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Darkly)
  • No Skin
Collapse
brainCloud Forums

Webhook routes

Scheduled Pinned Locked Moved Solved Cloud Code
webhookcloud codes2s
12 Posts 3 Posters 650 Views
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • devsleeperD Offline
    devsleeperD Offline
    devsleeper
    wrote on last edited by devsleeper
    #1

    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?

    1 Reply Last reply
    0
  • J Offline
    J Offline
    JasonL bitHeads
    wrote on last edited by
    #2

    No, dynamic routing is not supported by BrainCloud webhook yet. You will have to use two different URLs.

    devsleeperD 1 Reply Last reply
    0
  • devsleeperD Offline
    devsleeperD Offline
    devsleeper
    replied to JasonL on last edited by
    #3

    That clears up some confusion! Thanks.

    1 Reply Last reply
    0
  • devsleeperD devsleeper has marked this topic as solved on
  • devsleeperD Offline
    devsleeperD Offline
    devsleeper
    wrote on last edited by devsleeper
    #4

    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.

    1 Reply Last reply
    0
  • J Offline
    J Offline
    JasonL bitHeads
    wrote on last edited by
    #5

    How about passing the slug as a parameter along with the webhook URL? This will allow your script to parse the parameter and perform actions accordingly.

    1 Reply Last reply
    1
  • Paul WinterhalderP Offline
    Paul WinterhalderP Offline
    Paul Winterhalder brainCloudAdmin
    wrote on last edited by
    #6

    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?)

    1 Reply Last reply
    0
  • devsleeperD Offline
    devsleeperD Offline
    devsleeper
    wrote on last edited by devsleeper
    #7
    This post is deleted!
    1 Reply Last reply
    0
  • devsleeperD Offline
    devsleeperD Offline
    devsleeper
    wrote on last edited by devsleeper
    #8

    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
    config example

    1 Reply Last reply
    0
  • Paul WinterhalderP Offline
    Paul WinterhalderP Offline
    Paul Winterhalder brainCloudAdmin
    wrote on last edited by
    #9

    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.

    1 Reply Last reply
    0
  • Paul WinterhalderP Offline
    Paul WinterhalderP Offline
    Paul Winterhalder brainCloudAdmin
    wrote on last edited by
    #10

    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 ! 🙂

    1 Reply Last reply
    0
  • devsleeperD Offline
    devsleeperD Offline
    devsleeper
    wrote on last edited by devsleeper
    #11

    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 !

    email

    1 Reply Last reply
    0
  • Paul WinterhalderP Offline
    Paul WinterhalderP Offline
    Paul Winterhalder brainCloudAdmin
    wrote on last edited by
    #12

    Cool. Thanks for sharing the solution here @devsleeper !

    1 Reply Last reply
    0

  • Login

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • Solved
  • Unsolved
  • Users