【问题标题】:Invite Recipients to Survey Monkey collector API php邀请收件人调查 Monkey collector API php
【发布时间】: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
        )

)

我不明白问题出在哪里?

谢谢

【问题讨论】:

标签: php


【解决方案1】:

好的,我解决了这个问题。 该数组假设在数据之前带有联系人索引。

【讨论】:

  • 请展示您所做的更改,以便研究人员不必猜测您的意思。
猜你喜欢
  • 2016-12-06
  • 1970-01-01
  • 1970-01-01
  • 2017-12-31
  • 2018-06-20
  • 2022-01-22
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多