GodaddyWrapper.NET is a .NET Wrapper for calling GoDaddy REST API.
$ dotnet add package GodaddyWrapperGodaddyWrapper.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);
}
HttpClient instantiation for every API callClient to GoDaddyClientGoDaddyClientOptions object (.NET Framework 4.6.2+ only)builder.Services.AddGoDaddy() registrationAs 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.