尝试与Hubspot建立联系信息集成时访问被拒绝4030

时间:2019-03-16 12:07:54

标签: php hubspot

我有一个要与Hubspot集成的联系表,但我一直收到以下错误消息:

403 ERROR

The request could not be satisfied.

This distribution is not configured to allow the HTTP request method that was used for this request. The distribution supports only cachable requests. 
Generated by cloudfront (CloudFront)
Request ID: zzXYHpy8twhlm2q4KvXwkig3hdEa5PobhB2UBh8umgMZK9MLo0J30A==

这是我正在使用的代码,我的浏览器是HTTPS,我尝试使用本地HTTP(但没有一个)。

<?php

        $arr = array(
            'properties' => array(
                array(
                    'property' => 'email',
                    'value' => 'testing@mailinator.com'
                ),
                array(
                    'property' => 'firstname',
                    'value' => 'test'
                ),
                array(
                    'property' => 'lastname',
                    'value' => 'test22'
                ),
                array(
                    'property' => 'phone',
                    'value' => '0123654785'
                )
            )
        );
        $post_json = json_encode($arr);
        $endpoint = 'https://app.hubspot.com/contacts/v1/contacts?hapikey=' . $hapikey;

        $ch = @curl_init();
        @curl_setopt($ch, CURLOPT_POST, true);
        @curl_setopt($ch, CURLOPT_POSTFIELDS, $post_json);
        @curl_setopt($ch, CURLOPT_URL, $endpoint);
        @curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));
        @curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        $response = @curl_exec($ch);
        $status_code = @curl_getinfo($ch, CURLINFO_HTTP_CODE);
        $curl_errors = curl_error($ch);
        @curl_close($ch);
        echo "curl Errors: " . $curl_errors;
        echo "\nStatus code: " . $status_code;
        echo "\nResponse: " . $response;

?>

0 个答案:

没有答案