MAIL Developer Overview
In this article we will look at MAIL from a developers perspective and provide you with the overview and references you need to get started.
Before getting started
In this concept article you can find an overview of MAIL, delving into its fundamental concepts and detailing its key features. If you haven't already, we highly recommend reading it.
API overview
MAIL is composed of a REST API that includes endpoints concerning mails, attachments, policies, providers, settings, and so forth. For a complete list of endpoints and models, refer to the Swagger API documentation.
Preview API
The API also provides a preview version where new functionality can be tested. However, be aware that this preview version may include features that are still under development and subject to change. As such, it is not recommended for use in production environments. Use it primarily for testing and providing feedback on upcoming features. Read more here.
Using the API
Given a valid authentication token here is an example of getting all mail policies:
Replace the URL with the URL to your environment and replace ...
with the authtoken from the example mentioned above.
Using the Bizzkit .NET SDK
For easy integration with Microsoft .NET, Bizzkit offers SDK packages. These packages include auto-generated Swagger clients and a factory class to simplify authentication. They automate token renewal and provide type-safe methods for the API endpoints.
All SDK package names start with the prefix Bizzkit.Sdk.
, and the SDK packages incorporate the following elements:
- A client factory
- A dedicated client
- Options to configure the client factory
Info
Preview versions are identified as Bizzkit.Sdk.[product].Preview
, such as Bizzkit.Sdk.Iam.Preview
or Bizzkit.Sdk.Pim.Preview
.
To access the Bizzkit NuGet packages in your preferred development environment, you need to reference the Bizzkit Partner feed. You can, for example, do this by adding a nuget.config
file to your project with the following configuration:
This configuration clears existing package sources and adds the Bizzkit Partner feed alongside the official NuGet source.
Once the feed is configured, you can install the required NuGet package using the following command:
To simplify the authentication process, all NuGet packages associated with Bizzkit applications come with a factory class. This class streamlines the creation of an authenticated Swagger-generated client.
Example
As noted earlier, the SDK client is mainly an auto-generated client based on the OpenAPI interface, meaning all methods map directly to the API.
Below is an example of calling the ListMailPolicies endpoint using the SDK client (with the factory and client already created):
Warning
Please keep in mind that all examples provided are for illustrative purposes only. They are not intended to represent best practices and should not be used in production without a thorough code review.