An open API service indexing awesome lists of open source software.

https://github.com/ahwm/godaddywrapper.net

.Net GoDaddy API Wrapper in C#
https://github.com/ahwm/godaddywrapper.net

api dotnetcore godaddy wrapper

Last synced: 2 months ago
JSON representation

.Net GoDaddy API Wrapper in C#

Awesome Lists containing this project

README

          

# GodaddyWrapper.Net

[![nuget](https://img.shields.io/nuget/vpre/GodaddyWrapper.svg)](https://www.nuget.org/packages/GodaddyWrapper)
[![build](https://github.com/ahwm/GodaddyWrapper.Net/actions/workflows/build.yml/badge.svg)](https://github.com/ahwm/GodaddyWrapper.Net/actions/workflows/build.yml)

## A Brief Intro

GodaddyWrapper.NET is a .NET Wrapper for calling GoDaddy REST API.

[Visit GoDaddy Rest API Docs](https://developer.godaddy.com/doc)

## Usage

### .NET Framework

```cs
var options = new GoDaddyClientOptions
{
AccessKey = "{key}",
SecretKey = "{secret}",
IsTesting = true /* false to use production */
};
var client = new GoDaddyClient(options);

try
{
var response = await client.CheckDomainAvailable(new DomainAvailable
{
domain = "google.com"
});
}
catch (GodaddyException ex)
{
   //Godaddy Error Message from the Godaddy API
Console.WriteLine(ex.ErrorResponse.Message);
//Error Code
Console.WriteLine(ex.StatusCode);
}
```

### .NET Core/.NET 5+

Program.cs / Startup.cs

```cs
builder.Services.AddGoDaddy(
configuration.GoDaddyAccessKey,
configuration.GoDaddySecretKey,
configuration.Sandbox);
```

Service Class (or controller)

```cs
public class GoDaddyDomainService(GoDaddyClient goDaddyClient)

try
{
var response = await goDaddyClient.CheckDomainAvailable(new DomainAvailable
{
domain = "google.com"
});
}
catch (GodaddyException ex)
{
   //Godaddy Error Message from the Godaddy API
Console.WriteLine(ex.ErrorResponse.Message);
//Error Code
Console.WriteLine(ex.StatusCode);
}
```

## Version History

### 4.0.0

- GoDaddy V2 APIs
- GoDaddy ANS API
- Dependency updates

### 3.4.0

- Updated dependencies

### 3.3.0

- Fixed NameServers property on DomainUpdate request

### 3.2.0

- Dependency updates

### 3.1.0

- JSON Updates ([#48](https://github.com/ahwm/GodaddyWrapper.Net/pull/48) by [@dlmelendez](https://github.com/dlmelendez))

### 3.0.0

- Various dependency updates
- Eliminated new `HttpClient` instantiation for every API call

#### ⚠️Breaking Changes

- Renamed `Client` to `GoDaddyClient`
- Constructor now takes `GoDaddyClientOptions` object (.NET Framework 4.6.2+ only)
- Dependency injection pattern with `builder.Services.AddGoDaddy()` registration

### 2.0.0

- Dropped explicit support for .NET Core 2.1
- Updated support to .NET Standard 2.0
- Added support for .NET 6

## Notes

As I have only used the domain features (Suggested Domain, Buy Domain, CheckAvailable, etc.), I haven't tested the other parts of it so feel free to leave an issue if you find something wrong (also welcome to make a pull request). Please provide as much info as you can.

APIs that require a ShopperId require an [API Reseller plan](https://www.godaddy.com/help/what-is-an-api-reseller-plan-5939) and [Good as Gold account](https://www.godaddy.com/help/what-is-good-as-gold-3359)