Discussions

Expand all | Collapse all

Webhook URL endpoint using field value

  • 1.  Webhook URL endpoint using field value

    Posted 23 days ago
    Alright, so I have run into an issue using a text field with a URL in the URL endpoint of a webhook.

    For 1, the webhook requires an https:// at the beginning, which is fine, I understand that, but what if the field's text has that there?
    For 2, the text in the field is URL encoded before it is placed into the URL, which causes some major havoc and breakage when the URL is called.
    So my question:
    How can I stop this? =D

    I don't want to share my specific URL with anyone for privacy reasons, but it is feasible to test this with any URL as a text field in the table, then simply pass that field's value to the URL in the webhook.
    Let me know your thoughts!

    Thank you!
    Also, if it's Mark who responds to this, a double thank you to that man, and a Merry Christmas.

    ------------------------------
    - Sterling Long!
    ------------------------------


  • 2.  RE: Webhook URL endpoint using field value

    Posted 23 days ago
    I'm really operating in guessing as I don't claim to be an expert on webhooks and you have not been able to post even a disguised version of your code.

    If the field you are using already has https:// in it and also you feel that when Quick Base sees a URL field it treats it differently than a plain old text field by URLEncoding and also adding another https://, then my suggestion is to create a text field with the URL you want. Then Quick Base will not second guess what you want in trying to be helpful.

    That can be done via a formula text field.

    If(Begins([my url field],"https://"), NotLeft([my url field],8),[my url field])

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------



  • 3.  RE: Webhook URL endpoint using field value

    Posted 22 days ago
    Edited by Sterling Long 22 days ago
    Ok, I'll start by saying I should not have mentioned the https thing, it's simply a requirement by QB Webhooks that I found a little annoying. Not super important.

    The bigger issue is to follow, let me see if I can give a better example. With some pictures.

    Alright so if I do this:
    And type out the URL completely, then the webhook works perfectly and can ping google. Google is an example here.

    If I do this (Using the constant that you helped me make Mark), pulled in from another table:

    Where the contents of [TestURL] are www.googe.com/
    I end up with this error from the webhook:

    Quickbase URL encoded the field. Which I can understand being necessary in the body, and necessary in URL parameters.
    I hope this makes more sense of my problem, sorry I was too vague before. I've been thinking about this for a while so I just kind of assumed it would be easy enough to understand.

    The URL encoding seems to happen automatically. There is no code here, no javascript, etc. Just me trying to use a field and its contents as a URL. Which seems to go against intended purposes.
    Using a field as a URL isn't necessary. It simply allows me to ensure that all the URLs are the same by using that one field, and if the endpoint URL ever changes, I just have to change it in my constant... It makes upkeep much simpler. All the thing are simpler with this.

    Let me know your thoughts, and if anything doesn't make sense let me know.

    I should note that it does this when the field is both type text and URL. That has no effect. The URL encoding still happens in the same way.
    ------------------------------
    - Sterling Long!
    ------------------------------



  • 4.  RE: Webhook URL endpoint using field value

    Posted 22 days ago
    I think we have reached the end of my technical ability to make suggestions. Maybe somebody else will chime in.

    ------------------------------
    Mark Shnier (YQC)
    Quick Base Solution Provider
    Your Quick Base Coach
    http://QuickBaseCoach.com
    mark.shnier@gmail.com
    ------------------------------



  • 5.  RE: Webhook URL endpoint using field value

    Posted 22 days ago
    K, again, thanks for all your help Mark! I really do appreciate it =) The constants idea works beautifully.

    ------------------------------
    - Sterling Long!
    ------------------------------



  • 6.  RE: Webhook URL endpoint using field value

    Posted 19 days ago

    Hi Sterling!

    I've done quite a bit of work with Webhooks and understand your issue. I was also able to recreate it in my own app.

    What I noticed was that even though I got the same 400 error the webhook was in fact still firing and in my case creating a message in a Slack channel.

    So my question to you is... Is your webhook still working despite the presence of the error?

    I don't fully understand why in my case I'm getting the error when it is clearly working.

    In terms of removing the error, I did try a few different ways of populating the URL in a field (URL field, text field, formula field, app variable via formula field) and they all seemed to result in the same error where the URL shows that it has been encoded.

    If I come up with any other ideas I'll let you know.

    –Sharon



    ------------------------------
    Sharon Faust (QuickBaseJunkie.com)
    Founder, Quick Base Junkie
    https://quickbasejunkie.com
    ------------------------------