Mailinator Ruby REST API Client
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.
The latest stable version is available in RubyGems and can be installed using
gem install mailinator_client
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.
A client is a single api instance. By default, it is unauthenticated, but can be given an access token to perform authenticated requests.
Client() initializer takes the following arguments:
The access token to be used for authentication - by default there is no access token.
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.
When the Mailinator API returns a unsuccessful response, an instance of ResponseError is thrown.
The status code returned from the Mailinator API.
The type of error that occurred, such as "Authorization".
A more detailed message about the particulars of the error.
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.
MAILINATOR_TEST_API_TOKEN- API tokens for authentication; basic requirement across many tests;see also https://manybrain.github.io/m8rdocs/#api-authentication
MAILINATOR_TEST_INBOX- some already existing inbox within the private domain
MAILINATOR_TEST_PHONE_NUMBER- associated phone number within the private domain; see also https://manybrain.github.io/m8rdocs/#fetch-an-sms-messages
MAILINATOR_TEST_MESSAGE_WITH_ATTACHMENT_ID- existing message id within inbox (see above) within private domain (see above); see also https://manybrain.github.io/m8rdocs/#fetch-message
MAILINATOR_TEST_ATTACHMENT_ID- existing message id within inbox (see above) within private domain (see above); see also https://manybrain.github.io/m8rdocs/#fetch-message
MAILINATOR_TEST_DELETE_DOMAIN- don't use it unless you are 100% sure what you are doing
Copyright (c) 2020 Manybrain, Inc