Update send params: phoneNumber -> to

This commit is contained in:
Darren Clarke 2024-07-31 09:43:59 +02:00
parent 5e2475848e
commit 441a2aebbc
2 changed files with 3 additions and 3 deletions

View file

@ -35,6 +35,6 @@ class CdrSignalApi
end end
def send_message(recipient, text, options = {}) def send_message(recipient, text, options = {})
post('send', { phoneNumber: recipient.to_s, message: text }.merge(parse_hash(options))) post('send', { to: recipient.to_s, message: text }.merge(parse_hash(options)))
end end
end end

View file

@ -19,7 +19,7 @@ class CdrWhatsappApi
end end
ret ret
end end
def get(api) def get(api)
url = "#{@api_url}/bots/#{@token}/#{api}" url = "#{@api_url}/bots/#{@token}/#{api}"
JSON.parse(Faraday.get(url, { Accept: "application/json" }).body) JSON.parse(Faraday.get(url, { Accept: "application/json" }).body)
@ -35,6 +35,6 @@ class CdrWhatsappApi
end end
def send_message(recipient, text, options = {}) def send_message(recipient, text, options = {})
post('send', { phoneNumber: recipient.to_s, message: text }.merge(parse_hash(options))) post('send', { to: recipient.to_s, message: text }.merge(parse_hash(options)))
end end
end end