Newer Version Available
createPresentationContent(presentationContentInput)
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.
Return Value
Example
1ConnectApi.PresentationContentInputRepresentation input = new ConnectApi.PresentationContentInputRepresentation();
2input.contentType = 'PRESENTATION_PDF';
3ConnectApi.PresentationInput presentation = new ConnectApi.PresentationInput();
4presentation.name = 'PDF Presentation Name';
5presentation.id = 'pdf-presentation-id';
6presentation.enableDoubleTapZoom = true;
7presentation.enablePinchZoom = true;
8presentation.playerGesture = 'SWIPEUP';
9presentation.activationDate = Date.today();
10presentation.deactivationDate = Date.today().addDays(365);
11input.presentation = presentation;
12input.pages = new List<ConnectApi.PresentationPageInput>();
13ConnectApi.PresentationPageInput page1 = new ConnectApi.PresentationPageInput();
14page1.pageNumber = 1;
15page1.name = 'PDF Page 1 Name';
16page1.id = 'pdf-page-name-1';
17page1.mandatory = true;
18page1.contentDocumentId = '069SB0000048cPDYAY';
19page1.activationDate = Date.today();
20page1.deactivationDate = Date.today().addDays(365);
21ConnectApi.ProductGuidanceRepresentation product1 = new ConnectApi.ProductGuidanceRepresentation();
22product1.productId = '1KeYH0000001j2m0AA';
23product1.guidanceIds = new List<String>();
24product1.guidanceIds.add('guidance-id-1');
25product1.guidanceIds.add('guidance-id-2');
26page1.products = new List<ConnectApi.ProductGuidanceRepresentation>();
27page1.products.add(product1);
28input.pages.add(page1);
29ConnectApi.PresentationPageInput page2 = new ConnectApi.PresentationPageInput();
30page2.pageNumber = 2;
31page2.name = 'PDF Page 2 Name';
32page2.id = 'pdf-page-name-2';
33page2.mandatory = true;
34page2.activationDate = Date.today();
35page2.deactivationDate = Date.today().addDays(365);
36input.pages.add(page2);
37System.debug(ConnectApi.LifeSciPresentation.createPresentationContent(input));