Typetalk Post Message (use API token)
Post a message as a bot to the topic specified by URL.
2018 (C) Questetra, Inc. (MIT License)
Configs
  • A: URL (included Typetalk token) *
  • B: Select TEXT DATA for Post Message *
  • X: Select TEXT DATA for Log
Script
//// == 自動工程コンフィグの参照 / Config Retrieving ==
var url = configs.get("conf_url") + "";

//// == ワークフローデータの参照 / Data Retrieving ==
var textForPost = engine.findDataByNumber( configs.get("conf_Message") ) + "";

//// == 演算 / Calculating ==
var response = httpClient.begin()
  .formParam( "message", textForPost )
  .post( url );

//// == ワークフローデータへの代入 / Data Updating ==
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 “Typetalk Post Message (use API token)”

  1. Pingback: Posting to Typetalk from Workflow – Questetra Support

Comments are closed.

%d bloggers like this: