{"id":19711709,"url":"https://github.com/brightcommerce/internetbs","last_synced_at":"2025-07-01T02:33:59.855Z","repository":{"id":56877821,"uuid":"46727448","full_name":"brightcommerce/internetbs","owner":"brightcommerce","description":"Ruby API client for Internet.bs resellers.","archived":false,"fork":false,"pushed_at":"2015-11-23T22:01:01.000Z","size":39,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-20T15:27:06.746Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/brightcommerce.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-11-23T14:57:59.000Z","updated_at":"2019-02-26T21:53:59.000Z","dependencies_parsed_at":"2022-08-20T11:31:07.611Z","dependency_job_id":null,"html_url":"https://github.com/brightcommerce/internetbs","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/brightcommerce/internetbs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brightcommerce%2Finternetbs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brightcommerce%2Finternetbs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brightcommerce%2Finternetbs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brightcommerce%2Finternetbs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/brightcommerce","download_url":"https://codeload.github.com/brightcommerce/internetbs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/brightcommerce%2Finternetbs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261311279,"owners_count":23139459,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T22:13:29.324Z","updated_at":"2025-07-01T02:33:59.542Z","avatar_url":"https://github.com/brightcommerce.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Gem Version](https://badge.fury.io/rb/internetbs.svg)](https://badge.fury.io/rb/internetbs)\n\n# InternetBS Client\nThe **InternetBS Client** is a Ruby API client for Internet.bs resellers. This client provides almost all of the functionality exposed by their API. To use this client you will need an API key.\n\n## Background\nThe **InternetBS Client** is an opinionated client library for the Internet.bs API. We built this library to provide fully automated provisioning of domain names for our client's apps and websites using the Brightcommerce API.\n\nThe **InternetBS Client** provides endpoint access to the API methods that fulfill our requirements. Version 1 of our client is missing domain trade/transfer, domain forwarding and reseller account configuration. We will add domain related API endpoints in version 2.\n\nThe **InternetBS Client** has undergone extensive real-world testing with real domains. We have had difficulty testing some domain extensions as we don't have a presence in the countries that own those TLD's. We provide a list of domain extensions we have tested in the Testing section of this document.\n\n## About Internet.bs\nTo find out more about Internet.bs please visit their [website](https://www.internetbs.net). You can find out more about the API by reading their [documentation](https://internetbs.net/ResellerRegistrarDomainNameAPI). To use their API you need to have a reseller account, you can find out more about their reseller requirements on their website.\n\n## Installation\nTo install add the line to your `Gemfile`:\n```\ngem 'internetbs'\n```\nAnd call `bundle install`.\n\nAlternatively, you can install it from the terminal:\n```\ngem install internetbs\n```\n\n## Dependencies\nThe **InternetBS Client** has the following runtime dependencies:\n- Virtus ~\u003e 1.0.3\n\n## Compatibility\nDeveloped with MRI 2.2, however the `.gemspec` only specifies MRI 2.0. It may work with other flavors, but it hasn't been tested. Please let us know if you encounter any issues.\n\n## How To Use\n\n### Prerequisites\nThe **InternetBS Client** requires an API key and password. By default the library will look for your API key and password in the environment variables `INTERNETBS_API_KEY` and `INTERNETBS_API_PWD`. The password is the same as used when logging into your account at their website.\n\n### Environments\nThe **InternetBS Client** supports multiple environments. These environments don't have to match your application's environments. By default the environments provided by the client are `:production`, `:test` and `:development`. The default environment is `:production` and the credentials for this environment are read from ENV variables.\n\nIf you'd like to override this behavior and provide the API key and/or password directly to the client, setup a configuration initializer as shown below:\n```ruby\nInternetBS.configure do |config|\n  config.credentials[:production][:api_key] = \"B04B4E74C57C37DE4886\"\n  config.credentials[:production][:api_pwd] = \"s3kr3t\"\n  config.credentials[:production][:api_uri] = \"https://api.internet.bs\"\n\n  config.credentials[:test][:api_key] = \"testapi\"\n  config.credentials[:test][:api_pwd] = \"testpass\"\n  config.credentials[:test][:api_uri] = \"https://testapi.internet.bs\"\n  \n  config.credentials[:development][:api_key] = \"testapi\"\n  config.credentials[:development][:api_pwd] = \"testpass\"\n  config.credentials[:development][:api_uri] = \"https://testapi.internet.bs\"\nend\n```\n\nOr pass the values directly to the attributes on the `InternetBS` namespace:\n```ruby\n# Set the environment to development:\nInternetBS.environment = :development\n\n# The set the credentials:\nInternetBS.api_key = \"B04B4E74C57C37DE4886\"\nInternetBS.api_pwd = \"s3kr3t\"\nInternetBS.api_uri = \"https://api.internet.bs\"\n```\n\nThe **InternetBS Client** provides flexibility by allowing you to use whatever credentials you want, in whatever environment you want. You can, for instance, add a `:staging` environment if you want:\n```ruby\nInternetBS.credentials[:staging][:api_key] = \"44CD64EEEFFF887755560B\"\nInternetBS.credentials[:staging][:api_pwd] = \"another_pass\"\nInternetBS.credentials[:staging][:api_uri] = \"https://api.internet.bs\"\n```\n\nYou can query the current list of environments:\n```ruby\nInternetBS.environments #=\u003e [:production, :test, :development, :staging]\n```\n\nAnd the currently selected environment:\n```ruby\nInternetBS.environment #=\u003e :development\n```\n\nThe current environment operates independently of any other framework environment, e.g. `Rails.env` or `Rack.env`. You can of course manipulate them to synchronize manually.\n\n### API Calls\nThe **InternetBS Client** provides access to the following Internet.bs API endpoints:\n\nAPI Endpoint | Description\n--- | ---\n[Account/Balance/Get](https://internetbs.net/ResellerRegistrarDomainNameAPI/api/08_account_related/01_account_balance_get) | The command is intended to retrieve the prepaid account balance.\n[Account/Pricelist/Get](https://internetbs.net/ResellerRegistrarDomainNameAPI/api/08_account_related/06_account_price_list_get) | The command is intended to obtain our pricelist.\n[Domain/Check](https://internetbs.net/ResellerRegistrarDomainNameAPI/api/01_domain_related/01_domain_check) | The command is intended to check whether a domain is available for registration or not.\n[Domain/Create](https://internetbs.net/ResellerRegistrarDomainNameAPI/api/01_domain_related/02_domain_create) | The command is intended to register a new domain.\n[Domain/Update](https://internetbs.net/ResellerRegistrarDomainNameAPI/api/01_domain_related/03_domain_update) | The command is intended to update a domain.\n[Domain/Renew](https://internetbs.net/ResellerRegistrarDomainNameAPI/api/01_domain_related/04_domain_renew) | The command is intended to renew a domain.\n[Domain/Info](https://internetbs.net/ResellerRegistrarDomainNameAPI/api/01_domain_related/05_domain_info) | The command is intended to return full details about a domain name.\n[Domain/List](https://internetbs.net/ResellerRegistrarDomainNameAPI/api/01_domain_related/06_domain_list) | This command is intended to retrieve a list of domains in your account.\n[Domain/RegistryStatus](https://internetbs.net/ResellerRegistrarDomainNameAPI/api/01_domain_related/07_domain_registry_status) | The command is intended to view a domain registry status.\n[Domain/Push](https://internetbs.net/ResellerRegistrarDomainNameAPI/api/01_domain_related/08_domain_push) | The command is intended to move a domain from one account to another.\n[Domain/Count](https://internetbs.net/ResellerRegistrarDomainNameAPI/api/01_domain_related/09_domain_count) | The command is intended to count total number of domains in the account.\n[Domain/PrivateWhois/Enable](https://internetbs.net/ResellerRegistrarDomainNameAPI/api/02_private_whois/01_domain_private_whois_enable) | The command is a purposely redundant auxiliary way to enable Private Whois for a specific domain.\n[Domain/PrivateWhois/Disable](https://internetbs.net/ResellerRegistrarDomainNameAPI/api/02_private_whois/02_domain_private_whois_disable) | The command is a purposely redundant auxiliary way to disable Private Whois for a specific domain.\n[Domain/PrivateWhois/Status](https://internetbs.net/ResellerRegistrarDomainNameAPI/api/02_private_whois/03_domain_private_whois_status) | The command is a purposely redundant auxiliary way to obtain the Private Whois status for a specific domain.\n[Domain/RegistrarLock/Enable](https://internetbs.net/ResellerRegistrarDomainNameAPI/api/03_registrar_lock/01_domain_registrar_lock_enable) | The command is a purposely redundant auxiliary way to enable the RegistrarLock for a specific domain.\n[Domain/RegistrarLock/Disable](https://internetbs.net/ResellerRegistrarDomainNameAPI/api/03_registrar_lock/02_domain_registrar_lock_disable) | The command is a purposely redundant auxiliary way to disable the RegistrarLock for a specific domain.\n[Domain/RegistrarLock/Status](https://internetbs.net/ResellerRegistrarDomainNameAPI/api/03_registrar_lock/03_domain_registrar_lock_status) | The command is a purposely redundant auxiliary way to retrieve the current RegistrarLock status for specific domain.\n[Domain/DnsRecord/Add](https://internetbs.net/ResellerRegistrarDomainNameAPI/api/05_dns_management_related/01_domain_dns_record_add) | The command is intended to add a new DNS record to a specific zone (domain).\n[Domain/DnsRecord/Remove](https://internetbs.net/ResellerRegistrarDomainNameAPI/api/05_dns_management_related/02_domain_dns_record_remove) | The command is intended to remove a DNS record from a specific zone.\n[Domain/DnsRecord/Update](https://internetbs.net/ResellerRegistrarDomainNameAPI/api/05_dns_management_related/03_domain_dns_record_update) | The command is intended to update an existing DNS record.\n[Domain/DnsRecord/List](https://internetbs.net/ResellerRegistrarDomainNameAPI/api/05_dns_management_related/04_domain_dns_record_list) | The command is intended to retrieve the list of DNS records for a specific domain.\n[Domain/Host/Create](https://internetbs.net/ResellerRegistrarDomainNameAPI/api/07_nameservers_related/01_domain_host_create) | The command is intended to create a host also known as name server or child host.\n[Domain/Host/Update](https://internetbs.net/ResellerRegistrarDomainNameAPI/api/07_nameservers_related/02_domain_host_update) | The command is intended to update a host; the command is replacing the current list of IP for the host with the new one you provide.\n[Domain/Host/Info](https://internetbs.net/ResellerRegistrarDomainNameAPI/api/07_nameservers_related/03_domain_host_info) | The command is intended to retrieve existing host (name server) information for a specific host.\n[Domain/Host/Delete](https://internetbs.net/ResellerRegistrarDomainNameAPI/api/07_nameservers_related/04_domain_host_delete) | The command is intended to delete (remove) an unwanted host.\n[Domain/Host/List](https://internetbs.net/ResellerRegistrarDomainNameAPI/api/07_nameservers_related/05_domain_host_list) | The command is intended to retrieve the list of hosts defined for a domain.\n\nThe **InternetBS Client** does not provide access to the following Internet.bs API endpoints. They are currently slated for Version 2:\n\nAPI Endpoint | Description\n--- | ---\n[Domain/Transfer/Initiate](https://internetbs.net/ResellerRegistrarDomainNameAPI/api/04_transfer_trade/01_domain_transfer_initiate) | The command is intended to initiate an incoming domain name transfer.\n[Domain/Transfer/Cancel](https://internetbs.net/ResellerRegistrarDomainNameAPI/api/04_transfer_trade/02_domain_transfer_cancel) | The command is intended to cancel a pending incoming transfer request.\n[Domain/Transfer/ResendAuthEmail](https://internetbs.net/ResellerRegistrarDomainNameAPI/api/04_transfer_trade/03_domain_transfer_resend_auth_email) | The command is intended to resend the Initial Authorization for the Registrar Transfer email for a pending, incoming transfer request.\n[Domain/TransferAway/Approve](https://internetbs.net/ResellerRegistrarDomainNameAPI/api/04_transfer_trade/04_domain_transfer_away_approve) | The command is intended to immediately approve a pending, outgoing transfer request (you are transferring a domain away).\n[Domain/TransferAway/Reject](https://internetbs.net/ResellerRegistrarDomainNameAPI/api/04_transfer_trade/05_domain_transfer_away_reject) | The command is intended to reject a pending, outgoing transfer request (you are transferring away a domain).\n[Domain/Transfer/History](https://internetbs.net/ResellerRegistrarDomainNameAPI/api/04_transfer_trade/06_domain_transfer_history) | The command is intended to retrieve the history of a transfer.\n[Domain/Transfer/Retry](https://internetbs.net/ResellerRegistrarDomainNameAPI/api/04_transfer_trade/07_domain_transfer_retry) | This command is intended to reattempt a transfer in case an error occurred because inaccurate transfer auth info was provided or because the domain was locked or in some other cases where an intervention by the customer is required before retrying the transfer.\n[Domain/Trade](https://internetbs.net/ResellerRegistrarDomainNameAPI/api/04_transfer_trade/08_domain_trade) | The command is used to initiate a .fr/.re/.pm/.yt/.tf/.wf trade.\n[Domain/ChangeTag/DotUK](https://internetbs.net/ResellerRegistrarDomainNameAPI/api/04_transfer_trade/09_domain_change_tag_uk) | The command is intended for transferring away a .uk domain.\n\nThe **InternetBS Client** *does not* provide access to the following Internet.bs API endpoints and are not currently slated for inclusion since they are not likely to be required by the Brightcommerce API. If there are significant requests for these endpoints to be included, we'll consider adding them. If you would like to add them yourself, we'll be happy to accept merge requests as long as the coding style remains congruent. \n\nAPI Endpoint | Description\n--- | ---\n[Domain/EmailForward/Add](https://internetbs.net/ResellerRegistrarDomainNameAPI/api/06_forwarding_related/01_domain_email_forward_add) | The command is intended to add a new Email Forwarding rule.\n[Domain/EmailForward/Remove](https://internetbs.net/ResellerRegistrarDomainNameAPI/api/06_forwarding_related/02_domain_email_forward_remove) | The command is intended to remove an existing Email Forwarding rule.\n[Domain/EmailForward/Update](https://internetbs.net/ResellerRegistrarDomainNameAPI/api/06_forwarding_related/03_domain_email_forward_update) | The command is intended to update an existing Email Forwarding rule.\n[Domain/EmailForward/List](https://internetbs.net/ResellerRegistrarDomainNameAPI/api/06_forwarding_related/04_domain_email_forward_list) | The command is intended to retrieve the list of email forwarding rules for a domain.\n[Domain/UrlForward/Add](https://internetbs.net/ResellerRegistrarDomainNameAPI/api/06_forwarding_related/05_domain_url_forward_add) | The command is intended to add a new URL Forwarding rule.\n[Domain/UrlForward/Remove](https://internetbs.net/ResellerRegistrarDomainNameAPI/api/06_forwarding_related/06_domain_url_forward_remove) | The command is intended to remove an existing URL Forwarding rule.\n[Domain/UrlForward/Update](https://internetbs.net/ResellerRegistrarDomainNameAPI/api/06_forwarding_related/07_domain_url_forward_update) | The command is intended to update an existing URL Forwarding rule.\n[Domain/UrlForward/List](https://internetbs.net/ResellerRegistrarDomainNameAPI/api/06_forwarding_related/08_domain_url_forward_list) | The command is intended to retrieve the list of URL forwarding rules for a domain.\n[Account/Configuration/Get](https://internetbs.net/ResellerRegistrarDomainNameAPI/api/08_account_related/04_account_configuration_get) | The command is intended to view the account configuration.\n[Account/Configuration/Set](https://internetbs.net/ResellerRegistrarDomainNameAPI/api/08_account_related/05_account_configuration_set) | The command allows you to set the available configuration values for the API.\n[Account/DefaultCurrency/Get](https://internetbs.net/ResellerRegistrarDomainNameAPI/api/08_account_related/02_account_currency_get) | The command is intended to set the default currency.\n[Account/DefaultCurrency/Set](https://internetbs.net/ResellerRegistrarDomainNameAPI/api/08_account_related/03_account_currency_set) | The command is intended to set the default currency.\n\n## How To Use\nWe've attempted to make the **InternetBS Client** interface as consistent as possible. We send requests as follows to the Internet.bs API endpoints:\n- All requests are `GET` or `POST` requests. The Internet.bs API doesn't accept `PATCH`, `PUT` or `DELETE` requests.\n- Calling read-only endpoints use the `GET` HTTP verb and pass parameters as URL-endcoded.\n- Calling endpoints that make changes, ie. create, update or delete requests, use the `POST` HTTP verb and send parameters as `x-www-form-urlencoded` in the request body.\n- As specified by the Internet.bs API, only SSL-secured endpoints using the HTTPS scheme are called.\n- The reseller's API key and password are passed as parameters.\n- The `responseformat` parameter requesting a JSON-encoded response is sent with every request.\n\nThe **InternetBS Client** breaks the API into consistent logical domain models. The models are backed by Virtus Model and most provide a `#fetch` method. Where a model performs a specific action the method will be named, and the parameters for the model must be provided as attributes on the class. Every call performs some validation before executing the API call. If the validation fails, the call will exit early, return `false` and any exceptions are made available in the `#errors` collection attribute.\n\nFollowing are examples of how to instanciate each class with attributes where necessary, and the properties that can be queried on the class after each API call. All example information including names, addresses and other details are completely fictional and provided to give context.\n\n### Account Balances\nFetch the current reseller account balances for each currency. Balances are returned as a collection of `AccountBalance`.\n```ruby\n@balances = InternetBS::AccountBalances.new\n\nresult = @balances.fetch #=\u003e true\n\n# Alternatively you pass the currency you're interested in:\n@balances.currency = 'USD'\nresult = @balances.fetch #=\u003e true\n\n# If the fetch method fails it will return false \n# and populate the errors collection attribute:\nunless result\n  @balances.errors.each do |error|\n    puts error\n  end\nend\n\n# Iterate the collection of balances:\n@balances.each do |balance|\n  puts balance.amount   #=\u003e 1234.56\n  puts balance.currency #=\u003e 'USD'\nend\n```\n\n### Account Domains\nFetch a list of domains and domain counts for the currect reseller account. Domains are returned as a collection of `AccountDomain`.\n```ruby\n@domains = InternetBS::AccountDomains.new\n\nresult = @domains.fetch #=\u003e true\n\n# If the fetch method fails it will return false \n# and populate the errors collection attribute:\nunless result\n  @account.errors.each do |error|\n    puts error\n  end\nend\n\n# Iterate the collection of domains:\n@domains.list.each do |domain|\n  puts domain.name #=\u003e 'example.com'\nend\n```\n\n#### Options\nTo customize the results returned you can set the following options as attributes on the class:\n\nOption | Class | Description\n--- | --- | ---\n`#compact_list` | Boolean | If `true` the list of domains returned will consist solely of domain names, if `false` the list of domains returned will contain additional information such as expiration date, epp auth info, status and registrar lock status. The default value is `true`.\n`#expiring_only` | Boolean | If `true` will restrict list of domains returned to those that are expiring. This cannot be used in conjunction with `#pending_transfer_only`. The default value is `false`.\n`#extension_filter` | String | A comma-separated list of domain extensions e.g. `com,net,org,co.uk`.\n`#pending_transfer_only` | Boolean | If `true` will restrict list of domains returned to those that are in Pending Transfer status.\n`#range_from`, `#range_to` | Integer | If you want the listing to be paginated use these two parameters, they represent page numbers.\n`#search_term_filter` | String | Retrieve a list of domains that contain a specific text.\n`#sort_by` | String | specify a sorting criteria. Possible values are: `DOMAIN_NAME`, `DOMAIN_NAME_DESC`, `EXPIRATION`, `EXPIRATION_DESC`. The default value is `DOMAIN_NAME`.\n\n#### Retrieving Totals\nTo retrieve the number of domains in an account, the **InternetBS Client** provides the following method:\n\nMethod | Description\n--- | ---\n`#fetch_totals` | Call this method to retrieve the total number of domains. The total number of domains can be queried on the `#total_domains` attribute. The number of domains for each TLD can be queried on the `#total_domains_by_tld` attribute.\n\n### Account Prices\nFetch the price list for the current reseller. Prices are returned as a collection of `AccountPrice`.\n```ruby\n@prices = InternetBS::AccountPrices.new\n\nresult = @prices.fetch #=\u003e true\n\n# If the fetch method fails it will return false \n# and populate the errors collection attribute:\nunless result\n  @prices.errors.each do |error|\n    puts error\n  end\nend\n\n@prices.list #=\u003e an enumerable array of InternetBS::AccountPrice\n@prices.list.size #=\u003e 39\n\n# Enumerate each\n@prices.list.each do |price|\n  puts price.name\n  ...\nend\n\n# AccountPrice properties\nprice = @prices.list.select { |p| \n          p.name == '.com' \u0026\u0026 p.operation == 'registration'\n        }\nprice.is_a?(InternetBS::AccountPrice) #=\u003e true\nprice.currency #=\u003e USD\nprice.name #=\u003e .com\nprice.operation #=\u003e registration\nprice.price_1_year #=\u003e 8.99\nprice.price_2_years #=\u003e 8.95\nprice.price_3_years #=\u003e 8.93\nprice.price_4_years #=\u003e 8.91\nprice.price_5_years #=\u003e 8.89\nprice.price_6_years #=\u003e 8.87\nprice.price_7_years #=\u003e 8.85\nprice.price_8_years #=\u003e 8.83\nprice.price_9_years #=\u003e 8.81\nprice.price_10_years #=\u003e 8.79\n\n# Display the price level (only available from version 2 query):\n@prices.level #=\u003e Basic\n```\n\n#### Options\nThe following options are available as attributes on the `AccountPrices` class. Set these attributes before calling `#fetch`.\n\nOption | Class | Description\n--- | --- | ---\n`#version` | Integer | Pass `1` or `2` for the version attribute to fetch prices. Version 1 will retrieve prices for one year. Version 2 will retrieve prices for 10 years.\n`#currency` | String | Retrieve the price list in a specific currency. By default the list will be retrieved in `USD`.\n`#discount_code` | String | Apply a discount to the retrieved price list.\n\n### Domain Availability\nCheck whether a domain is available for registration or not.\n```ruby\n@domain = InternetBS::DomainAvailability.new(:domain =\u003e 'acme.com')\n\nresult = @domain.fetch #=\u003e true\n\n# If the fetch method fails it will return false \n# and populate the errors collection attribute:\nunless result\n  @domain.errors.each do |error|\n    puts error\n  end\nend\n\n# Is the domain available?\nputs @domain.available? #=\u003e true\n\n# Other properties you can check:\nputs @domain.transaction_id #=\u003e 234678268342423876\nputs @domain.max_registration_period #=\u003e 10 # years\nputs @domain.min_registration_period #=\u003e 1 # year\nputs @domain.private_whois_allowed #=\u003e true\nputs @domain.realtime_registration #=\u003e true\nputs @domain.registrar_lock_allowed #=\u003e true\n\n# You can also heck the status attribute which will return a String containing one of the following: AVAILABLE, UNAVAILABLE or FAILURE:\nputs @domains.status #=\u003e AVAILABLE\n```\n\n### Domain Information\nCheck whether a domain is available for registration or not.\n```ruby\n@domain = InternetBS::DomainInformation.new(:domain =\u003e 'acme.com')\n\nresult = @domain.fetch #=\u003e true\n\n# If the fetch method fails it will return false \n# and populate the errors collection attribute:\nunless result\n  @domain.errors.each do |error|\n    puts error\n  end\nend\n\n# DomainInformation properties:\nputs @domain.domain_status #=\u003e REGISTERED\nputs @domain.auto_renew #=\u003e false\nputs @domain.domain_extension #=\u003e .com\nputs @domain.expiration_date #=\u003e 2011/03/05\nputs @domain.private_whois #=\u003e FULL\nputs @domain.registrar_lock #=\u003e ENABLED\nputs @domain.transfer_auth_info #=\u003e 1542c06388d8e03e14613788ca6bd914\nputs @domain.contacts #=\u003e array of DomainContact, see below\n```\n\n#### Domain Contacts\n```ruby\n# Iterate domain contacts:\n@domain.contacts.each do |contact|\n  puts contact.contact_type #=\u003e :registrant\n  puts contact.city\n  puts contact.country\n  puts contact.country_code\n  puts contact.email\n  puts contact.fax\n  puts contact.first_name\n  puts contact.last_name\n  puts contact.obfuscate_email #=\u003e true\n  puts contact.organization\n  puts contact.phone_number\n  puts contact.postal_code\n  puts contact.street\n  puts contact.street_2\n  puts contact.street_3\n  puts contact.additional_attributes # see below\nend\n```\n\n#### Domain Contact Additional Attributes\nSome domain extensions have additional attributes. Listed below are the additional attributes for each domain extension.\n\n##### .ASIA TLD\nCED is an acronym for Charter Eligibility Declaration.\n\nAttribute | Type | Required?\n--- | --- | ---\nced_locality | String | YES\nced_entity | String (only `CED_ENTITY_TYPES`) | YES\nced_entity_other | String | YES if `ced_entity == 'other'`\nced_id_form | String (only `CED_ID_FORM_TYPES`) | YES\nced_id_form_other | String | YES if `ced_id_form == 'other'`\nced_city | String | NO\nced_id_number | String | NO\nced_state_province | String | NO\n\n##### .DE TLD\nAttribute | Type | Required?\n--- | --- | ---\nrole | String (only `ROLES`) | YES\nip_address | String | YES\ndisclose_name | Boolean (default `false`) | YES\ndisclose_contact | Boolean (default `false`) | YES\ndisclose_address | Boolean (default `false`) | YES\nremark | String | NO\nsip_uri | String | NO\nterms_accepted | Boolean (default `false`) | YES\n\n##### .EU TLD\nAttribute | Type | Required?\n--- | --- | ---\nlanguage | String (only `LANGUAGE_CODES`) | YES\n\n##### .FR TLD\nAttribute | Type | Required?\n--- | --- | ---\nentity_type | String (only `CONTACT_ENTITY_TYPES`) | YES\nentity_name | String | YES if `entity_type == COMPANY,TRADEMARK,ASSOCIATION,ENTITY`\nentity_vat | String | NO\nentity_siren | String | NO\nentity_duns | String | NO\nentity_trade_mark | String | YES if `entity_type == TRADEMARK`\nentity_waldec | String | YES if `entity_type == ASSOCIATION`\nentity_date_of_association | Date (`YYYY-MM-DD`) | YES if `entity_type == ASSOCIATION`\nentity_date_of_publication | Date (`YYYY-MM-DD`) | YES if `entity_type == ASSOCIATION`\nentity_gazette_announcement_number | String | YES if `entity_type == ASSOCIATION`\nentity_gazette_page_number | String | YES if `entity_type == ASSOCIATION`\nentity_birth_date | Date (`YYYY-MM-DD`) | NO\nentity_birth_place_country_code | String (only `COUNTRY_CODES`) | NO\nentity_birth_city | String | NO\nentity_birth_place_postal_code | String | NO\nentity_restricted_publication | Boolean | NO\nother_contact_entity | String | \n\n##### .IT TLD\nAttribute | Type | Required?\n--- | --- | ---\nentity_type | String (only `ENTITY_TYPES`) | YES\nnationality | String (only `COUNTRY_CODES`) | YES\nreg_code | String | YES\nhide_whois | Boolean (default `false`) | YES\nprovince | String (only `PROVINCIAL_CODES` | YES if `nationality == IT`\nterms_1_accepted | Boolean (default `false`) | YES\nterms_2_accepted | Boolean (default `false`) | YES\nterms_3_accepted | Boolean (default `false`) | YES\nterms_4_accepted | Boolean (default `false`) | YES\nip_address | String | YES\n\n##### .NL TLD\nAttribute | Type | Required?\n--- | --- | ---\nip_address | String | YES\nlegal_form | String (only `LEGAL_FORMS`) | YES\nregistration_number | String | NO\nterms_accepted | Boolean (default `false`) | YES\n\n##### .UK TLD\nAttribute | Type | Required?\n--- | --- | ---\ncounty | String | YES\norganization_type | String (only `ORGANIZATION_TYPES`) | YES\norganization_number | String |  YES if `organization_type == LTD,PLC,LLP,IP,SCH,RCHAR`\nregistration_number | String | YES if `organization_type == LTD,PLC,LLP,IP,SCH,RCHAR`\nopt_out | Boolean (default `false`) | YES if `organization_type == FIND,IND`\n\n##### .US TLD\nAttribute | Type | Required?\n--- | --- | ---\npurpose | String (only `PURPOSES`) | YES\nnexus_category | String (only `NEXUS_CATEGORIES`) | YES\nnexus_country | String (only `COUNTRY_CODES`) | YES if `nexus_category == C31,C32`\n\n### Domain Hosts (Name Servers)\nAdd, update, remove and list domain host records, otherwise known as name servers or child hosts.\n```ruby\n@ns = InternetBS::DomainHosts.new(:domain =\u003e 'acme.com')\n\n# TODO: Document `:compact =\u003e false` # default is true\n\nresult = @ns.fetch #=\u003e true\n\n# If the fetch method fails it will return false\n# and populate the errors collection attribute:\nunless result\n  @ns.errors.each do |err|\n    puts err\n  end\nend\n\n@ns.list #=\u003e an array of DomainHost\n@ns.list.size #=\u003e 3\n\n# Enumerate each\n@ns.list.each do |ns|\n  puts ns.host\nend\n\n# DomainHost properties\nns = @ns.list.first\nns.is_a?(DomainHost) #=\u003e true\nputs ns.host #=\u003e ns1.someregistrar.com\nputs ns.ip_addresses #\u003e [111.222.333.444]\n\n# Add a domain host (pass in a DomainHost instance):\nns4 = InternetBS::DomainHost.new(\n  :host =\u003e \"ns4.acme.com\", \n  :ip_addresses =\u003e ['112.223.334.445'] # array of one or more ip addresses\n)\n\n@hosts = DomainHosts.new(:domain =\u003e 'acme.com')\nresult = @hosts.add(ns4) #=\u003e true\n\n# Update a domain host (pass in a DomainHost instance):\nns4.ip_addresses[0] = '112.223.334.455'\nresult = @hosts.update(ns4) #=\u003e true\n\n# Remove a domain host (pass in a DomainHost instance):\nresult = @hosts.remove(ns4) #=\u003e true\n```\n\n### Domain Records (DNS)\nAdd, update, remove and list domain records, otherwise known as DNS records.\n```ruby\n@dns_records = InternetBS::DomainRecords.new(:domain =\u003e 'acme.com')\n\n# TODO: Document `:filter_type =\u003e DomainRecord::TYPES` # 'A', 'AAAA', 'DYNAMIC', 'CNAME', 'MX', 'SRV', 'TXT', 'NS'\n\nresult = @dns_records.fetch #=\u003e true\n\n# If the fetch method fails it will return false\n# and populate the errors collection attribute:\nunless result\n  @dns_records.errors.each do |err|\n    puts err\n  end\nend\n\n@dns_records.list #=\u003e an array of DomainRecord\n@dns_records.list.size #=\u003e 8\n\n# Enumerate each\n@dns_records.list.each do |record|\n  puts record.name #=\u003e www.acme.com\nend\n\n# DomainRecord properties\ndns = @dns_records.list.first\ndns.is_a?(DomainRecord) #=\u003e true\nputs dns.type #=\u003e A\nputs dns.value #=\u003e 111.222.333.444\nputs dns.ttl #=\u003e 3600\n\n# Add a domain record (pass in a DomainRecord instance):\ndns_record = InternetBS::DomainRecord.new(\n  :name =\u003e \"api.acme.com\", \n  :type =\u003e \"A\",\n  :value =\u003e \"111.222.333.456\",\n  :ttl =\u003e 3600\n)\n\n@dns_records = DomainRecords.new(:domain =\u003e 'acme.com')\nresult = @dns_records.add(dns_record) #=\u003e true\n\n# Update a domain record (pass in a Domainrecord instance):\ndns_record.value = '111.222.333.457'\nresult = @dns_records.update(dns_record) #=\u003e true\n\n# Remove a domain record (pass in a DomainRecord instance):\nresult = @dns_records.remove(dns_record) #=\u003e true\n```\n\n### Private Whois\nThis API is intended for checking and/or changing the private whois option for a domain.\n```ruby\n@private_whois = InternetBS::PrivateWhois.new(:domain =\u003e \"acme.com\")\n\nresult = @private_whois.fetch #=\u003e true\n\n# If the fetch method fails it will return false\n# and populate the errors collection attribute:\nunless result\n  @private_whois.errors.each do |err|\n    puts err\n  end\nend\n\n@private_whois.privacy_status #=\u003e FULL\n\n# Disable privacy:\nresult = @private_whois.disable #=\u003e true\n\n# Enable privacy:\n@private_whois.privacy_status = 'PARTIAL'\nresult = @private_whois.enable #=\u003e true\n```\n\n### Registrar Lock\nThis API is intended for checking and/or changing the registrar lock for a domain.\n```ruby\n@registrar_lock = InternetBS::RegistrarLock.new(:domain =\u003e \"acme.com\")\n\nresult = @registrar_lock.fetch #=\u003e true\n\n# If the fetch method fails it will return false\n# and populate the errors collection attribute:\nunless result\n  @registrar_lock.errors.each do |err|\n    puts err\n  end\nend\n\n@registrar_lock.lock_status #=\u003e FULL\n\n# Disable registrar lock:\nresult = @registrar_lock.disable #=\u003e true\n\n# Enable registrar lock:\nresult = @registrar_lock.enable #=\u003e true\n```\n\n### Registry Status\nThis API is intended for checking the registry status of a domain.\n```ruby\n@registry_status = InternetBS::RegistryStatus.new(:domain =\u003e \"acme.com\")\n\nresult = @registry_status.fetch #=\u003e true\n\n# If the fetch method fails it will return false\n# and populate the errors collection attribute:\nunless result\n  @registry_status.errors.each do |err|\n    puts err\n  end\nend\n\n@registry_status.registry_status #=\u003e clientTransferProhibited\n```\n\n### Updating a Domain\nUpdate the properties of a domain including auto-renewal, private whois, registrar lock, transfer auth info, domain contacts, and nameservers. For .tel domains you can also update the hosting account and password.\n```ruby\n@domain = InternetBS::UpdateDomain.new(:domain =\u003e \"acme.com\")\n\nresult = @domain.fetch #=\u003e true\n\n# If the fetch method fails it will return false\n# and populate the errors collection attribute:\nunless result\n  @domain.errors.each do |err|\n    puts err\n  end\nend\n\n# Set properties that need updating on the `@domain` instance:\n@domain.auto_renew = false\n@domain.private_whois = 'FULL'\n@domain.registrar_lock = 'ENABLED'\n@domain.transfer_auth_info\n\nregistrant = InternetBS::DomainContact.new(\n  :contact_type =\u003e :registrant,\n  :first_name =\u003e 'John',\n  :last_name =\u003e 'Doe',\n  ...\n)\n@domain.contacts = [registrant, billing, technical, admin]\n\nns_list = ['ns1.example.com', 'ns2.example.com', 'ns3.example.com']\n@domain.nameservers = ns_list\n\n# For .tel domains only:\n@domain.tel_hosting_account = 'my_username'\n@domain.tel_hosting_password = 'my_password'\n@domain.tel_hide_whois_data = true\n\n# Then call the `#update!` method:\nresult = @domain.update! #=\u003e true\n```\n\n### Ordering a Domain\nUse this class to purchase a domain. Contacts must be provided as an array of `DomainContact` records.\n```ruby\n@order = InternetBS::OrderDomain.new(\n  :domain               =\u003e \"bigacme.com\",\n  :currency             =\u003e \"USD\",\n  :period               =\u003e \"1Y\",\n  :nameservers          =\u003e ['ns1.example.com', 'ns2.example.com'],\n  :transfer_auth_info   =\u003e 'EPP AUTH INFO HERE', # optional\n  :registrar_lock       =\u003e 'ENABLED', #optional\n  :private_whois        =\u003e 'FULL', # optional\n  :discount_code        =\u003e '10PERCENT', # optional\n  :auto_renew           =\u003e true, # optional\n  :contacts             =\u003e [registrant, admin, billing, ...],\n  :tel_hosting_account  =\u003e 'my_username', # optional, .tel only\n  :tel_hosting_password =\u003e 'my_password', # optional, .tel only\n  :tel_hide_whois_data  =\u003e true # optional, .tel only\n)\n\nresult = @order.purchase! #=\u003e true\n\n# If the purchase! method fails it will return false\n# and populate the errors collection attribute:\nunless result\n  @order.errors.each do |err|\n    puts err\n  end\nend\n\n# Order properties\n@order.status #=\u003e 'SUCCESS'\n@order.transaction_id #=\u003e 820b6791e386b31b354e613a6371c7bc\n@order.total_price #=\u003e 13.9\n```\n\n### Pushing a Domain\nUse this class to change the account that is responsible for managing the domain. Pushing a domain does not automatically change the official Registrant/Admin contacts.\n```ruby\n@domain = InternetBS::DomainPush.new(\n  :domain        =\u003e \"bigacme.com\", # the domain to push\n  :email_address =\u003e \"jane.doe@somewhere.else.com\" # the new manager\n)\n\nresult = @domain.push! #=\u003e true\n\n# If the push! method fails it will return false\n# and populate the errors collection attribute:\nunless result\n  @domain.errors.each do |err|\n    puts err\n  end\nend\n```\n\n### Renewing a Domain\nUse this class to renew a domain. Currency will default to `USD` and the period will default to one year (`1Y`).\n```ruby\n@renewal = InternetBS::RenewDomain.new(\n  :domain        =\u003e \"bigacme.com\",\n  :currency      =\u003e \"USD\", # default\n  :period        =\u003e \"1Y\", # default\n  :discount_code =\u003e '10PERCENT' # optional\n)\n\nresult = @renewal.purchase! #=\u003e true\n\n# If the purchase! method fails it will return false\n# and populate the errors collection attribute:\nunless result\n  @renewal.errors.each do |err|\n    puts err\n  end\nend\n\n# Renewal properties\n@renewal.status #=\u003e 'SUCCESS'\n@renewal.transaction_id #=\u003e 4e74069f2b5d1d62282c21d0a2e49a27\n@renewal.total_price #=\u003e 13.9\n```\n\n### Country Codes\nThe **InternetBS Client** provides a constant hash of country codes. This list is derived from https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2. The hash keys are ISO_3166-1_alpha-2 codes and the values are the country display name. The top 20 countries by number of Internet users are grouped first, see  https://en.wikipedia.org/wiki/List_of_countries_by_number_of_Internet_users.\n\nExample: access a country name by code:\n```ruby\nInternetBS::COUNTRY_CODES['US'] #=\u003e United States\n```\nAll the regular hash functions are available for finding keys and values, but the hash is immutable. If you want to manipulate the list, for example to sort it differently; you will have to copy it into a new hash variable first.\n\n### Language Codes\nThe **InternetBS Client** provides a constant hash of the most commonly required language codes. This list is derived from https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes. The hash keys are ISO 639-1 two-letter codes, and the values are the language display name.\n\nExample: access a language name by code:\n```ruby\nInternetBS::LANGUAGE_CODES['en'] #=\u003e English\n```\nAll the regular hash functions are available for finding keys and values, but the hash is immutable. If you want to manipulate the list, for example to sort it differently; you will have to copy it into a new hash variable first.\n\n## Testing\nTBA - Currently partially tested using reseller account and testapi endpoints.\n\n## To Do\n- Investigate account transactions API endpoint.\n- Implement Version 2 API endpoints.\n- Test suite with mocks for CI/CD scenarios.\n\n## Acknowledgements\n#### Version \u003e= 1.0.1\n- Jurgen Jocubeit - President \u0026 CEO, [Brightcommerce, Inc.](https://twitter.com/brightcommerce)\n\n## License\nThis library is release in the public domain under the [MIT License](http://opensource.org/licenses/MIT).\n\n## Copyright\nCopyright 2015 Brightcommerce, Inc.\nAll rights reserved.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrightcommerce%2Finternetbs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbrightcommerce%2Finternetbs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbrightcommerce%2Finternetbs/lists"}