0

我正在尝试通过iContact API.

我收到错误消息

您没有提供电子邮件字段,这是必需的。请提供电子邮件字段

通过使用 Google Apps 脚本运行以下代码。

我猜有效载荷结构不好,我尝试了其他结构但没有成功。

function sendHttpPost() {
var headers= {
"API-Username":"justsomebns@gmail.com",
"API-AppId":"pkec8CCH3Rd5GJoYY52YMjfPZym1sIXI",
"API-Version":"2.0",
"API-Password":"4tpzgto4tpzgto",
"Accept":"application/json"};
var payload = 
    {contact: 
        { "contactId":64363721,
    "email":"joyvious@gmail.com",
    "prefix":"Mr.",
    "firstName":"Michael",
    "lastName":"Smith",
    "suffix":"Jr.",
    "street":"2365 Meridian Parkway",
    "street2":"",
    "city":"Durham",
    "state":"NC",
    "postalCode":27502,
    "phone":"8668039462",
    "fax":"",
    "business":"ABusiness",
    "createDate":"2009-06-18 22:39:54'",
    "bounceCount":0,
    "status":"normal",
   }
}
    ;

  var options =
    {
      "headers" : headers,
      "method" : "POST",
      "payload" : payload,
      "timeout":5000
    };

var res = UrlFetchApp.fetch("https://app.icontact.com/icp/a/{account_id}/c/{folder_id}/contacts/", options);

Logger.log(res);
}

iContact API 文档链接
尝试使用与此旧帖子相同的代码时,我也会收到电子邮件问题

4

0 回答 0