php - 尝试创建与 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;
?>
解决方案
推荐阅读
- mysql - 从两个表中删除与相同两个表的另一个查询不匹配的 id 行
- python - 从 BeautifulSoup 选择结果中删除(分解)元素
- node.js - 在 nodeJS 服务器上正确保存 JSON 数据
- html - 你如何在css中调整背景图像的大小?
- c++ - C ++如何打印矢量
, 向量 > > 维帕 - flutter - 如何在 Flutter 中使用带有自定义标签的 ChoiceChip 创建包装
- sql - 如何在 SQL 中使用 STUFF 和 UPDATE
- reactjs - 在 React 和 TypeScript 中使用 DRY 变化句柄形成表单
- javascript - [^)] 在这个正则表达式 / *\([^)]*\) */g 中做了什么
- javascript - 尽管内部控制台日志显示该值,但该函数返回未定义