0.0
The project is in a healthy, maintained state
This repository contains Mock::Bandwidth for Bandwidth's API.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Runtime

>= 1.0.1, < 3.0
~> 0.22.0
 Project Readme

Mock::Bandwidth

Gem Version mock-bandwidth

This is a SchoolStatus implementation to mock Bandwidth-sdk to perform requests to bandwidth-oai

Installation

To install using bundler grab the latest stable version:

gem install mock-bandwidth

Requirements

Defaults Prism

  • proxy_address = bandwidth_mock_server
  • proxy_port = 4010
  • proxy_protocol = http

Features Support

Support Mock::Bandwidth
Bandwidth::MessagesApi.new.create_message(account_id, body)

Trigger resources updates

Mock::Bandwidth::Webhooks Support
Webhooks::Messages

How to use

Initializer sample

Bandwidth.configure do |config| # Configure Basic Auth
  config.username = "username"
  config.password = "password"
  config.configure_faraday_connection do |connection|
    connection.proxy = "http://mock-server.test"
    connection.use Mock::Bandwidth::Middleware::Proxy
  end
end

Mock::Bandwidth.configure do |config|
  config.webhook_message_status_url = "http://my-server.com/webhooks/bandwidth/messages_updates"
  # optional
  # config.disable_webhooks = true
end

Example

from = "+18001234123123"
application_id = "12341234"
account_id = "123123"
text = "sms text"
to = "+17001234123123"

body = Bandwidth::MessageRequest.new(
  {
    from: from,
    application_id: application_id,
    to: [to],
    text: text
  }
)
messaging_api_instance = Bandwidth::MessagesApi.new
response = messaging_api_instance.create_message(account_id, body)

=> #<Bandwidth::Message:0x00005f39e4efcae0 @application_id="12341234", @from="+18001234123123", @id="1737987840867jqaf7b3rad1a6fn", @owner="+18001234123123", @text="sms text", @to=["+17001234123123"]>

Run tests

rake test