--- title: "Microsoft .NET Library" slug: "microsoft-net-library" updated: 2023-12-13T10:25:46Z published: 2023-12-13T10:25:46Z canonical: "help.mail-and-deploy.com/microsoft-net-library" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.mail-and-deploy.com/llms.txt > Use this file to discover all available pages before exploring further. # Microsoft .NET Library ### General This library can be used in .NET projects (C#, Visual Basic .NET, etc.) to connect to the API. It consists of two files that need to be referenced which are both located in the SDK\Library folder of the root installation directory: - MailAndDeploy.Api.Client.dll - MailAndDeploy.Interop.dll The file Newtonsoft.Json.dll located in the same directory needs to be published alongside the assemblies specified above. ### Connecting to the API The connection to the API can be established using an instance of the class MailAndDeploy.Api.Client.ApiConnector for which to constructors are available. The following constructor can be used if you want to connect to the API using access key Authentication: APIConnector Constructor C# Syntax ApiConnector Connector = new ApiConnector("", ""); You have to pass the endpoint URL (that is the URL of the API Service) and the access key. The following constructor can be used if you want to connect using the custom username and password of a User: APIConnector Constructor C# Syntax ApiConnector Connector = new ApiConnector("", "", ""); NOTE The User whose access key or custom username and password you provide needs be of type API User or Administrator. ### Making API Calls The instantiated ApiConnector can then be used to perform API calls; the object has methods for every available API Method. If an API call fails, an ApiException which has a property named ApiResponse that exposes the following properties: | Name | Description | | --- | --- | | RequestUrl | The request URL used to perform the API call. | | RequestApiMethod | The name of the API Methods that has been called. | | RequestHttpMethod | The HTTP method (such as GET, POST, or DELETE) that has been used to perform the API call. | | RequestPOSTData | The post data that has been sent with the API call. | | RequestDateTimeUtc | The UTC date-time at which the API call has been made. | | RawData | The serialized raw data that has been returned by the server. | | Content | An IInteropObject (which can be an InteropStructure or InteropStructureCollection) that contains the deserialized response. | | ExceptionStructure | The ExceptionStructure that contains additional information about the exception that has occurred. | | DateTimeUtc | The UTC date-time at which the response has been received. | #### Examples The following example returns a DatasourceStructure that represents the Datasource with ID 947667f3-665b-4246-8073-95de881225b1: GetDatasource Example C# Syntax DatasourceStructure Datasource = Connector.GetDatasource(new Guid("947667f3-665b-4246-8073-95de881225b1")); The following code changes the name of the queried datasource to MyDatasource and then persists it: Persist Example C# Syntax yDatasource.Name = "MyDatasource"; Connector.Persist(Datasource);