Last active
March 25, 2017 08:02
-
-
Save yuryoparin/817b6076c6bf10d517088ce25240fb25 to your computer and use it in GitHub Desktop.
Общее описание запроса в ePochta SMS API v3 через bash однострочник
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
key='Публичный ключ'; | |
pr_key='Приватный ключ'; | |
action='Команда'; echo -e "key=$key;version=3.0;action=$action;param1=val1;...;paramN=valN" | \ | |
tr ';' '\n' | \ | |
sort -t'=' -k1 | \ | |
cut -f2 -d'=' | \ | |
paste -s -d';' - | \ | |
sed "s/;//g;s/$/$pr_key/" | \ | |
tr -d '\n' | \ | |
md5 | \ | |
xargs -I {} curl -s -G -d 'param1=val1' ... --data-urlencode 'paramN=valN' --url "https://api.atompark.com/sms/3.0/$action?key=$key&sum={}" | \ | |
jq '.' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment