Skip to content

Instantly share code, notes, and snippets.

@auycro
Last active April 12, 2016 03:55
Show Gist options
  • Save auycro/ab7a5bcf7548fc4746217a96906648ec to your computer and use it in GitHub Desktop.
Save auycro/ab7a5bcf7548fc4746217a96906648ec to your computer and use it in GitHub Desktop.
chatwork google app script
function myFunction() {
var key = "{token-key}";
var url = "https://api.chatwork.com/v1/my/status";
//var url = "https://api.chatwork.com/v1/rooms/{room-id}/messages";
sendToService_(url,key);
}
function sendToService_(url,key) {
var headers = {
'X-ChatWorkToken': key
};
var payload = {
"body" : "Hello,World",
"fieldOne" : "value for field one"
}
var options = {
"method" : "get",
"contentType" : "application/json",
"headers" : headers,
//"payload" : payload
};
Logger.log( UrlFetchApp.fetch(url, options));
//return UrlFetchApp.fetch(url, options);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment