Skip to content

Instantly share code, notes, and snippets.

@yuryoparin
Last active March 25, 2017 08:02
Show Gist options
  • Save yuryoparin/817b6076c6bf10d517088ce25240fb25 to your computer and use it in GitHub Desktop.
Save yuryoparin/817b6076c6bf10d517088ce25240fb25 to your computer and use it in GitHub Desktop.
Общее описание запроса в ePochta SMS API v3 через bash однострочник
#!/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