返回响应字符串以设置Webhook

时间:2016-07-07 09:38:04

标签: php webhooks

我正在尝试将PHP Webhooks与Onfleet API集成。 文档说我必须返回一个简单的字符串响应

http://docs.onfleet.com/docs/webhooks#create-webhook

这是我的代码

        final Dialog dialog = new Dialog(activity) {
            @Override
            public boolean onTouchEvent(final MotionEvent event) {
                //note: all touch events that occur here are outside the dialog, yet their type is just touching-down
                boolean shouldAvoidDismissing = ... ;
                if (shouldAvoidDismissing) 
                    return true;
                return super.onTouchEvent(event);
            }

            @Override
            public void onBackPressed() {
                boolean shouldAvoidDismissing = ... ;
                if (!shouldSwitchToInviteMode)
                    dismiss();
                else
                    ...
            }
        };

我一直收到错误“响应中收到的值与我们发送给您的值不符”

1 个答案:

答案 0 :(得分:0)

我会这样做

if ($_SERVER['REQUEST_METHOD'] === 'GET' && isset($_GET['check']))
{
    header('Content-Type: application/json');
    echo $_GET['check'];
}