createPresentationContent(presentationContentInput)

Create new presentation content with the provided metadata.

API Version

65.0

Requires Chatter

No

Signature

public static ConnectApi.GenericResponseOutputRepresentation createPresentationContent(ConnectApi.PresentationContentInputRepresentation presentationContentInput)

Parameters

presentationContentInput
Type: ConnectApi.PresentationContentInputRepresentation
Input representation that contains the metadata for the presentation content. The fileId field is not accepted in this Apex representation.

Example

ConnectApi.PresentationContentInputRepresentation input = new ConnectApi.PresentationContentInputRepresentation();
input.contentType = 'PRESENTATION_PDF';
ConnectApi.PresentationInput presentation = new ConnectApi.PresentationInput();
presentation.name = 'PDF Presentation Name';
presentation.id = 'pdf-presentation-id';
presentation.enableDoubleTapZoom = true;
presentation.enablePinchZoom = true;
presentation.playerGesture = 'SWIPEUP';
presentation.activationDate = Date.today();
presentation.deactivationDate = Date.today().addDays(365);
input.presentation = presentation;
input.pages = new List<ConnectApi.PresentationPageInput>();
ConnectApi.PresentationPageInput page1 = new ConnectApi.PresentationPageInput();
page1.pageNumber = 1;
page1.name = 'PDF Page 1 Name';
page1.id = 'pdf-page-name-1';
page1.mandatory = true;
page1.contentDocumentId = '069SB0000048cPDYAY';
page1.activationDate = Date.today();
page1.deactivationDate = Date.today().addDays(365);
ConnectApi.ProductGuidanceRepresentation product1 = new ConnectApi.ProductGuidanceRepresentation();
product1.productId = '1KeYH0000001j2m0AA';
product1.guidanceIds = new List<String>();
product1.guidanceIds.add('guidance-id-1');
product1.guidanceIds.add('guidance-id-2');
page1.products = new List<ConnectApi.ProductGuidanceRepresentation>();
page1.products.add(product1);
input.pages.add(page1);
ConnectApi.PresentationPageInput page2 = new ConnectApi.PresentationPageInput();
page2.pageNumber = 2;
page2.name = 'PDF Page 2 Name';
page2.id = 'pdf-page-name-2';
page2.mandatory = true;
page2.activationDate = Date.today();
page2.deactivationDate = Date.today().addDays(365);
input.pages.add(page2);
System.debug(ConnectApi.LifeSciPresentation.createPresentationContent(input));