Class NSBLOBAgent

Collection of all services that work with binary objects (BLOBS). For example, images and documents.

Examples

NSBLOBAgent agent;
agent.callMethod(arg1, arg2);

Constructors

NSBLOBAgent()

Initializes a new instance of the NSBLOBAgent class.

Declaration

NSBLOBAgent

Examples

NSBLOBAgent agent;
agent.callMethod(arg1, arg2);

Methods

ChangeContactImage(Integer,Integer)

Changes the contact image link.

Declaration

Void ChangeContactImage(Integer contactId, Integer blobId)

Parameters

Type Name Description
Integer contactId The contact the image is linked to
Integer blobId The Binary object ID.

Returns

Type Description
Void

ChangePersonImage(Integer,Integer)

Declaration

Void ChangePersonImage(Integer personId, Integer blobId)

Parameters

Type Name Description
Integer personId The person the image is linked to
Integer blobId The Binary object ID.

Returns

Type Description
Void

ChangeProductImage(Integer,Integer)

Changes the project image link.

Declaration

Void ChangeProductImage(Integer productId, Integer blobId)

Parameters

Type Name Description
Integer productId The project the image is linked to
Integer blobId The Binary object Id.

Returns

Type Description
Void

ChangeProjectImage(Integer,Integer)

Changes the project image link.

Declaration

Void ChangeProjectImage(Integer projectId, Integer blobId)

Parameters

Type Name Description
Integer projectId
Integer blobId The Binary object Id.

Returns

Type Description
Void

CleanupBatchTask(Integer)

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

Declaration

Void CleanupBatchTask(Integer batchTaskId)

Parameters

Type Name Description
Integer batchTaskId

Returns

Type Description
Void

CreateDefaultBlobEntity()

Sets default values into a new NSBlobEntity.

Declaration

NSBlobEntity CreateDefaultBlobEntity()

Examples

NSBLOBAgent agent;
NSBlobEntity thing = agent.CreateDefaultBlobEntity();
thing = agent.SaveBlobEntity(thing);

Returns

Type Description
NSBlobEntity New BlobEntity with default values.

DeleteBlobEntity(Integer)

Deletes the NSBlobEntity

Declaration

Void DeleteBlobEntity(Integer blobEntity)

Examples

NSBLOBAgent agent;
agent.DeleteBlobEntity(123);

Parameters

Type Name Description
Integer blobEntity The identity of the BlobEntity.

Returns

Type Description
Void

GetAppData(String)

Gets a CLOB (limited to a reasonable size by the mechanics of Web Services) according to a string key; ALSO limits to the current ApplicationToken if any

Declaration

String GetAppData(String key)

Examples

NSBLOBAgent agent;
String key;
String res = agent.GetAppData(key);

Parameters

Type Name Description
String key The key string, less than 200 characters. Must be unique within each application.

Returns

Type Description
String The applications value, suggested to be a JSON, XML or other readable structure.

GetBlobEntity(Integer)

Gets an NSBlobEntity object.

Declaration

NSBlobEntity GetBlobEntity(Integer blobEntityId)

Examples

NSBLOBAgent agent;
NSBlobEntity thing = agent.GetBlobEntity(123);

Parameters

Type Name Description
Integer blobEntityId The identifier of the BlobEntity object.

Returns

Type Description
NSBlobEntity BlobEntity object.

GetBlobEntityOnContact(Integer)

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

Declaration

NSBlobEntity GetBlobEntityOnContact(Integer contactId)

Examples

NSBLOBAgent agent;
Integer contactId;
NSBlobEntity res = agent.GetBlobEntityOnContact(contactId);

Parameters

Type Name Description
Integer contactId The contact Id.

Returns

Type Description
NSBlobEntity BlobEntity object.

GetBlobEntityOnCountry(Integer)

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

Declaration

NSBlobEntity GetBlobEntityOnCountry(Integer countryId)

Examples

NSBLOBAgent agent;
Integer countryId;
NSBlobEntity res = agent.GetBlobEntityOnCountry(countryId);

Parameters

Type Name Description
Integer countryId The country Id.

Returns

Type Description
NSBlobEntity BlobEntity object.

GetBlobEntityOnPerson(Integer)

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

Declaration

NSBlobEntity GetBlobEntityOnPerson(Integer personId)

Examples

NSBLOBAgent agent;
Integer personId;
NSBlobEntity res = agent.GetBlobEntityOnPerson(personId);

Parameters

Type Name Description
Integer personId The person Id.

Returns

Type Description
NSBlobEntity BlobEntity object.

GetBlobEntityOnProduct(Integer)

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

Declaration

NSBlobEntity GetBlobEntityOnProduct(Integer productId)

Examples

NSBLOBAgent agent;
Integer productId;
NSBlobEntity res = agent.GetBlobEntityOnProduct(productId);

Parameters

Type Name Description
Integer productId The product Id.

Returns

Type Description
NSBlobEntity BlobEntity object.

GetBlobEntityOnProject(Integer)

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

Declaration

NSBlobEntity GetBlobEntityOnProject(Integer projectId)

Examples

