DMARC Validator API - Ruby Gem

DMARC Validator checks the Domain-based Message Authentication, Reporting and Conformance (DMARC) record for a domain to ensure it is correctly configured.

Installation

Add this line to your application's Gemfile:

gem 'apiverve_dmarcvalidator'

And then execute:

$ bundle install

Or install it yourself as:

$ gem install apiverve_dmarcvalidator

Getting Started

Get your API key at APIVerve

Basic Usage

require 'apiverve_dmarcvalidator'

# Initialize the client
client = APIVerve::Dmarcvalidator::Client.new(api_key: "YOUR_API_KEY")

# Make a request
response = client.execute({ domain: "paypal.com" })

# Print the response
puts response

Error Handling

begin
  response = client.execute({ domain: "paypal.com" })
  puts response["data"]
rescue APIVerve::Dmarcvalidator::ValidationError => e
  puts "Validation error: #{e.errors.join(', ')}"
rescue APIVerve::Dmarcvalidator::APIError => e
  puts "API error: #{e.message}"
  puts "Status code: #{e.status_code}"
end

Debug Mode

# Enable debug logging
client = APIVerve::Dmarcvalidator::Client.new(
  api_key: "YOUR_API_KEY",
  debug: true
)

Example Response

{
  "status": "ok",
  "error": null,
  "data": {
    "host": "paypal.com",
    "dmarcHost": "_dmarc.paypal.com",
    "hasDmarc": true,
    "dmarc_record": "v=DMARC1; p=reject; rua=mailto:d@rua.agari.com; ruf=mailto:d@ruf.agari.com",
    "rua": {
      "email": "d@rua.agari.com",
      "domain": "rua.agari.com",
      "valid": true
    },
    "ruf": {
      "email": "d@ruf.agari.com",
      "domain": "ruf.agari.com",
      "valid": true
    },
    "v": "DMARC1",
    "p": "reject",
    "valid": true,
    "isEnforced": true,
    "riskScore": 5,
    "riskLevel": "low"
  }
}

Documentation

For more information, visit the API Documentation.

Support

License

This gem is available under the MIT License.