Image methods
The SharinPix package provides the Apex class, Image, which includes methods that can be applied when manipulating images on Salesforce.
Methods:
Image Method Example
moveImages
global static List<Object> moveImages(List<String> lstImageIds, String destinationAlbumId)
- Moves one or more images to another album. Note: This method can be used to move a maximun of 50 images at once. Example:
sharinpix.Image.moveImages(new List<String> { 'imageId1', 'imageId2' }, 'destinationAlbumId');
exportAsContentDocument
global void exportAsContentDocument()
- Exports a SharinPix Image to Salesforce as a Content Document. Example:
(new sharinpix.Image('public_id')).exportAsContentDocument();
downloadImages
global static String downloadImages(List<String> imageIds)
- Get a URL that opens a zip including the images. Example:
sharinpix.Utils u = new Sharinpix.Utils();
sharinpix.Image.downloadImages(u.getAlbumImageIds(albumId));
fetchAsBase64
global static String fetchAsBase64(String url)
- Converts an image to base64. Example:
sharinpix.Image.fetchAsBase64('https://app.sharinpix.com/image.png');
restoreImage
global static String restoreImage(String imageId)
- Restores a trashed SharinPix Image. Example:
sharinpix.Image.restoreImage('imageId');
Tip:
The SharinPix package also include the Utils class which provides useful methods that can be used for image, album, tag management and a lot more. For more information about the Utils method, please refer to the article below:
0 Comments
Add your comment