curl --location --request POST 'https://api.pushsms.ru/api/v1/delivery?text=textsms&phone=71233456789&external_id=100' \
--header 'Authorization: Bearer {your token}'
--header 'checksum: {checksum_value}'
params = {
text: "text",
phone: "71233456789",
external_id: "100"
}
idempotency_key = "Z5F2idBj"
params_string = params.keys.sort.map{|e| params[e]}.join
"10071233456789text"
digest = OpenSSL::Digest.new('sha256')
checksum_value = OpenSSL::HMAC.hexdigest(digest, idempotency_key, params_string)
"ebb290126ea4302ebca339f5efe419b4a67edfe57e1ea844e7cec85ccef53f23"
{
"meta": {
"status": "fail",
"message": "Invalid checksum",
"code": 400
}
}
{
"meta": {
"status": "fail",
"message": "Request with current params has already been received",
"code": 409
}
}