Skip to content
This repository was archived by the owner on Apr 6, 2018. It is now read-only.

elizabeth-young/IceWarp.Net

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

74 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

IceWarp.Net

A .net wrapper for the IceWarp API

IceWarp.Net fully implements the IceWarp API RPC calls.

NuGet

PM> Install-Package IceWarp.Net

Usage

string apiUrl = "http://localhost/icewarpapi/";
var api = new IceWarpRpcApi();
Authenticate authenticate = new Authenticate
{
	AuthType = TAuthType.Plain,
	Digest = "",
	Email = "[email protected]",
	Password = "password",
	PersistentLogin = false
};
SuccessResponse authResult = api.Execute(apiUrl, authenticate);

GetSessionInfo sessionInfo = new GetSessionInfo
{
	SessionId = authResult.SessionId
};
TAPISessionInfoResponse sessionInfoResult = api.Execute(apiUrl, sessionInfo);

Logout logout = new Logout
{
	SessionId = authResult.SessionId
};
SuccessResponse logoutResult = api.Execute(apiUrl, logout);

Com objects

Get Properties requests can be converted into objects similar to the Com Objects installed on the server.

IceWarp ServerAPI Reference.

Domain Properties

Create a Domain object from a GetDomainProperties request.

GetDomainProperties getPropertiesRequest = new GetDomainProperties
{
	SessionId = "session id",
            DomainStr = "testing.co.uk",
            DomainPropertyList = new TDomainPropertyList
            {
                Items = ClassHelper.PublicProperites(typeof(Domain)).Select(x => x.Name).ToList()
            }
};
TPropertyValueListResponse getPropertiesResult = api.Execute(apiUrl, getPropertiesRequest);
Domain domain = new Domain(getPropertiesResult.Items);

Create a SetDomainProperties request from a Domain object.

Domain domain = new Domain
{
	D_Description = "description",
	D_AdminEmail = "[email protected]
};
List<TPropertyValue> propertyValues = domain.BuildTPropertyValues();
SetDomainProperties setPropertiesRequest = new SetDomainProperties
{
	SessionId = "session id",
            DomainStr = "testing.co.uk",
            PropertyValueList = new TPropertyValueList
            {
                Items = propertyValues	
            }
};

Create a SetDomainProperties request from specific properties of a Domain object.

Domain domain = new Domain
{
	D_Description = "description",
	D_AdminEmail = "[email protected]
};
List<TPropertyValue> propertyValues = domain.BuildTPropertyValues(new List<string> { "D_Description" });
SetDomainProperties setPropertiesRequest = new SetDomainProperties
{
	SessionId = "session id",
            DomainStr = "testing.co.uk",
            PropertyValueList = new TPropertyValueList
            {
                Items = propertyValues	
            }
};

Account Properties

Server Properties

About

A .net wrapper for the IceWarp API

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 80.0%
  • Pascal 20.0%