| 12345678910111213141516171819202122 |
- #!/usr/bin/env groovy
- import groovy.json.JsonOutput
- import org.feishu.SignUtil
- def send(String webhook, String secret, Map card) {
- Long ts = System.currentTimeMillis() / 1000
- String sign = SignUtil.genSign(secret, ts)
- def body = [
- timestamp: ts,
- sign : sign,
- msg_type : "interactive",
- card : card
- ]
- httpRequest(
- httpMode: 'POST',
- requestBody: JsonOutput.toJson(body),
- contentType: 'APPLICATION_JSON',
- url: webhook,
- consoleLogResponseBody: true,
- validResponseCodes: '200'
- )
- }
|