> ## 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.BLOBAgent

# \<a id="SuperOffice\_WebApi\_Agents\_BLOBAgent">\</a> Class BLOBAgent

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

Collection of all services that works with binary objects (BLOBS), e.g. Images and documents.

```csharp theme={null}
public class BLOBAgent : AgentBase, IBLOBAgent, IAgentBase, IDisposable
```

#### Inheritance

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

#### Implements

[IBLOBAgent](SuperOffice.WebApi.Agents.IBLOBAgent.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 (BLOBAgent agent = new BLOBAgent(mySession))
\{
// call methods on agent here...
}\</code>\</pre>

## Constructors

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

Constructor: Collection of all services that works with binary objects (BLOBS), e.g. Images and documents.

```csharp theme={null}
public BLOBAgent(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\_BLOBAgent\_\_ctor\_SuperOffice\_WebApi\_WebApiOptions\_System\_Net\_Http\_HttpClient\_">\</a> BLOBAgent(WebApiOptions, HttpClient)

Constructor: Collection of all services that works with binary objects (BLOBS), e.g. Images and documents.

```csharp theme={null}
public BLOBAgent(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\_BLOBAgent\_ChangeContactImageAsync\_System\_Int32\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ChangeContactImageAsync(int, int, RequestOptions)

Changes the contact image link. If the Binary object id is 0, any image link is removed from the contact.

```csharp theme={null}
public Task ChangeContactImageAsync(int contactId, int blobId, RequestOptions requestOptions = null)
```

#### Parameters

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

The Contact the image is linked to

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

The Binary object id. If the Binary object id is 0, any image link is removed from the Contact.

`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\_BLOBAgent\_ChangePersonImageAsync\_System\_Int32\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ChangePersonImageAsync(int, int, RequestOptions)

```csharp theme={null}
public Task ChangePersonImageAsync(int personId, int blobId, RequestOptions requestOptions = null)
```

#### Parameters

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

The person the image is linked to

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

The Binary object id. If the Binary object id is 0, any image link is removed from the person.

`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\_BLOBAgent\_ChangeProductImageAsync\_System\_Int32\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ChangeProductImageAsync(int, int, RequestOptions)

```csharp theme={null}
public Task ChangeProductImageAsync(int productId, int blobId, RequestOptions requestOptions = null)
```

#### Parameters

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

The product the image is linked to

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

The Binary object id. If the Binary object id is 0, any image link is removed from the product.

`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\_BLOBAgent\_ChangeProjectImageAsync\_System\_Int32\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> ChangeProjectImageAsync(int, int, RequestOptions)

Changes the project image link. If the Binary object id is 0, any image link is removed from the project.

```csharp theme={null}
public Task ChangeProjectImageAsync(int projectId, int blobId, RequestOptions requestOptions = null)
```

#### Parameters

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

The project the image is linked to

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

The Binary object id. If the Binary object id is 0, any image link is removed from the project.

`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\_BLOBAgent\_CleanupBatchTaskAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CleanupBatchTaskAsync(int, RequestOptions)

Removes the binary objects linked to the batch task, the links themselves and the batch task.

```csharp theme={null}
public Task CleanupBatchTaskAsync(int batchTaskId, RequestOptions requestOptions = null)
```

#### Parameters

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

The ID of the batchtask that created the output data

`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\_BLOBAgent\_CreateDefaultBlobEntityAsync\_SuperOffice\_WebApi\_RequestOptions\_">\</a> CreateDefaultBlobEntityAsync(RequestOptions)

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

```csharp theme={null}
public Task<BlobEntity> CreateDefaultBlobEntityAsync(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)\<[BlobEntity](SuperOffice.WebApi.Data.BlobEntity.md)\&gt;

A blank BlobEntity

### \<a id="SuperOffice\_WebApi\_Agents\_BLOBAgent\_DeleteBlobEntityAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> DeleteBlobEntityAsync(int, RequestOptions)

Deletes the BlobEntity

```csharp theme={null}
public Task DeleteBlobEntityAsync(int blobEntityId, RequestOptions requestOptions = null)
```

#### Parameters

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

The identity of the BlobEntity

`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\_BLOBAgent\_GetBlobEntityAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetBlobEntityAsync(int, RequestOptions)

Gets a specific BlobEntity object.

```csharp theme={null}
public Task<BlobEntity> GetBlobEntityAsync(int blobEntityId, RequestOptions requestOptions = null)
```

#### Parameters

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

The identifier of the BlobEntity 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)\<[BlobEntity](SuperOffice.WebApi.Data.BlobEntity.md)\&gt;

BlobEntity

### \<a id="SuperOffice\_WebApi\_Agents\_BLOBAgent\_GetBlobEntityOnContactAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetBlobEntityOnContactAsync(int, RequestOptions)

Gets the blob entity that represents the contact image binary object.

```csharp theme={null}
public Task<BlobEntity> GetBlobEntityOnContactAsync(int contactId, RequestOptions requestOptions = null)
```

#### Parameters

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

The Contact 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)\<[BlobEntity](SuperOffice.WebApi.Data.BlobEntity.md)\&gt;

BlobEntity object

### \<a id="SuperOffice\_WebApi\_Agents\_BLOBAgent\_GetBlobEntityOnCountryAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetBlobEntityOnCountryAsync(int, RequestOptions)

Gets the blob entity that represents the country flag binary object.

```csharp theme={null}
public Task<BlobEntity> GetBlobEntityOnCountryAsync(int countryId, RequestOptions requestOptions = null)
```

#### Parameters

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

The country 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)\<[BlobEntity](SuperOffice.WebApi.Data.BlobEntity.md)\&gt;

BlobEntity object

### \<a id="SuperOffice\_WebApi\_Agents\_BLOBAgent\_GetBlobEntityOnPersonAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetBlobEntityOnPersonAsync(int, RequestOptions)

Gets the blob entity that represents the person image binary object.

```csharp theme={null}
public Task<BlobEntity> GetBlobEntityOnPersonAsync(int personId, RequestOptions requestOptions = null)
```

#### Parameters

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

The person 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)\<[BlobEntity](SuperOffice.WebApi.Data.BlobEntity.md)\&gt;

BlobEntity object

### \<a id="SuperOffice\_WebApi\_Agents\_BLOBAgent\_GetBlobEntityOnProductAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetBlobEntityOnProductAsync(int, RequestOptions)

Gets the blob entity that represents the product image binary object.

```csharp theme={null}
public Task<BlobEntity> GetBlobEntityOnProductAsync(int productId, RequestOptions requestOptions = null)
```

#### Parameters

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

The product 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)\<[BlobEntity](SuperOffice.WebApi.Data.BlobEntity.md)\&gt;

BlobEntity object

### \<a id="SuperOffice\_WebApi\_Agents\_BLOBAgent\_GetBlobEntityOnProjectAsync\_System\_Int32\_SuperOffice\_WebApi\_RequestOptions\_">\</a> GetBlobEntityOnProjectAsync(int, RequestOptions)

Gets the blob entity that represents the project image binary object.

```csharp theme={null}
public Task<BlobEntity> GetBlobEntityOnProjectAsync(int projectId, RequestOptions requestOptions = null)
```

#### Parameters

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

The project 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)\<[BlobEntity](SuperOffice.WebApi.Data.BlobEntity.md)\&gt;

BlobEntity object

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

Get the binary object as a stream

```csharp theme={null}
public Task<byte[]> GetBlobStreamAsync(int blobEntityId, string returnContentType = "application/octet-stream", RequestOptions requestOptions = null)
```

#### Parameters

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

The ID of the BLOB entity object that refers to the binary data

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

Accept content-type. Default "application/octet-stream". Could also be "application/pdf", "text/plain", "text/html", or "multipart/related"

`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)\<[byte](https://learn.microsoft.com/dotnet/api/system.byte)\[]\&gt;

The binary object as a Stream

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

Returns the chat image that is displayed in chat with a specified maximum size.

```csharp theme={null}
public Task<byte[]> GetChatImageWithSizeAsync(int chatTopicId, int width, int height, string returnContentType = "application/octet-stream", RequestOptions requestOptions = null)
```

#### Parameters

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

The project id of the project the image belongs to.

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

The maximum with of the returned image. Specify \<= 0 to preserve aspect ratio of existing image.

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

The maximum height of the returned image. Specify \<= 0 to preserve aspect ratio of existing image.

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

Accept content-type. Default "application/octet-stream". Could also be "application/pdf", "text/plain", "text/html", or "multipart/related"

`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)\<[byte](https://learn.microsoft.com/dotnet/api/system.byte)\[]\&gt;

The chat image.

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

Returns the contact image that is displayed in the CRM application.

```csharp theme={null}
public Task<byte[]> GetContactImageAsync(int contactId, string returnContentType = "application/octet-stream", RequestOptions requestOptions = null)
```

#### Parameters

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

The contact id of the contact the image belongs to.

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

Accept content-type. Default "application/octet-stream". Could also be "application/pdf", "text/plain", "text/html", or "multipart/related"

`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)\<[byte](https://learn.microsoft.com/dotnet/api/system.byte)\[]\&gt;

The contact image.

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

Returns the contact image that is displayed in the CRM application with a specified maximum size.

```csharp theme={null}
public Task<byte[]> GetContactImageWithSizeAsync(int contactId, int width, int height, string returnContentType = "application/octet-stream", RequestOptions requestOptions = null)
```

#### Parameters

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

The contact id of the Contact the image belongs to.

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

The maximum with of the returned image. Specify \<= 0 to preserve aspect ratio of existing image.

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

The maximum height of the returned image. Specify \<= 0 to preserve aspect ratio of existing image.

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

Accept content-type. Default "application/octet-stream". Could also be "application/pdf", "text/plain", "text/html", or "multipart/related"

`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)\<[byte](https://learn.microsoft.com/dotnet/api/system.byte)\[]\&gt;

The contact image.

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

Get the output of a batchtask as a stream

```csharp theme={null}
public Task<byte[]> GetOutputFromBatchAsync(int batchTaskId, string returnContentType = "application/octet-stream", RequestOptions requestOptions = null)
```

#### Parameters

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

The ID of the batchtask that created the output data

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

Accept content-type. Default "application/octet-stream". Could also be "application/pdf", "text/plain", "text/html", or "multipart/related"

`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)\<[byte](https://learn.microsoft.com/dotnet/api/system.byte)\[]\&gt;

The binary object as a Stream.

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

Returns the person image that is displayed in the CRM application.

```csharp theme={null}
public Task<byte[]> GetPersonImageAsync(int personId, string returnContentType = "application/octet-stream", RequestOptions requestOptions = null)
```

#### Parameters

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

The person id of the person the image belongs to.

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

Accept content-type. Default "application/octet-stream". Could also be "application/pdf", "text/plain", "text/html", or "multipart/related"

`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)\<[byte](https://learn.microsoft.com/dotnet/api/system.byte)\[]\&gt;

The person image.

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

Returns the person image that is displayed in the CRM application with a specified maximum size.

```csharp theme={null}
public Task<byte[]> GetPersonImageWithSizeAsync(int personId, int width, int height, string returnContentType = "application/octet-stream", RequestOptions requestOptions = null)
```

#### Parameters

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

The person id of the person the image belongs to.

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

The maximum with of the returned image. Specify \<= 0 to preserve aspect ratio of existing image.

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

The maximum height of the returned image. Specify \<= 0 to preserve aspect ratio of existing image.

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

Accept content-type. Default "application/octet-stream". Could also be "application/pdf", "text/plain", "text/html", or "multipart/related"

`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)\<[byte](https://learn.microsoft.com/dotnet/api/system.byte)\[]\&gt;

The person image.

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

Returns the product image (rank=1) that is displayed in the CRM application.

```csharp theme={null}
public Task<byte[]> GetProductImageAsync(int productId, string returnContentType = "application/octet-stream", RequestOptions requestOptions = null)
```

#### Parameters

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

The product id of the product the image belongs to.

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

Accept content-type. Default "application/octet-stream". Could also be "application/pdf", "text/plain", "text/html", or "multipart/related"

`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)\<[byte](https://learn.microsoft.com/dotnet/api/system.byte)\[]\&gt;

The product image.

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

Returns the product thumbnail that is displayed in the CRM application.

```csharp theme={null}
public Task<byte[]> GetProductThumbnailAsync(int productId, string returnContentType = "application/octet-stream", RequestOptions requestOptions = null)
```

#### Parameters

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

The product id of the product the thumbnail belongs to.

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

Accept content-type. Default "application/octet-stream". Could also be "application/pdf", "text/plain", "text/html", or "multipart/related"

`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)\<[byte](https://learn.microsoft.com/dotnet/api/system.byte)\[]\&gt;

The product thumbnail.

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

Returns the project image that is displayed in the CRM application.

```csharp theme={null}
public Task<byte[]> GetProjectImageAsync(int projectId, string returnContentType = "application/octet-stream", RequestOptions requestOptions = null)
```

#### Parameters

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

The project id of the project the image belongs to.

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

Accept content-type. Default "application/octet-stream". Could also be "application/pdf", "text/plain", "text/html", or "multipart/related"

`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)\<[byte](https://learn.microsoft.com/dotnet/api/system.byte)\[]\&gt;

The project image.

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

Returns the project image that is displayed in the CRM application with a specified maximum size.

```csharp theme={null}
public Task<byte[]> GetProjectImageWithSizeAsync(int projectId, int width, int height, string returnContentType = "application/octet-stream", RequestOptions requestOptions = null)
```

#### Parameters

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

The project id of the project the image belongs to.

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

The maximum with of the returned image. Specify \<= 0 to preserve aspect ratio of existing image.

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

The maximum height of the returned image. Specify \<= 0 to preserve aspect ratio of existing image.

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

Accept content-type. Default "application/octet-stream". Could also be "application/pdf", "text/plain", "text/html", or "multipart/related"

`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)\<[byte](https://learn.microsoft.com/dotnet/api/system.byte)\[]\&gt;

The project image.

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

Returns the quoteline image (rank=1) that is displayed in the CRM application.

```csharp theme={null}
public Task<byte[]> GetQuoteLineImageAsync(int quoteLineId, string returnContentType = "application/octet-stream", RequestOptions requestOptions = null)
```

#### Parameters

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

The product id of the quoteline the image belongs to.

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

Accept content-type. Default "application/octet-stream". Could also be "application/pdf", "text/plain", "text/html", or "multipart/related"

`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)\<[byte](https://learn.microsoft.com/dotnet/api/system.byte)\[]\&gt;

The quote line image.

### \<a id="SuperOffice\_WebApi\_Agents\_BLOBAgent\_SaveBlobEntityAsync\_SuperOffice\_WebApi\_Data\_BlobEntity\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveBlobEntityAsync(BlobEntity, RequestOptions)

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

```csharp theme={null}
public Task<BlobEntity> SaveBlobEntityAsync(BlobEntity blobEntity, RequestOptions requestOptions = null)
```

#### Parameters

`blobEntity` [BlobEntity](SuperOffice.WebApi.Data.BlobEntity.md)

The BlobEntity 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)\<[BlobEntity](SuperOffice.WebApi.Data.BlobEntity.md)\&gt;

New or updated BlobEntity

### \<a id="SuperOffice\_WebApi\_Agents\_BLOBAgent\_SaveImageStreamAsync\_SuperOffice\_WebApi\_Data\_BlobLinkType\_System\_Byte\_\_\_System\_String\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveImageStreamAsync(BlobLinkType, byte\[], string, RequestOptions)

Stores an image in the database without linking it to a project or a person. It is possible to ChangePersonImage or ChangeProjectImage to attach image later.

```csharp theme={null}
public Task<int> SaveImageStreamAsync(BlobLinkType type, byte[] image, string description, RequestOptions requestOptions = null)
```

#### Parameters

`type` [BlobLinkType](SuperOffice.WebApi.Data.BlobLinkType.md)

The type of the image.

`image` [byte](https://learn.microsoft.com/dotnet/api/system.byte)\[]

Image to store.

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

Image description.

`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;

The blob id.

### \<a id="SuperOffice\_WebApi\_Agents\_BLOBAgent\_SaveProjectImageAsync\_System\_String\_System\_Byte\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SaveProjectImageAsync(string, byte\[], RequestOptions)

Saves a project image that is displayed in the CRM application's project image selection dialog to the database.

```csharp theme={null}
public Task SaveProjectImageAsync(string description, byte[] image, RequestOptions requestOptions = null)
```

#### Parameters

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

Image description. Should be image name (e.g. winter.jpg) for project images.

`image` [byte](https://learn.microsoft.com/dotnet/api/system.byte)\[]

The project image.

`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\_BLOBAgent\_SetBlobStreamAsync\_System\_Int32\_System\_Byte\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SetBlobStreamAsync(int, byte\[], RequestOptions)

Store a binary object from it's stream

```csharp theme={null}
public Task SetBlobStreamAsync(int blobEntityId, byte[] stream, RequestOptions requestOptions = null)
```

#### Parameters

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

Id of the BLOB entity object that the binary data should be stored to.

`stream` [byte](https://learn.microsoft.com/dotnet/api/system.byte)\[]

The binary object as a Stream

`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\_BLOBAgent\_SetContactImageAsync\_System\_Int32\_System\_Byte\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SetContactImageAsync(int, byte\[], RequestOptions)

Stores the contact image that is displayed in the CRM application.

```csharp theme={null}
public Task SetContactImageAsync(int contactId, byte[] image, RequestOptions requestOptions = null)
```

#### Parameters

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

The contact id of the contact the image belongs to.

`image` [byte](https://learn.microsoft.com/dotnet/api/system.byte)\[]

The contact image.

`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\_BLOBAgent\_SetPersonImageAsync\_System\_Int32\_System\_Byte\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SetPersonImageAsync(int, byte\[], RequestOptions)

Stores the person image that is displayed in the CRM application.

```csharp theme={null}
public Task SetPersonImageAsync(int personId, byte[] image, RequestOptions requestOptions = null)
```

#### Parameters

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

The person id of the person the image belongs to.

`image` [byte](https://learn.microsoft.com/dotnet/api/system.byte)\[]

The person image.

`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\_BLOBAgent\_SetProductImageAsync\_System\_Int32\_System\_Byte\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SetProductImageAsync(int, byte\[], RequestOptions)

Stores the product image that is displayed in the CRM application. The image is scaled down to max 1000x1000. This method operates only the main (rank=1) image; future extensions may support multiple images. A thumbnail of size 75x75 is also automatically set.

```csharp theme={null}
public Task SetProductImageAsync(int productId, byte[] image, RequestOptions requestOptions = null)
```

#### Parameters

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

The product id of the product the image belongs to.

`image` [byte](https://learn.microsoft.com/dotnet/api/system.byte)\[]

The product image, scaled down to no more than 1000x1000.

`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\_BLOBAgent\_SetProductThumbnailAsync\_System\_Int32\_System\_Byte\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SetProductThumbnailAsync(int, byte\[], RequestOptions)

Stores the product thumbnail that is displayed in the CRM application. The image is scaled down to max 200x200 pixels.

```csharp theme={null}
public Task SetProductThumbnailAsync(int productId, byte[] image, RequestOptions requestOptions = null)
```

#### Parameters

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

The product id of the product the image belongs to.

`image` [byte](https://learn.microsoft.com/dotnet/api/system.byte)\[]

The product thumbnail, scaled down to no more than 200x200.

`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\_BLOBAgent\_SetProjectImageAsync\_System\_Int32\_System\_Byte\_\_\_SuperOffice\_WebApi\_RequestOptions\_">\</a> SetProjectImageAsync(int, byte\[], RequestOptions)

Stores the project image that is displayed in the CRM application.

```csharp theme={null}
public Task SetProjectImageAsync(int projectId, byte[] image, RequestOptions requestOptions = null)
```

#### Parameters

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

The project id of the project the image belongs to.

`image` [byte](https://learn.microsoft.com/dotnet/api/system.byte)\[]

The project image.

`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)


## Related topics

- [SuperOffice.WebApi.Data.BlobEntity](/en/api/reference/webapi/SuperOffice.WebApi.Data.BlobEntity.md)
- [SuperOffice.WebApi.Agents.AgentBase](/en/api/reference/webapi/SuperOffice.WebApi.Agents.AgentBase.md)
- [SuperOffice.WebApi.Agents.EMailAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.EMailAgent.md)
- [SuperOffice.WebApi.Agents.IEMailAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.IEMailAgent.md)
- [SuperOffice.WebApi.Agents.IListAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.IListAgent.md)
- [SuperOffice.WebApi.Agents.ListAgent](/en/api/reference/webapi/SuperOffice.WebApi.Agents.ListAgent.md)
