--- title: "Microsoft .NET Library" slug: "microsoft-net-library" updated: 2024-04-16T11:16:18Z published: 2024-04-16T11:16:17Z 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](/release35/docs/authentication): APIConnector Constructor C# Syntax ApiConnector Connector = new ApiConnector("", ""); You have to pass the endpoint URL (that is the URL of the API [Service](/release35/docs/services)) and the access key. The following constructor can be used if you want to connect using the custom username and password of a [User](/release35/docs/users): APIConnector Constructor C# Syntax ApiConnector Connector = new ApiConnector("", "", ""); NOTE The [User](/release35/docs/users) 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](/release35/docs/methods). 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](/release35/docs/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](/release35/docs/introduction-2) 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);