运维脚本集
定时备份脚本
查看进程OOM分数
程序自动拉起
API调用-Shell
Python调用
Golang调用
K8S镜像下载
本文档使用MrDoc发布
返回首页
-
+
API调用-Shell
2023年6月4日 14:15
admin
#!/bin/bash accountsid="a4462df20ed7f530be9f61ad4e65252e" authtoken="7748bffdd06f44cbd584919491b0ea46" timestamp=$(date +%Y%m%d%H%M%S) echo $timestamp timess=$(date +%s)001 echo $timess sig=`echo -n ${accountsid}${authtoken}${timestamp} |openssl dgst -sha1 |awk '{print $2}'` Authorization=`echo -n ${accountsid}:${timestamp} |openssl enc -base64` echo $Authorization Accept="application/json;charset=utf-8" Content_Type="application/json;charset=utf-8" Content_Length="131" appid="2f2f6da928b74959a4c894ceb1cba497" templateID="20001" url="http://192.168.110.145:10000/api/v1.0.0/voice/notify?sig=${sig}"; date="{\"info\":{\"appID\":\"$appid\"},\"timestamp\":\"$timess\",\"data\":\"abc123\",\"subject\":{\"playTimes\":10,\"params\":[\"$2\"],\"called\":\"$1\",\"calledDisplay\":\"10001\",\"templateID\":\"$templateID\"}}" echo $date recust=`curl -H "Authorization: $Authorization" -H "Accept: $Accept" -H "Content-Type: $Accept" -H "Content-Length: ${#date}" -s -X POST --data $date $url` echo $recust
分享到: