【发布时间】:2021-02-09 17:05:43
【问题描述】:
我正在尝试向调查猴子中的消息添加多个收件人。 这是我的代码:
$data = [
[
'email' => 'dsfdsfd@gmail.com',
'first_name' => 'sdf sdfsdf',
'custom_fields' => [
"1" => '20-20-2020'
]
]
];
$cURLConnection = curl_init();
curl_setopt($cURLConnection, CURLOPT_URL, 'https://api.surveymonkey.com/v3/surveys/119550392/collectors/175336023/messages/' . $message_id . '/recipients/bulk');
curl_setopt($cURLConnection, CURLOPT_SSL_VERIFYHOST, false);
curl_setopt($cURLConnection, CURLOPT_RETURNTRANSFER, true);
curl_setopt($cURLConnection, CURLOPT_HTTPHEADER, $auth_data);
curl_setopt($cURLConnection, CURLOPT_POSTFIELDS, $postData);
$list = curl_exec($cURLConnection);
curl_close($cURLConnection);
由于某种原因,我收到此错误:
stdClass Object
(
[error] => stdClass Object
(
[id] => 1002
[name] => Bad Request
[docs] => https://developer.surveymonkey.com/api/v3/#error-codes
[message] => Invalid schema in the body provided.
[http_status_code] => 400
)
)
我不明白问题出在哪里?
谢谢
【问题讨论】:
-
从我在这里看到的stackoverflow.com/questions/45171381/… 我正确构建的数组。
标签: php