Photon Cloud is not triggering webhooks

I have troubles getting webhooks to work on photon cloud. My custom authentication provider is working, whereas all other webhooks are not triggered. The webhooks are hosted in aws lambda and working, as I tested them with Postman. I currently only use the pathcreate and pathjoin webhooks, but none of them are triggered.
Can you please help me setting up the webhooks?

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    edited February 2019
    Hi @p_R,

    Thank you for choosing Photon!

    Did you wait enough time after applying the webhooks configuration?
    What is the client code you tested this with? What is the client SDK?
    Do you use CreateOrJoin or Create and Join separately?
    Send us an email to developer@photonengine.com with your AppId to look at the configuration.
  • Hi, thank you for your fast response. We are using PUN2 and CreateOrJoin. Got the join webhook working now, when i create the room in a separate command. The create webhook is currently not triggered, how long do I have to wait when editing the webhook config?
  • Got it working now, the pathclose webhook was missing and therefore the pathcreate was not triggered.
  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @p_R,

    We have added a warning for this under PathJoin in webhooks docs page.
    Thank you.
  • Hi @p_R
    can you help me here? I have connected photon chat webhooks with playFab and I need a webhook trigger for the channel destroyed but it is not being triggered. All the other webhooks are being triggered except channel destroy and publish message
  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @h_s,

    Thank you for choosing Photon!

    PlayFab integration with Photon Chat webhooks is not officially supported.
    So it may not be fully supported.

    The hacky way is to use PlayFab's support for Photon Realtime Webhooks for Photon Chat Webhooks.

    For ChannelDestroy, the PlayFab handler (and path) needs to be named "RoomClosed" since that's the only one that accepts Photon Webhook without UserId parameter. See Notes here.
    For PublishMessage you need to set HTTP forward WebFlag from client when calling PublishMessage.
  • Thank you @JohnTube but we also need the chat history of the public chat. Is there a way to get that ? I don't think we can get chat history from Realtime Webhooks. And I also tried "RoomClosed" it did not worked, is it because I also created Realtime webhook of the same name ? Or can you suggest any other way to save chat history on channel destroy.
  • JohnTube
    JohnTube ✭✭✭✭✭
    Hi @h_s,

    You can use Photon Chat Webhooks with PlayFab but this is not officially supported (mostly by PlayFab).
    Here is how:

    - if you already use Photon Realtime Webhooks with the same PlayFab TitleId then you cannot use Photon Chat Webhooks as well, it's one xor the other. Also even if you use Photon Chat AppId you need to configure this as a Photon Realtime AppId in PlayFab GameManager's Photon add-on. Why? Because PlayFab's CloudScript will check AppId argument sent from Photon Webhooks and WebRPCs and will allow only the AppId configured as Photon Realtime AppId.
    - Photon UserId needs to match a valid PlayFab UserId for your PlayFab TitleId. Optionally use PlayFab custom authentication with Photon.
    - you can use any handler and path name for all webhooks except ChannelDestroy, this needs to be RoomClosed. Why? Because PlayFab will check UserId argument sent from Photon Webhooks and WebRPCs and will allow only a UserId matching a valid existing user for your PlayFab TitleId. The only exception being RoomClosed which was meant for RoomClose in Photon Realtime Webhooks which does not contain UserId since it's not triggered by a user action same as ChannelDestory in Photon Chat Webhooks.