The project is in a healthy, maintained state
Easily use the Mailinator through its REST API with Ruby
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
 Project Readme

Mailinator Ruby REST API Client

Build Status Gem Version

The Mailinator REST API client provides a simple way to use the comprehensive Mailinator API.

This client works with Ruby 2.1 and higher. It uses HTTParty under the covers for the actual HTTP communication.


Installation

The latest stable version is available in RubyGems and can be installed using

gem install mailinator_client

API Documentation

MailinatorClient

MailinatorClient is the wrapping module, but it also acts as a singleton Client instance. So if you only need a single client instance, you do not need to instantiate one yourself - the MailinatorClient module will act exactly like an instance of MailinatorClient::Client.


MailinatorClient::Client

A client is a single api instance. By default, it is unauthenticated, but can be given an access token to perform authenticated requests.

Initializer

MailinatorClient::Client.new(auth_token: nil)

The Client() initializer takes the following arguments:

  • auth_token
    The access token to be used for authentication - by default there is no access token.

Resources

Each of the following is a method on the client object, and returns a wrapper for the actions against that particular resource. See each resource documentation file for more information.

  • domains
    Contains all of the actions that can be performed against the set of Domains that the currently authenticated user has access to - such as listing the domains.

  • stats
    Contains all of the actions that can be performed against the set of Stats that the currently authenticated user has access to - such as listing the team stats.

  • rules
    Contains all of the actions that can be performed against the set of Rules that the currently authenticated user has access to - such as listing the rules or creating a new rule.

  • messages
    Contains all of the actions that can be performed against the set of Messages that the currently authenticated user has access to - such as listing the messages or injecting a new message.


MailinatorClient::ResponseError

When the Mailinator API returns a unsuccessful response, an instance of ResponseError is thrown.

ResponseError Accessors

  • code
    The status code returned from the Mailinator API.

  • type
    The type of error that occurred, such as "Authorization".

  • message
    A more detailed message about the particulars of the error.


Testing

Run integration tests with real API Key.

ruby -I test test/mailinator_client_api_test.rb

Most of the tests require env variables with valid values. Visit tests source code and review mailinator_client_api_test.rb file. The more env variables you set, the more tests are run.


Copyright (c) 2020 Manybrain, Inc

https://www.mailinator.com/