NSBLOBAgent agent;
Integer projectId;
NSBlobEntity res = agent.GetBlobEntityOnProject(projectId);

Parameters

Type Name Description
Integer projectId The project Id.

Returns

Type Description
NSBlobEntity BlobEntity object.

GetBlobStream(Integer)

Gets the binary object as a stream

Declaration

NSStream GetBlobStream(Integer blobEntityId)

Examples

NSBLOBAgent agent;
Integer blobEntityId;
NSStream res = agent.GetBlobStream(blobEntityId);

Parameters

Type Name Description
Integer blobEntityId The ID of the BLOB entity object that refers to the binary data.

Returns

Type Description
NSStream The binary object as a Stream.

GetChatImageWithSize(Integer,Integer,Integer)

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

Declaration

NSImage GetChatImageWithSize(Integer chatTopicId, Integer width, Integer height)

Examples

NSBLOBAgent agent;
Integer chatTopicId;
Integer width;
Integer height;
NSImage res = agent.GetChatImageWithSize(chatTopicId, width, height);

Parameters

Type Name Description
Integer chatTopicId The project ID of the project the image belongs to
Integer width The maximum with of the returned image. Specify <= 0 to preserve aspect ratio of existing image
Integer height The maximum height of the returned image. Specify <= 0 to preserve aspect ratio of existing image.

Returns

Type Description
NSImage The image as a System.Drawing.Image. (If the the image is returned over web services, the stream is returned as a jpeg/base64 encoded string.).

GetContactImage(Integer)

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

Declaration

NSImage GetContactImage(Integer contactId)

Examples

NSBLOBAgent agent;
Integer contactId;
NSImage res = agent.GetContactImage(contactId);

Parameters

Type Name Description
Integer contactId The contact ID of the person the image belongs to.

Returns

Type Description
NSImage The image as a System.Drawing.Image. (If the the image is returned over web services, the stream is returned as a Base64 encoded string.).

GetContactImageWithSize(Integer,Integer,Integer)

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

Declaration

NSImage GetContactImageWithSize(Integer contactId, Integer width, Integer height)

Examples

NSBLOBAgent agent;
Integer contactId;
Integer width;
Integer height;
NSImage res = agent.GetContactImageWithSize(contactId, width, height);

Parameters

Type Name Description
Integer contactId The contact of the person the image belongs to.
Integer width The maximum with of the returned image. Specify <= 0 to preserve aspect ratio of existing image.
Integer height The maximum height of the returned image. Specify <= 0 to preserve aspect ratio of existing image.

Returns

Type Description
NSImage The image as a System.Drawing.Image. (If the the image is returned over web services, the stream is returned as a Base64 encoded string.).

GetOutputFromBatch(Integer)

Gets the output of a batchtask as a stream

Declaration

NSStream GetOutputFromBatch(Integer batchTaskId)

Examples

NSBLOBAgent agent;
Integer batchTaskId;
NSStream res = agent.GetOutputFromBatch(batchTaskId);

Parameters

Type Name Description
Integer batchTaskId

Returns

Type Description
NSStream

GetPersonImage(Integer)

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

Declaration

NSImage GetPersonImage(Integer personId)

Examples

NSBLOBAgent agent;
Integer personId;
NSImage res = agent.GetPersonImage(personId);

Parameters

Type Name Description
Integer personId The person ID of the person the image belongs to.

Returns

Type Description
NSImage The image as a System.Drawing.Image. (If the the image is returned over web services, the stream is returned as a Base64 encoded string.).

GetPersonImageWithSize(Integer,Integer,Integer)

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

Declaration

NSImage GetPersonImageWithSize(Integer personId, Integer width, Integer height)

Examples

NSBLOBAgent agent;
Integer personId;
Integer width;
Integer height;
NSImage res = agent.GetPersonImageWithSize(personId, width, height);

Parameters

Type Name Description
Integer personId The person ID of the person the image belongs to.
Integer width The maximum with of the returned image. Specify <= 0 to preserve aspect ratio of existing image
Integer height The maximum height of the returned image. Specify <= 0 to preserve aspect ratio of existing image

Returns

Type Description
NSImage The image as a System.Drawing.Image. (If the the image is returned over web services, the stream is returned as a Base64 encoded string.).

GetProductImage(Integer)

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

Declaration

NSImage GetProductImage(Integer productId)

Examples

NSBLOBAgent agent;
Integer productId;
NSImage res = agent.GetProductImage(productId);

Parameters

Type Name Description
Integer productId The product ID of the product the image belongs to.

Returns

Type Description
NSImage The image as a System.Drawing.Image. (If the the image is returned over web services, the stream is returned as a Base64 encoded string.).

GetProductThumbnail(Integer)

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

Declaration

NSImage GetProductThumbnail(Integer productId)

Examples

NSBLOBAgent agent;
Integer productId;
NSImage res = agent.GetProductThumbnail(productId);

Parameters

Type Name Description
Integer productId The product ID of the product the thumbnail belongs to.

Returns

Type Description
NSImage The image as a System.Drawing.Image. (If the the image is returned over web services, the stream is returned as a Base64 encoded string.).

GetProjectImage(Integer)

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

Declaration

NSImage GetProjectImage(Integer projectId)

