> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superoffice.com/llms.txt
> Use this file to discover all available pages before exploring further.

# SuperOffice.WebApi.Agents.MarketingAgent

# \<a id="SuperOffice\_WebApi\_Agents\_MarketingAgent">\</a> Class MarketingAgent

Namespace: [SuperOffice.WebApi.Agents](SuperOffice.WebApi.Agents.md)\
Assembly: SuperOffice.WebApi.dll

Agent used for Marketing functions, such as Forms

```csharp theme={null}
public class MarketingAgent : AgentBase, IMarketingAgent, IAgentBase, IDisposable
```

#### Inheritance

[object](https://learn.microsoft.com/dotnet/api/system.object) ←
[AgentBase](SuperOffice.WebApi.Agents.AgentBase.md) ←
[MarketingAgent](SuperOffice.WebApi.Agents.MarketingAgent.md)

#### Implements

[IMarketingAgent](SuperOffice.WebApi.Agents.IMarketingAgent.md),
[IAgentBase](SuperOffice.WebApi.Agents.IAgentBase.md),
[IDisposable](https://learn.microsoft.com/dotnet/api/system.idisposable)

#### Inherited Members

[AgentBase.\_json](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase__json),
[AgentBase.\_binary](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase__binary),
[AgentBase.\_config](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase__config),
[AgentBase.\_client](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase__client),
[AgentBase.\_disposeClient](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase__disposeClient),
[AgentBase.Merge(RequestOptions)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_Merge_SuperOffice_WebApi_RequestOptions_),
[AgentBase.BuildRequestFromObject(HttpMethod, string, object, WebApiOptions, string)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_BuildRequestFromObject_System_Net_Http_HttpMethod_System_String_System_Object_SuperOffice_WebApi_WebApiOptions_System_String_),
[AgentBase.BuildRequestFromStream(HttpMethod, string, Stream, WebApiOptions, string)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_BuildRequestFromStream_System_Net_Http_HttpMethod_System_String_System_IO_Stream_SuperOffice_WebApi_WebApiOptions_System_String_),
[AgentBase.BuildRequestFromObjectWithStream(HttpMethod, string, object, Stream, WebApiOptions, string)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_BuildRequestFromObjectWithStream_System_Net_Http_HttpMethod_System_String_System_Object_System_IO_Stream_SuperOffice_WebApi_WebApiOptions_System_String_),
[AgentBase.ParseAuthorization(IAuthorization)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_ParseAuthorization_SuperOffice_WebApi_Authorization_IAuthorization_),
[AgentBase.CancelRequest()](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_CancelRequest),
[AgentBase.SendRequestObject(HttpMethod, string, object, WebApiOptions, string)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_SendRequestObject_System_Net_Http_HttpMethod_System_String_System_Object_SuperOffice_WebApi_WebApiOptions_System_String_),
[AgentBase.SendRequestObjectWithStream(HttpMethod, string, object, Stream, WebApiOptions, string)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_SendRequestObjectWithStream_System_Net_Http_HttpMethod_System_String_System_Object_System_IO_Stream_SuperOffice_WebApi_WebApiOptions_System_String_),
[AgentBase.SendRequest(HttpRequestMessage, RequestOptions)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_SendRequest_System_Net_Http_HttpRequestMessage_SuperOffice_WebApi_RequestOptions_),
[AgentBase.ThrowOnResponseErrorAsync(HttpRequestMessage, HttpResponseMessage)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_ThrowOnResponseErrorAsync_System_Net_Http_HttpRequestMessage_System_Net_Http_HttpResponseMessage_),
[AgentBase.ParseResponse\<T\&gt;(HttpResponseMessage)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_ParseResponse__1_System_Net_Http_HttpResponseMessage_),
[AgentBase.Finally(RequestOptions)](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_Finally_SuperOffice_WebApi_RequestOptions_),
[AgentBase.Dispose()](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_Dispose),
[AgentBase.Configuration](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_Configuration),
[AgentBase.Client](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_Client),
[AgentBase.HasRunningRequest](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_HasRunningRequest),
[AgentBase.ClientCancellationTokenSource](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_ClientCancellationTokenSource),
[AgentBase.ProgressListener](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_ProgressListener),
[AgentBase.UploadProgressListener](SuperOffice.WebApi.Agents.AgentBase.md#SuperOffice_WebApi_Agents_AgentBase_UploadProgressListener),
[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring),
[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object\)),
[object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals\(system-object-system-object\)),
[object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals),
[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode),
[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype),
[object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone)

## Examples

\<pre>\<code class="lang-csharp">using SuperOffice.WebApi;
using SuperOffice.WebApi.Agents;

var mySession = new WebApiOptions("[http://example.com/super/api](http://example.com/super/api)");
mySession.Authorization = new AuthorizationUsernamePassword("user", "pass");
using (MarketingAgent agent = new MarketingAgent(mySession))
\{
// call methods on agent here...
}\</code>\</pre>

## Constructors

### \<a id="SuperOffice\_WebApi\_Agents\_MarketingAgent\_\_ctor\_System\_Net\_Http\_HttpClient\_">\</a> MarketingAgent(HttpClient)

Constructor: Agent used for Marketing functions, such as Forms

```csharp theme={null}
public MarketingAgent(HttpClient httpClient)
```

#### Parameters

`httpClient` [HttpClient](https://learn.microsoft.com/dotnet/api/system.net.http.httpclient)

Use this HTTP client instead of making own HttpClient instance.

### \<a id="SuperOffice\_WebApi\_Agents\_MarketingAgent\_\_ctor\_SuperOffice\_WebApi\_WebApiOptions\_System\_Net\_Http\_HttpClient\_">\</a> MarketingAgent(WebApiOptions, HttpClient)

Constructor: Agent used for Marketing functions, such as Forms

```csharp theme={null}
public MarketingAgent(WebApiOptions options, HttpClient httpClient = null)
```

#### Parameters

`options` [WebApiOptions](SuperOffice.WebApi.WebApiOptions.md)

Base URL and authentication values.

`httpClient` [HttpClient](https://learn.microsoft.com/dotnet/api/system.net.http.httpclient)

Optional: Use this HTTP client instead of making a new one.

## Methods

### \<a id="SuperOffice\_WebApi\_Agents\_MarketingAgent\_CalculateMailingStatisticsAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CalculateMailingStatisticsAsync(int, RequestOptions)

Calculate open and click rates for one or more mailings

```csharp theme={null}
public Task<int> CalculateMailingStatisticsAsync(int shipmentId, RequestOptions requestOptions = null)
```

#### Parameters

`shipmentId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

If 0, calculate rates for all dirty (are\_statistics\_dirty) shipments

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[int](https://learn.microsoft.com/dotnet/api/system.int32)\&gt;

Number of shipments updated with calculated statistics

### \<a id="SuperOffice\_WebApi\_Agents\_MarketingAgent\_CreateDefaultAvailableFontAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultAvailableFontAsync(RequestOptions)

Create an return an empty font

```csharp theme={null}
public Task<AvailableFont> CreateDefaultAvailableFontAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[AvailableFont](SuperOffice.WebApi.Data.AvailableFont.md)\&gt;

Returns the created default font

### \<a id="SuperOffice\_WebApi\_Agents\_MarketingAgent\_CreateDefaultFormEntityAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultFormEntityAsync(RequestOptions)

Set default values into a new FormEntity.
NetServer calculates default values on the entity, which is required when creating/storing a new instance

```csharp theme={null}
public Task<FormEntity> CreateDefaultFormEntityAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[FormEntity](SuperOffice.WebApi.Data.FormEntity.md)\&gt;

A blank FormEntity

### \<a id="SuperOffice\_WebApi\_Agents\_MarketingAgent\_CreateDefaultFormSubmissionEntityAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultFormSubmissionEntityAsync(RequestOptions)

Set default values into a new FormSubmissionEntity.
NetServer calculates default values on the entity, which is required when creating/storing a new instance

```csharp theme={null}
public Task<FormSubmissionEntity> CreateDefaultFormSubmissionEntityAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[FormSubmissionEntity](SuperOffice.WebApi.Data.FormSubmissionEntity.md)\&gt;

A blank FormSubmissionEntity

### \<a id="SuperOffice\_WebApi\_Agents\_MarketingAgent\_CreateDefaultShipmentMessageBlockEntityAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultShipmentMessageBlockEntityAsync(RequestOptions)

Set default values into a new ShipmentMessageBlockEntity.
NetServer calculates default values on the entity, which is required when creating/storing a new instance

```csharp theme={null}
public Task<ShipmentMessageBlockEntity> CreateDefaultShipmentMessageBlockEntityAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ShipmentMessageBlockEntity](SuperOffice.WebApi.Data.ShipmentMessageBlockEntity.md)\&gt;

A blank ShipmentMessageBlockEntity

### \<a id="SuperOffice\_WebApi\_Agents\_MarketingAgent\_CreateDefaultShipmentMessageEntityAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultShipmentMessageEntityAsync(RequestOptions)

Set default values into a new ShipmentMessageEntity.
NetServer calculates default values on the entity, which is required when creating/storing a new instance

```csharp theme={null}
public Task<ShipmentMessageEntity> CreateDefaultShipmentMessageEntityAsync(RequestOptions requestOptions = null)
```

#### Parameters

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ShipmentMessageEntity](SuperOffice.WebApi.Data.ShipmentMessageEntity.md)\&gt;

A blank ShipmentMessageEntity

### \<a id="SuperOffice\_WebApi\_Agents\_MarketingAgent\_DeleteAvailableFontAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeleteAvailableFontAsync(int, RequestOptions)

Delete the font with the provided id

```csharp theme={null}
public Task<bool> DeleteAvailableFontAsync(int availableFontId, RequestOptions requestOptions = null)
```

#### Parameters

`availableFontId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The id of the font to delete

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[bool](https://learn.microsoft.com/dotnet/api/system.boolean)\&gt;

Returns true if the font was deleted

### \<a id="SuperOffice\_WebApi\_Agents\_MarketingAgent\_DeleteFormEntityAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeleteFormEntityAsync(int, RequestOptions)

Deletes the FormEntity

```csharp theme={null}
public Task DeleteFormEntityAsync(int formEntityId, RequestOptions requestOptions = null)
```

#### Parameters

`formEntityId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The identity of the FormEntity

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### \<a id="SuperOffice\_WebApi\_Agents\_MarketingAgent\_DeleteFormSubmissionEntityAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeleteFormSubmissionEntityAsync(int, RequestOptions)

Deletes the FormSubmissionEntity

```csharp theme={null}
public Task DeleteFormSubmissionEntityAsync(int formSubmissionEntityId, RequestOptions requestOptions = null)
```

#### Parameters

`formSubmissionEntityId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The identity of the FormSubmissionEntity

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### \<a id="SuperOffice\_WebApi\_Agents\_MarketingAgent\_DeleteMessageAndShipmentAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeleteMessageAndShipmentAsync(int, RequestOptions)

Delete the message and the shipment the message (MessageId) belongs to

```csharp theme={null}
public Task DeleteMessageAndShipmentAsync(int messageId, RequestOptions requestOptions = null)
```

#### Parameters

`messageId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Message id

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### \<a id="SuperOffice\_WebApi\_Agents\_MarketingAgent\_DeleteShipmentMessageBlockEntityAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeleteShipmentMessageBlockEntityAsync(int, RequestOptions)

Deletes the ShipmentMessageBlockEntity

```csharp theme={null}
public Task DeleteShipmentMessageBlockEntityAsync(int shipmentMessageBlockEntityId, RequestOptions requestOptions = null)
```

#### Parameters

`shipmentMessageBlockEntityId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The identity of the ShipmentMessageBlockEntity

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### \<a id="SuperOffice\_WebApi\_Agents\_MarketingAgent\_DeleteShipmentMessageEntityAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeleteShipmentMessageEntityAsync(int, RequestOptions)

Deletes the ShipmentMessageEntity

```csharp theme={null}
public Task DeleteShipmentMessageEntityAsync(int shipmentMessageEntityId, RequestOptions requestOptions = null)
```

#### Parameters

`shipmentMessageEntityId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The identity of the ShipmentMessageEntity

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### \<a id="SuperOffice\_WebApi\_Agents\_MarketingAgent\_GetAvailableFontAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetAvailableFontAsync(int, RequestOptions)

Get an available font by id

```csharp theme={null}
public Task<AvailableFont> GetAvailableFontAsync(int availableFontId, RequestOptions requestOptions = null)
```

#### Parameters

`availableFontId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The id of the font to retrieve

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[AvailableFont](SuperOffice.WebApi.Data.AvailableFont.md)\&gt;

Returns the requested font or null if it does not exist

### \<a id="SuperOffice\_WebApi\_Agents\_MarketingAgent\_GetFormEntityAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetFormEntityAsync(int, RequestOptions)

Gets a specific FormEntity object.

```csharp theme={null}
public Task<FormEntity> GetFormEntityAsync(int formEntityId, RequestOptions requestOptions = null)
```

#### Parameters

`formEntityId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The identifier of the FormEntity object

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[FormEntity](SuperOffice.WebApi.Data.FormEntity.md)\&gt;

FormEntity

### \<a id="SuperOffice\_WebApi\_Agents\_MarketingAgent\_GetFormSubmissionEntityAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetFormSubmissionEntityAsync(int, RequestOptions)

Gets a specific FormSubmissionEntity object.

```csharp theme={null}
public Task<FormSubmissionEntity> GetFormSubmissionEntityAsync(int formSubmissionEntityId, RequestOptions requestOptions = null)
```

#### Parameters

`formSubmissionEntityId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The identifier of the FormSubmissionEntity object

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[FormSubmissionEntity](SuperOffice.WebApi.Data.FormSubmissionEntity.md)\&gt;

FormSubmissionEntity

### \<a id="SuperOffice\_WebApi\_Agents\_MarketingAgent\_GetFormSubmissionsCountAsync\_System\_Int32\_SuperOffice\_WebApi\_Data\_FormSubmissionStatus\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetFormSubmissionsCountAsync(int, FormSubmissionStatus, RequestOptions)

Get counnt of submissions for given form and status. Count for all forms is returned if negative formId is given

```csharp theme={null}
public Task<int> GetFormSubmissionsCountAsync(int formId, FormSubmissionStatus status, RequestOptions requestOptions = null)
```

#### Parameters

`formId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

If 0 or less, return count for all forms

`status` [FormSubmissionStatus](SuperOffice.WebApi.Data.FormSubmissionStatus.md)

Which status the submissions should have. If Unknown, return count of all statuses

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[int](https://learn.microsoft.com/dotnet/api/system.int32)\&gt;

Number of formsubmissions

### \<a id="SuperOffice\_WebApi\_Agents\_MarketingAgent\_GetPreviewMailingAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetPreviewMailingAsync(int, RequestOptions)

Get a shipment message from its shipment address id

```csharp theme={null}
public Task<PreviewMailing> GetPreviewMailingAsync(int shipmentAddrId, RequestOptions requestOptions = null)
```

#### Parameters

`shipmentAddrId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Shipment address id

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[PreviewMailing](SuperOffice.WebApi.Data.PreviewMailing.md)\&gt;

PreviewMailing

### \<a id="SuperOffice\_WebApi\_Agents\_MarketingAgent\_GetPreviewMailingHeaderAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetPreviewMailingHeaderAsync(int, RequestOptions)

Get a shipment from its shipment id

```csharp theme={null}
public Task<PreviewMailingHeader> GetPreviewMailingHeaderAsync(int shipmentId, RequestOptions requestOptions = null)
```

#### Parameters

`shipmentId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Shipment id

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[PreviewMailingHeader](SuperOffice.WebApi.Data.PreviewMailingHeader.md)\&gt;

PreviewMailingHeader

### \<a id="SuperOffice\_WebApi\_Agents\_MarketingAgent\_GetShipmentMessageBlockEntityAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetShipmentMessageBlockEntityAsync(int, RequestOptions)

Gets a specific ShipmentMessageBlockEntity object.

```csharp theme={null}
public Task<ShipmentMessageBlockEntity> GetShipmentMessageBlockEntityAsync(int shipmentMessageBlockEntityId, RequestOptions requestOptions = null)
```

#### Parameters

`shipmentMessageBlockEntityId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The identifier of the ShipmentMessageBlockEntity object

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ShipmentMessageBlockEntity](SuperOffice.WebApi.Data.ShipmentMessageBlockEntity.md)\&gt;

ShipmentMessageBlockEntity

### \<a id="SuperOffice\_WebApi\_Agents\_MarketingAgent\_GetShipmentMessageEntityAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetShipmentMessageEntityAsync(int, RequestOptions)

Gets a specific ShipmentMessageEntity object.

```csharp theme={null}
public Task<ShipmentMessageEntity> GetShipmentMessageEntityAsync(int shipmentMessageEntityId, RequestOptions requestOptions = null)
```

#### Parameters

`shipmentMessageEntityId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The identifier of the ShipmentMessageEntity object

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ShipmentMessageEntity](SuperOffice.WebApi.Data.ShipmentMessageEntity.md)\&gt;

ShipmentMessageEntity

### \<a id="SuperOffice\_WebApi\_Agents\_MarketingAgent\_GetUserBlocksAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetUserBlocksAsync(int, RequestOptions)

Get the saved user blocks to be used in a shipment/mailing message

```csharp theme={null}
public Task<ShipmentMessageBlockEntity[]> GetUserBlocksAsync(int associateId, RequestOptions requestOptions = null)
```

#### Parameters

`associateId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The associate id to get the user blocks. 0 will get all saved blocks

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ShipmentMessageBlockEntity](SuperOffice.WebApi.Data.ShipmentMessageBlockEntity.md)\[]\&gt;

An array of user blocks

### \<a id="SuperOffice\_WebApi\_Agents\_MarketingAgent\_RenameMailingByMessageIdAsync\_System\_Int32\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> RenameMailingByMessageIdAsync(int, string, RequestOptions)

Change the mailing name (shipment description) that the given message (MessageId) belongs to

```csharp theme={null}
public Task RenameMailingByMessageIdAsync(int messageId, string name, RequestOptions requestOptions = null)
```

#### Parameters

`messageId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

Message id

`name` [string](https://learn.microsoft.com/dotnet/api/system.string)

The new name

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### \<a id="SuperOffice\_WebApi\_Agents\_MarketingAgent\_SaveAvailableFontAsync\_SuperOffice\_WebApi\_Data\_AvailableFont\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveAvailableFontAsync(AvailableFont, RequestOptions)

Saves the font and returns it with correct rank

```csharp theme={null}
public Task<AvailableFont> SaveAvailableFontAsync(AvailableFont font, RequestOptions requestOptions = null)
```

#### Parameters

`font` [AvailableFont](SuperOffice.WebApi.Data.AvailableFont.md)

The font to save

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[AvailableFont](SuperOffice.WebApi.Data.AvailableFont.md)\&gt;

Returns the saved font with correct rank

### \<a id="SuperOffice\_WebApi\_Agents\_MarketingAgent\_SaveFormEntityAsync\_SuperOffice\_WebApi\_Data\_FormEntity\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveFormEntityAsync(FormEntity, RequestOptions)

Updates the existing FormEntity or creates a new FormEntity if the id parameter is 0.

```csharp theme={null}
public Task<FormEntity> SaveFormEntityAsync(FormEntity formEntity, RequestOptions requestOptions = null)
```

#### Parameters

`formEntity` [FormEntity](SuperOffice.WebApi.Data.FormEntity.md)

The FormEntity that is saved.

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[FormEntity](SuperOffice.WebApi.Data.FormEntity.md)\&gt;

New or updated FormEntity

### \<a id="SuperOffice\_WebApi\_Agents\_MarketingAgent\_SaveFormSubmissionEntityAsync\_SuperOffice\_WebApi\_Data\_FormSubmissionEntity\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveFormSubmissionEntityAsync(FormSubmissionEntity, RequestOptions)

Updates the existing FormSubmissionEntity or creates a new FormSubmissionEntity if the id parameter is 0.

```csharp theme={null}
public Task<FormSubmissionEntity> SaveFormSubmissionEntityAsync(FormSubmissionEntity formSubmissionEntity, RequestOptions requestOptions = null)
```

#### Parameters

`formSubmissionEntity` [FormSubmissionEntity](SuperOffice.WebApi.Data.FormSubmissionEntity.md)

The FormSubmissionEntity that is saved.

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[FormSubmissionEntity](SuperOffice.WebApi.Data.FormSubmissionEntity.md)\&gt;

New or updated FormSubmissionEntity

### \<a id="SuperOffice\_WebApi\_Agents\_MarketingAgent\_SaveShipmentMessageBlockEntityAsync\_SuperOffice\_WebApi\_Data\_ShipmentMessageBlockEntity\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveShipmentMessageBlockEntityAsync(ShipmentMessageBlockEntity, RequestOptions)

Updates the existing ShipmentMessageBlockEntity or creates a new ShipmentMessageBlockEntity if the id parameter is 0.

```csharp theme={null}
public Task<ShipmentMessageBlockEntity> SaveShipmentMessageBlockEntityAsync(ShipmentMessageBlockEntity shipmentMessageBlockEntity, RequestOptions requestOptions = null)
```

#### Parameters

`shipmentMessageBlockEntity` [ShipmentMessageBlockEntity](SuperOffice.WebApi.Data.ShipmentMessageBlockEntity.md)

The ShipmentMessageBlockEntity that is saved.

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ShipmentMessageBlockEntity](SuperOffice.WebApi.Data.ShipmentMessageBlockEntity.md)\&gt;

New or updated ShipmentMessageBlockEntity

### \<a id="SuperOffice\_WebApi\_Agents\_MarketingAgent\_SaveShipmentMessageEntityAsync\_SuperOffice\_WebApi\_Data\_ShipmentMessageEntity\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveShipmentMessageEntityAsync(ShipmentMessageEntity, RequestOptions)

Updates the existing ShipmentMessageEntity or creates a new ShipmentMessageEntity if the id parameter is 0.

```csharp theme={null}
public Task<ShipmentMessageEntity> SaveShipmentMessageEntityAsync(ShipmentMessageEntity shipmentMessageEntity, RequestOptions requestOptions = null)
```

#### Parameters

`shipmentMessageEntity` [ShipmentMessageEntity](SuperOffice.WebApi.Data.ShipmentMessageEntity.md)

The ShipmentMessageEntity that is saved.

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[ShipmentMessageEntity](SuperOffice.WebApi.Data.ShipmentMessageEntity.md)\&gt;

New or updated ShipmentMessageEntity

### \<a id="SuperOffice\_WebApi\_Agents\_MarketingAgent\_SetAllFormFieldRestrictionsAsync\_SuperOffice\_WebApi\_Data\_FormFieldRestriction\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SetAllFormFieldRestrictionsAsync(FormFieldRestriction\[], RequestOptions)

Sets the list of form field restrictions. Note: This list is the conclusion of what should exist in the table. Restrictions that already exists in the table are edited, new ones are added, and if they are not in this list, they will be deleted

```csharp theme={null}
public Task SetAllFormFieldRestrictionsAsync(FormFieldRestriction[] formFieldRestrictions, RequestOptions requestOptions = null)
```

#### Parameters

`formFieldRestrictions` [FormFieldRestriction](SuperOffice.WebApi.Data.FormFieldRestriction.md)\[]

All the restrictions to set. Restrictions not included, will be deleted

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task)

### \<a id="SuperOffice\_WebApi\_Agents\_MarketingAgent\_SetFontRankAsync\_System\_Int32\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SetFontRankAsync(int, int, RequestOptions)

Set the rank on the font and reorder the rest of the fonts accordingly

```csharp theme={null}
public Task<bool> SetFontRankAsync(int availableFontId, int rank, RequestOptions requestOptions = null)
```

#### Parameters

`availableFontId` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The id of the available font to set the rank on

`rank` [int](https://learn.microsoft.com/dotnet/api/system.int32)

The new rank to set on the font

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[bool](https://learn.microsoft.com/dotnet/api/system.boolean)\&gt;

Returns true if the new rank on the font and surrounding reranks went well

### \<a id="SuperOffice\_WebApi\_Agents\_MarketingAgent\_VerifyGoogleRecaptchaAsync\_System\_String\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> VerifyGoogleRecaptchaAsync(string, string, RequestOptions)

This method will try to verify a Google recaptcha token. The token is gained from the recaptcha frontend component

```csharp theme={null}
public Task<bool> VerifyGoogleRecaptchaAsync(string token, string optionalSecretKey, RequestOptions requestOptions = null)
```

#### Parameters

`token` [string](https://learn.microsoft.com/dotnet/api/system.string)

The token to be verified

`optionalSecretKey` [string](https://learn.microsoft.com/dotnet/api/system.string)

Use an optional secret key instead of the system wide

`requestOptions` [RequestOptions](SuperOffice.WebApi.RequestOptions.md)

Override language/culture codes on this request.

#### Returns

[Task](https://learn.microsoft.com/dotnet/api/system.threading.tasks.task-1)\<[bool](https://learn.microsoft.com/dotnet/api/system.boolean)\&gt;

Returns true if the recaptcha token verified successfully


## Related topics

- [SuperOffice.WebApi.Data.FormEntity](/en/api/reference/webapi/SuperOffice.WebApi.Data.FormEntity.md)
- [SuperOffice.WebApi.Data.AvailableFont](/en/api/reference/webapi/SuperOffice.WebApi.Data.AvailableFont.md)
- [SuperOffice.WebApi.Data.PreviewMailing](/en/api/reference/webapi/SuperOffice.WebApi.Data.PreviewMailing.md)
- [SuperOffice.WebApi.Data.MailingStatistics](/en/api/reference/webapi/SuperOffice.WebApi.Data.MailingStatistics.md)
- [SuperOffice.WebApi.Data.FormFieldRestriction](/en/api/reference/webapi/SuperOffice.WebApi.Data.FormFieldRestriction.md)
- [SuperOffice.WebApi.Data.FormSubmissionEntity](/en/api/reference/webapi/SuperOffice.WebApi.Data.FormSubmissionEntity.md)
