Hangouts Chat Post Message
Post a message to Hangouts Chat with a specified text.
2018 © Questetra, Inc. (MIT License)
Configs
  • A: Webhook URL *
  • B: Select TEXT DATA for Text *
  • X: Select TEXT DATA for Log
Script
//// == Config Retrieving ==
var endpointUrl = configs.get("conf_EndpointUrl") + "";

//// == Data Retrieving ==
var text = engine.findDataByNumber( configs.get("conf_Text") ) + "";

//// == Calculating ==
var uri = endpointUrl;

var requestObj = {
  "text": ""
};
requestObj.text = text;

var response = httpClient.begin()
  .body( JSON.stringify( requestObj ), "application/json")
  .post( uri );

//// == Data Updating ==
//If log data is specified
var dataNum_Log = configs.get("conf_Log") + "";
if (dataNum_Log !== "") {
  var log = "";
  log += "---POST request--- " + response.getStatusCode() + "\n";
  log += response.getResponseAsString() + "\n";
  engine.setDataByNumber( dataNum_Log, log );
}

Download

Capture

See also

1 thought on “Hangouts Chat Post Message”

  1. Pingback: Posting to Hangout Chat from Workflow – Questetra Support

Comments are closed.

%d bloggers like this: