我有谷歌工作表的数据,我需要使用WhatsApp发送,所以我有Botmaker的API。他们给予了一个cURL和JSON数据,但我不知道如何使用cURL和JSON做后使用谷歌脚本功能。
这是cURL:
curl
- X POST
--header 'Content-Type: multipart/form-data'
--header 'Accept: application/json'
--header 'access-token: myAccessToken'
-F chatPlatform=whatsapp
-F chatChannelNumber=############
-F platformContactId=############
-F mediaType=document
这是API的请求URL:“请访问以下网址:”
这是响应正文:无内容
这是响应代码:401
回应信头:
{
"accept": "[application/json, application/xml, text/plain]",
"access-control-allow-credentials": "true",
"access-control-allow-headers": "bearer-token,access-token,Content-Type,Authorization,X-Requested-With,Content-Length,Accept,Origin",
"access-control-allow-methods": "GET, POST, PUT, DELETE, OPTIONS, HEAD",
"access-control-allow-origin": "https://go.botmaker.com",
"alt-svc": "h3=\":443\"; ma=2592000,h3-29=\":443\"; ma=2592000",
"cache-control": "must-revalidate,no-cache,no-store",
"content-length": "0",
"content-security-policy": "default-src 'self'",
"date": "Sat, 11 Jun 2022 22:52:02 GMT",
"permissions-policy": "geolocation=(self \"https://go.botmaker.com\"), microphone=()",
"reason-phrase": "Cannot authenticate user with received tokens after applying [access-token] and accessToken [null]",
"referrer-policy": "no-referrer",
"server": "Botmaker",
"strict-transport-security": "max-age=31536000; includeSubDomains",
"via": "1.1 google",
"x-content-type-options": "nosniff",
"x-frame-options": "DENY"
}
我知道我需要使用UrlFetchApp.fetch
有人可以帮我创造
1条答案
按热度按时间8ulbf1ek1#
我找到了方法,下面是它对我的作用: