我需要在谷歌脚本中编写一个函数,通过 API 将联系人添加到 icontact。我有以下代码可用于更改联系人,但我无法成功更改代码以添加联系人...有人知道如何编写添加联系人的调用吗?
function sendHttpPost() {
var headers= {
"API-Username":"XXXXX",
"API-AppId":"XXXXXX",
"API-Version":"2.0",
"API-Password":"XXXXX",
"Accept":"application/json"};
var payload =
{
"contactId":1976438,
"email":"schnick@schnack.com",
"prefix":"Mr.",
"firstName":"X",
"lastName":"XXXXX",
};
var options =
{
"headers" : headers,
"method" : "post",
"payload" : payload
};
UrlFetchApp.fetch("https://app.icontact.com/icp/a/XXXXX/c/XXXX/contacts/1976438", options);
}