简体   繁体   中英

Why my Cloudflare Apps web hooks not working?

I keep getting the following error message when implementing web hooks with cloudflare.

There was an error communicating with Trebble.

The dev console says:

raven.js:1 Hook failure 
    1. {type: "system", message: "unexpected end of JSON input", fields: Array(0)}
        1. fields:[]
        2. message:"unexpected end of JSON input"
        3. type:"system"
        4. __proto__:Object
raven.js:1 Error(s) triggering preview hook 
    1. [{…}]
    console.(anonymous function)    @   raven.js:1
    (anonymous) @   installs.coffee:53
    processQueue    @   angular.js:13318
    (anonymous) @   angular.js:13334
    $eval   @   angular.js:14570

You'll want to check the response from that endpoint is incorrect JSON format. You can run a curl to the API endpoint to mock Cloudflare's web hook.

You can get the JSON by triggering the hook, then look in your dev tools for a URL like

curl -vs "http://example.com/wordofday" --data {"event":"preview","install":{"id":"**","versionTag":null,"options":{},"schema":{"properties":{"location":{"title":"Message Location","description":"Where should the message appear?","order":0,"type":"object","format":"element","default":{"selector":"body","method":"prepend"}},"newopt_word":{"title":"Message","description":"A short example message.","type":"string","format":"richtext","order":1,"default":"<p>Welcome to Cloudflare Apps! This is our example app.</p><p>Download this app every time you want to make a new project.</p>"},"message":{"title":"Message","description":"A short example message.","type":"string","format":"richtext","order":1,"default":"<p>Welcome to Cloudflare Apps! This is our example app.</p><p>Download this app every time you want to make a new project.</p>"}}},"siteId":"preview","appId":"local","active":true,"metadata":{"userId":"**"}},"userId":"**"} -H "Accept:application/json, text/plain, */*" -H "content-type: application/json;charset=UTF-8"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM