承接 hostmyservers/netim-rest_api 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

hostmyservers/netim-rest_api

最新稳定版本:1.01

Composer 安装命令:

composer require hostmyservers/netim-rest_api

包简介

Client REST API pour Netim par HostMyServers

README 文档

README

A Laravel package to interact with the Netim API for domain management.

Installation

You can install the package via composer:

composer require hostmyservers/netim-rest-api

Configuration

First, publish the configuration file using the following command:

php artisan vendor:publish --provider="HostMyServers\NetimRestApi\NetimServiceProvider"

This will create a config/netim.php file in your project.

Add these variables to your .env file:

NETIM_LOGIN=your_login NETIM_SECRET=your_secret NETIM_LANGUAGE=EN NETIM_API_URL=https://api.netim.com/v1/

The published configuration file will automatically use these environment variables.

Basic Usage

use HostMyServers\NetimRestApi\NetimClient; // Initialize the client $netim = new NetimClient(); // Check domain availability $availability = $netim->domain->checkDomain('example.com'); // Get domain information $domainInfo = $netim->domain->getDomainInfo('example.com'); // Update DNS servers $nameservers = [ 'ns1.example.com', 'ns2.example.com' ]; $dnsUpdate = $netim->domain->updateDNS('example.com', $nameservers); // Enable WHOIS privacy $privacy = $netim->domain->setWhoisPrivacy('example.com', true); // Get list of all domains $allDomains = $netim->domain->getDomainsList();

Error Handling

The API client throws NetimException when errors occur. You should handle these exceptions in your code:

use HostMyServers\NetimRestApi\Exceptions\NetimException; try { $domainInfo = $netim->domain->getDomainInfo('example.com'); } catch (NetimException $e) { echo "Error: " . $e->getMessage(); echo "API Error Code: " . $e->getApiErrorCode(); echo "API Error Data: " . print_r($e->getApiErrorData(), true); }

Session Management

The client automatically handles session creation and cleanup. However, you can manually manage sessions if needed:

// Check if session is active if ($netim->hasActiveSession()) { // Do something } // Force session renewal $netim->renewSession(); // Manually close session $netim->closeSession();

Available Methods

Domain Management (DomainService)

  • getDomainInfo(string $domain): Get domain information
  • checkDomain(string $domain): Check domain availability
  • checkDomainClaim(string $domain): Check domain claims
  • createDomain(string $domain, array $domainData): Register a new domain
  • transferDomain(string $domain, array $transferData): Transfer a domain to Netim
  • transferDomainTrade(string $domain, array $transferData): Transfer and trade a domain
  • renewDomain(string $domain, int $period): Renew a domain
  • updateDNS(string $domain, array $nameservers): Update DNS servers
  • setWhoisPrivacy(string $domain, bool $enabled): Enable/Disable WHOIS privacy
  • setAutoRenew(string $domain, bool $enabled): Enable/Disable auto-renewal
  • getWhois(string $domain): Get WHOIS information
  • deleteDomain(string $domain): Delete a domain
  • getDomainsList(): Get list of all domains
  • setDNSSEC(string $domain, int $enabled): Configure DNSSEC
  • setDNSSECExt(string $domain, array $dnssecData): Configure external DNSSEC
  • setDomainLock(string $domain, string $locked): Update domain lock status
  • requestAuthCode(string $domain, int $sendtoregistrant): Request authorization code
  • restoreDomain(string $domain): Restore an expired domain

Zones Management (ZonesService)

  • initializeDnsZone(string $domain, array $options): Initialize a DNS zone
  • initializeSoaRecord(string $domain, array $options): Initialize SOA record
  • createDnsZone(string $domain, array $records): Create a DNS zone
  • deleteDnsZone(string $domain, $records): Delete a DNS zone
  • getDnsRecordsList(string $domain): Get list of DNS records
  • createMailForward(string $domain, string $source, string $destination): Create an email forward
  • deleteMailForward(string $domain, string $source): Delete an email forward
  • getMailForwardsList(string $domain): Get list of email forwards
  • createWebForward(string $domain, string $source, string $destination, array $options): Create a web forward
  • deleteWebForward(string $domain, string $source): Delete a web forward
  • getWebForwardsList(string $domain): Get list of web forwards

Contact Management (ContactService)

  • createContact(array $contactData): Create a new contact
  • getContact(string $contactId): Get contact information
  • updateContact(string $contactId, array $contactData): Update a contact
  • deleteContact(string $contactId): Delete a contact
  • getContactList(string $field, string $filter): Get filtered list of contacts

TLD Services (TldService)

  • getInfo(string $tld): Get TLD information
  • getPriceList(): Get TLD price list

Web Hosting (WebHostingService)

  • getHostingInfo(string $hostingId): Get web hosting information
  • createHosting(array $hostingData): Create a new web hosting

License

This package is open-sourced software licensed under the MIT license.

统计信息

  • 总下载量: 1.59k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 3
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固