首页 > 解决方案 > 尝试创建与 Hubspot 的联系信息集成时访问被拒绝 4030

问题描述

我有一个想要与 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;

?>

标签: phphubspot

解决方案


推荐阅读