Example code in ruby for Bulk Whatsapp

Replace number, type, message, instance id and access token accordingly.

 

1. Below is the sample code for ruby:

require 'httparty'

number = '9199XXXXXXXX'
type = 'text'
message = 'test message'
instance_id = '6616XXXXX'
access_token = '661XXXXXX'

url = "https://whatsapponcloud.com/api/send?number=#{number}&type=#{type}&message=#{URI.encode_www_form_component(message)}&instance_id=#{instance_id}&access_token=#{access_token}"

response = HTTParty.get(url)

if response.success?
puts 'API response:', response.body
else
puts 'Error sending request:', response.code
end

  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Example code in python for Bulk Whatsapp

Replace number, type, message, instance id and access token accordingly.   1. Below is the...

Example code in php for Bulk Whatsapp

Replace number, type, message, instance id and access token accordingly.   1. Below is the...

Example code in node.js for Bulk Whatsapp

Replace number, type, message, instance id and access token accordingly.   1. Below is the...

Example code in java for Bulk Whatsapp

Replace number, type, message, instance id and access token accordingly.   1. Below is the...

Example code in asp.net for Bulk Whatsapp

Replace number, type, message, instance id and access token accordingly.   1. Below is the...