Examples

NSBLOBAgent agent;
Integer projectId;
NSImage res = agent.GetProjectImage(projectId);

Parameters

Type Name Description
Integer projectId The project ID of the project the image belongs to.

Returns

Type Description
NSImage The image as a System.Drawing.Image. (If the the image is returned over web services, the stream is returned as a Base64 encoded string.).

GetProjectImageWithSize(Integer,Integer,Integer)

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

Declaration

NSImage GetProjectImageWithSize(Integer projectId, Integer width, Integer height)

Examples

NSBLOBAgent agent;
Integer projectId;
Integer width;
Integer height;
NSImage res = agent.GetProjectImageWithSize(projectId, width, height);

Parameters

Type Name Description
Integer projectId The project ID of the project the image belongs to.
Integer width The maximum with of the returned image. Specify <= 0 to preserve aspect ratio of existing image
Integer height The maximum height of the returned image. Specify <= 0 to preserve aspect ratio of existing image.

Returns

Type Description
NSImage The image as a System.Drawing.Image. (If the the image is returned over web services, the stream is returned as a Base64 encoded string.).

GetQuoteLineImage(Integer)

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

Declaration

NSImage GetQuoteLineImage(Integer quoteLineId)

Examples

NSBLOBAgent agent;
Integer quoteLineId;
NSImage res = agent.GetQuoteLineImage(quoteLineId);

Parameters

Type Name Description
Integer quoteLineId The product ID of the quoteline the image belongs to.

Returns

Type Description
NSImage The image as a System.Drawing.Image. (If the the image is returned over web services, the stream is returned as a Base64 encoded string.).

SaveBlobEntity(NSBlobEntity)

Updates the existing NSBlobEntity or creates a new NSBlobEntity if the ID parameter is 0.

Declaration

NSBlobEntity SaveBlobEntity(NSBlobEntity blobEntity)

Examples

NSBLOB agent;
NSBlobEntity thing = agent.CreateDefaultBlobEntity();
thing = agent.SaveBlobEntity(thing);

Parameters

Type Name Description
NSBlobEntity blobEntity The entity to save.

Returns

Type Description
NSBlobEntity New or updated BlobEntity.

SaveImageStream(Integer,NSImage,String)

Stores an image in the database without linking it to a project or a person.

Declaration

Integer SaveImageStream(Integer type, NSImage image, String description)

Examples

NSBLOBAgent agent;
Integer type;
NSImage image;
String description;
Integer res = agent.SaveImageStream(type, image, description);

Parameters

Type Name Description
Integer type The type of the image.
NSImage image Image to store
String description Image description.

Returns

Type Description
Integer The blob Id.

SaveProjectImage(String,NSImage)

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

Declaration

Void SaveProjectImage(String description, NSImage image)

Parameters

Type Name Description
String description
NSImage image The project image (System.Drawing.Image).

Returns

Type Description
Void

SetAppData(String,String)

Sets a CLOB (limited to a reasonable size by the mechanics of Web Services) according to a string key; ALSO limits to the current ApplicationToken if any.

Declaration

Void SetAppData(String key, String data)

Examples

NSBLOBAgent agent;
String key;
String data;
agent.SetAppData(key, data);

Parameters

Type Name Description
String key The key string, less than 200 characters. Must be unique within each application.
String data The applications value, suggested to be a JSON, XML or other readable structure.

Returns

Type Description
Void

SetBlobStream(Integer,NSStream)

Stores a binary object from its stream

Declaration

Void SetBlobStream(Integer blobEntityId, NSStream stream)

Parameters

Type Name Description
Integer blobEntityId ID of the BLOB entity object that the binary data should be stored to.
NSStream stream The binary object as a Stream.

Returns

Type Description
Void

SetContactImage(Integer,NSImage)

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

Declaration

Void SetContactImage(Integer contactId, NSImage image)

Parameters

Type Name Description
Integer contactId The ID of the contact the image belongs to.
NSImage image The project image (System.Drawing.Image).

Returns

Type Description
Void

SetPersonImage(Integer,NSImage)

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

Declaration

Void SetPersonImage(Integer personId, NSImage image)

Parameters

Type Name Description
Integer personId The person ID of the person the image belongs to.
NSImage image The project image (System.Drawing.Image).

Returns

Type Description
Void

SetProductImage(Integer,NSImage)

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.

Declaration

Void SetProductImage(Integer productId, NSImage image)

Parameters

Type Name Description
Integer productId The project ID of the product the image belongs to.
NSImage image The project image (System.Drawing.Image), scaled down to no more than 1000x1000.

Returns

Type Description
Void

SetProductThumbnail(Integer,NSImage)

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

Declaration

Void SetProductThumbnail(Integer productId, NSImage image)

Parameters

Type Name Description
Integer productId
NSImage image The project image (System.Drawing.Image).

Returns

Type Description
Void

SetProjectImage(Integer)

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

Declaration

Void SetProjectImage(Integer projectId, NSImage image)

Parameters

Type Name Description
Integer projectId The project ID of the project the image belongs to.
NSImage image The project image (System.Drawing.Image).

Returns

Type Description
Void