GodaddyWrapper.NET is a .NET Wrapper for calling GoDaddy REST API.
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);
}
Program.cs / Startup.cs
builder.Services.AddGoDaddy(
configuration.GoDaddyAccessKey,
configuration.GoDaddySecretKey,
configuration.Sandbox);
Service Class (or controller)
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);
}
- JSON Updates (#48 by @dlmelendez)
- Various dependency updates
- Eliminated new
HttpClient
instantiation for every API call
- Renamed
Client
toGoDaddyClient
- Constructor now takes
GoDaddyClientOptions
object (.NET Framework 4.6.2+ only) - Dependency injection pattern with
builder.Services.AddGoDaddy()
registration
- Dropped explicit support for .NET Core 2.1
- Updated support to .NET Standard 2.0
- Added support for .NET 6
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.