Webhook Error 214

webhooks

#1

I’m creating a webhook in python with Flask. I’ve set up the url, I’ve added a hook to respond with the HMAC response token. I’ve made sure that it takes less than a second, but I’m still getting “Webhook URL does not meet the requirements”.

@app.route('/webhook', methods=["GET"])
def validation():
    try:
        crc = request.args['crc_token']
        crc = str(crc)
        validation = hmac.new(
            key=crc,
            msg=consumer_secret,
            digestmod = hashlib.sha256
        )
        signature = base64.b64encode(validation.digest())
        resp = make_response('{"response_token":"sha256='+signature+'"}', 200, {'Content-Type':'application/json'})
        return resp
    except:
        return "HELLO WORLD"

My webhook returns a 200 status and a response that looks like this:
{"response_token" : "sha256=x0mYd8hz2goCTfcNAaMqENy2BFgJJfJOb4PdvTffpwg="}

what could be going wrong?


#2

Hi @fayebutler,

Try swapping your key and msg. Here is a python example in this gist.


#3

@joncipriano Thanks so much! Of course it was a silly mistake!