// API Description:\n----------------\n\n * Our API use a RPC protocol called JSON-RPC over HTTPS\n * All calls to our API follow the following URL schema:\n https://dev2.pirsonal.com/api?accountID=[ACCOUNT_ID]&accountSecret=[ACCOUNT_SECRET]\n \n Where ACCOUNT_ID and ACCOUNT_SECRET are the account identifier and secret token provided in the account web page. // ERROR CODES // * error: { code: 1000, message: \"Template not found\", data: templateID}\n* error: { code: 1001, message: \"Media not found\", data: mediaID}\n* error: { code: 1002, message: \"MediaID not found in scripts\", data: media.inputID}\n* error: { code: 1003, message: \"Inputs not allowed for this template\", data: template.videoInputs}\n* error: { code: 1004, message: \"Scripts inputs and medias mismatch\"}\n* error: { code: 1005, message: \"Bad script\"}\n* error: { code: 1006, message: \"Video file not found\", data: pirsonalID}\n* error: { code: 1007, message: \"Video not found\", data: videoID}\n* error: { code: 1008, message: \"Media in use in templates\", data: templates}\n* error: { code: 1009, message: \"Stored videos size limit reached\"}\n* error: { code: 5000, message: \"Internal Error\", data: err } // MEDIA UPLOAD\n------------\n * URL: https://dev2.pirsonal.com/api/upload?accountID=[ACCOUNT_ID]&accountSecret=[ACCOUNT_SECRET]\n * MAX UPLOAD SIZE IS: 50000000 bytes\n * HTTP HEADER [optional]: X-SZN-FILENAME: (max length 200) \n * HTTP HEADER [optional]: X-SZN_DESCRIPTION: (max length 1000)\n * HTTP HEADER: Content-type: (video/* | image/* | audio/*)\n * HTTP HEADER: Content-lenght: 1 to 50000000 enum MediaType_t { //Used to remove media assignation none audio video text image rectangle } enum VideoOutputTypes_t{ pirsonal sezion awsS3 youtube } enum TemplateStatus_t { active inactive } enum VideoStatusCode_t { created queued processing done error deleted } enum WebAuth_t { none basic digest } enum VideoFormat_t { MP4_H264_AAC MPG_MPEG2_MP2 OGG_THEORA_VORBIS WEBM_VP8_VORBIS } enum Pattern_type_t { audiolevel } enum Pattern_action_t { info one multi } enum CTAFormFieldType { //Email field email //Text field text //Password field password } struct VideoResolution_t { width int height int } struct VideoAspect_t { numerator int denominator int } struct CTAFormInputField_t { fieldType CTAFormFieldType fieldName string } struct CTAPasswordInputField_t { fieldPlaceholder string fieldName string } struct CTAForm_t { title string [optional] description string [optional] inputFields []CTAFormInputField_t [optional] required bool [optional] showAtStart bool [optional] showAtEnd bool [optional] } struct CTAPassword_t { title string [optional] description string [optional] inputFields []CTAPasswordInputField_t [optional] secureCode string [optional] isPasswordProvided bool [optional] buttonText string [optional] } struct VideoProfile { name string format VideoFormat_t resolution VideoResolution_t aspect VideoAspect_t // @desc: Example: 1500000 for 1.5Mbps videoBitrate int // @min: 1 @max: 60 videoFPS int // @desc: Typecal values are: 11025, 22050, 44100, 48000, 96000 audioSampleRate int // @min: 1 @max: 2 audioChannels int // @dect: Example 128000 for 128kbps audioBitrate int } struct YoutubeOutput_t { id string license string privacy string category string keywords string [optional] } struct VideoOutput_t { type VideoOutputTypes_t // @desc: fill only if awsS3 selected awsS3Bucket string [optional] // @desc: fill only if youtube selected youtube YoutubeOutput_t [optional] } struct AWSS3_t { bucket string key string } struct VoiceSettings_t { // @desc: TTS provider (elevenlabs, azure, cartesia) provider string [optional] // @desc: Voice ID or model voice identifier voiceId string [optional] // @desc: Language code language string [optional] // @desc: Stability (0.0 - 1.0) stability float [optional] // @desc: Similarity boost (0.0 - 1.0) similarityBoost float [optional] // @desc: Speed multiplier speed float [optional] // @desc: Script template with variable tokens textTemplate string [optional] // @desc: Flag indicating whether this audio has been saved to Media Library saveToMediaLibrary bool [optional] // @desc: The Media Library asset ID for this voiceover savedMediaId string [optional] // @desc: The display file name for the saved voiceover savedMediaName string [optional] } // @desc: Fill only one of: text, http, pirsonalID or awsS3 struct Media_t { inputID string type MediaType_t // @maxLenght: 200 name string [optional] // @desc: Fill only if text media. \n@maxLenght: 1000 text string [optional] http string [optional] pirsonalID string [optional] sezionID string [optional] awsS3 AWSS3_t [optional] // @desc: Voice settings for AI Text-To-Speech audio media voiceSettings VoiceSettings_t [optional] } struct PirsonalMedia_t { id string type MediaType_t // @maxLenght: 200 name string [optional] // @maxLenght: 1000 description string [optional] size int [optional] temp bool [optional] } struct VideoInputs_t { // @max: 4 audio int // @max: 4 video int // @max: 4 text int // @max: 4 image int } struct WebHook_t { url string [optional] auth WebAuth_t username string [optional] password string [optional] } struct TemplateNew_t { // @maxLenght: 200 name string // @maxLenght: 1000 description string [optional] // @maxLenght: 200 template_type string [optional] // @desc: Google Analytics tracking code. GATrackingCode string [optional] webhook WebHook_t [optional] inputScripts []string [optional] outProfiles []string [optional] customProfiles []VideoProfile [optional] videoOutput VideoOutput_t videoInputs VideoInputs_t [optional] inputMedias []Media_t [optional] deduplicationMode string [optional] updatedAt string [optional] } struct Template_t extends TemplateNew_t { id string secret string date string updatedAt string [optional] // @desc: Template analytics analytics TemplateAnalytics_t [optional] status TemplateStatus_t videosCSV int [optional] } struct TemplateUpdate_t { // @maxLenght: 200 name string [optional] // @maxLenght: 1000 description string [optional] // @maxLenght: 200 template_type string [optional] // @desc: Google Analytics tracking code. GATrackingCode string [optional] webhook WebHook_t [optional] inputScripts []string [optional] outProfiles []string [optional] customProfiles []VideoProfile [optional] videoOutput VideoOutput_t [optional] videoInputs VideoInputs_t [optional] inputMedias []Media_t [optional] // @desc: Template analytics analyticsInfo TemplateAnalyticsUpdate_t [optional] analytics TemplateAnalytics_t [optional] videosCSV int [optional] deduplicationMode string [optional] updatedAt string [optional] } struct Variable_t { name string value string } struct Video_t { // @maxLenght: 200 name string [optional] // @maxLenght: 1000 description string [optional] // @desc: Email associated to the created video. email string [optional] // @desc: Contact first name associated to the created video. firstName string [optional] // @desc: Contact last name associated to the created video. lastName string [optional] inputScripts []string [optional] // @desc: Info to create a player playerInfo PlayerInfo_t [optional] // @desc: Info to create the Landing Page landingInfo LandingInfo_t [optional] inputVariables []Variable_t [optional] inputMedias []Media_t [optional] videoOutput VideoOutput_t [optional] keywords string [optional] // @maxLenght: 1024 bytes\n@desc: User attached data to video object. Will be returned by the webhook if set data string [optional] deduplicationMode string [optional] } // @desc: Only one must be defined struct VideoStorage_t { pirsonalID string [optional] awsS3 AWSS3_t [optional] youtubeID string [optional] youtubeAccountID string [optional] } struct VideoFiles_t { name string profile string size int storage VideoStorage_t [optional] deleted bool [optional] purged bool [optional] } struct VideoStatus_t { code VideoStatusCode_t error string [optional] } struct MeasurementController_t { name string [optional] contact string [optional] privacyPolicyUrl string [optional] } struct MeasurementRetention_t { consentReceiptDays int individualEventDays int aggregateRollupDays int operationalEventDays int } struct MeasurementLocalizedCopy_t { locale string title string [optional] introduction string [optional] } struct MeasurementPolicySnapshot_t { versionID string mode string provenance string resolvedFrom string consentRequired bool aggregateMeasurementAllowed bool individualMeasurementAllowed bool defaultLocale string copyVersion string [optional] copyOverrides []MeasurementLocalizedCopy_t [optional] purposes []string [optional] retention MeasurementRetention_t [optional] controller MeasurementController_t [optional] } struct VideoInfo_t { credits int [optional] name string [optional] description string [optional] template_type string [optional] template_media string [optional] email string [optional] // @desc: Contact first name associated to the created video. firstName string [optional] // @desc: Contact last name associated to the created video. lastName string [optional] id string duration int [optional] status VideoStatus_t procTime int [optional] date string inputVariables []Variable_t [optional] outFiles []VideoFiles_t [optional] // @desc: comma separated values\n@maxLenght: 50 keywords string [optional] // @desc: Info to create the Landing Page landingInfo LandingInfo_t [optional] // @desc: Info to create a player playerInfo PlayerInfo_t [optional] // @desc: Video analytics analytics VideoAnalytics_t [optional] // @maxLenght: 1024 bytes\n@desc: User attached data to video object. Will be returned by the webhook if set data string [optional] // @maxLenght: 1024 bytes\n@desc: User form data for video object formData []string [optional] // @desc: Google Analytics tracking code. GATrackingCode string [optional] // @desc: Effective privacy-aware measurement policy for this video. measurementPolicy MeasurementPolicySnapshot_t [optional] // @desc: remove pirsonal logo. poweredbyPirsonalLogo bool [optional] // @desc: allow input medias too. inputMedias []Media_t [optional] // @desc: Short URL for SMS marketing and quick sharing shortUrl string [optional] // @desc: Custom brand subdomain access flag subdomainLandingAccess bool [optional] // @desc: Custom brand subdomain landingSubdomain string [optional] // @desc: Custom CNAME landing domain access flag cnameLandingAccess bool [optional] // @desc: Custom CNAME landing domain landingCname string [optional] // @desc: Custom CNAME landing domain status landingCnameStatus string [optional] // @desc: Video files purged flag filesPurged bool [optional] // @desc: Video purge timestamp purgedAt string [optional] // @desc: Deduplication content hash contentHash string [optional] // @desc: Source video ID if deduplicated deduplicatedFrom string [optional] // @desc: Video deduplication flag isDeduplicated bool [optional] // @desc: Virtual deduplication flag isVirtualDeduplication bool [optional] // @desc: Deduplication mode deduplicationMode string [optional] } struct LandingInfo_t { // Landing Page Logo Image logoImageUrl string [optional] // Landing Page Banner Image bannerImageUrl string [optional] // Embed any external application within the landing page. embedIframeUrl string [optional] // Brand subdomain for custom landing page subdomain string [optional] // Brand custom CNAME for landing page cname string [optional] } struct PlayerInfo_t { // Video URL of videos hosted in Pirsonal, YouTube or Amazon S3. videoUrl string [optional] // @desc: Custom user form definition. CTAForm CTAForm_t [optional] // @desc: Custom user password definition. CTAPassword CTAPassword_t [optional] // @desc: CTA type. Must be one of [text,html] CTAType string [optional] // @desc: Custom HTML (upto 5000 characters) to be used as CTA content. Cannot contain Javascript CTACustomHTML string [optional] // Main Call to Action text CTABodyText string [optional] // Text displayed at the button of the CTA of a video. CTAButtonText string [optional] // CTA Button URL: The URL that will be added to the button of a personalized video. CTAButtonUrl string [optional] // CTA Start Time: Time (in seconds) when the CTA should be shown. CTAStartTime int [optional] // CTA End Time: Time (in seconds) when the CTA should be hidden. CTAEndTime int [optional] // Shows CTA when CTA icon (...) is clicked by the user. CTAOpenOnClick bool [optional] // Shows CTA when user pauses the video. CTAShowOnPause bool [optional] // Pauses video automatically when user clicks on show CTA. CTAPauseOnShow bool [optional] // Shows CTA when the video starts. CTAShowAtStart bool [optional] // Shows CTA when the video ends. CTAShowAtEnd bool [optional] // Allows user to close the CTA. CTAAllowClose bool [optional] // Allows user to auto play video. autoPlay bool [optional] // @desc: Duration (in seconds) for which CTA is shown. Should be set only if CTAAllowClose is false. CTADuration int [optional] // Thumbnail: The image that will be used as a thumbnail of a video. thumbnail string [optional] // Allows user to add custom css on player page. customCss string [optional] } struct VideoAnalytics_t { // Amount of times a video has been played plays int [optional] // Viewing percentage of a video. 0-100 engagementRate float [optional] // Amount of clicks of the Call to Action (CTA) button. CTALinkClicks int [optional] // Amount of clicks of the Call to Action (CTA) icon. CTAIconClicks int [optional] // Number of times the Call to Action (CTA) content is shown. CTAContentShow int [optional] // Number of times the Call to Action (CTA) content is hidden. CTAContentHide int [optional] // Percentage of Call to Action (CTA) button clicks generated in a video. 0-100 CTALinkClickRate float [optional] // Percentage of Call to Action (CTA) button clicks generated in a video. 0-100 playDetails []playDetails_t [optional] } struct playDetails_t { // Analytics date date string [optional] // Analytics requestTime requestTime string [optional] // Analytics deviceInformation deviceInformation deviceInformation_t [optional] // Analytics locationInformation locationInformation locationInformation_t [optional] // ID _id string [optional] } struct deviceInformation_t { // Analytics browser browser browser_t [optional] // Analytics engine engine engine_t [optional] // Analytics OS os os_t [optional] // Analytics device device device_t [optional] // Analytics CPU cpu cpu_t [optional] // Analytics UA ua string [optional] } struct browser_t { // name name string [optional] // version version string [optional] // major major string [optional] } struct engine_t { // name name string [optional] // version version string [optional] } struct os_t { // name name string [optional] // version version string [optional] } struct device_t { // vendor vendor string [optional] // model model string [optional] // type type string [optional] } struct cpu_t { // architecture architecture string [optional] } struct locationInformation_t { // Analytics country country string [optional] // Analytics region region string [optional] // EU region eu string [optional] // timezone timezone string [optional] // area area int [optional] // Analytics city city string [optional] // Analytics metro metro int [optional] // Analytics zip zip int [optional] // Analytics range range []int [optional] // Analytics ll ll []float [optional] } struct TemplateAnalytics_t { // Amount of times any video in a template has been played plays int [optional] // Viewing percentage of a template. 0-100 engagementRate float [optional] // Amount of clicks of the Call to Action (CTA) button. CTALinkClicks int [optional] // Amount of clicks of the Call to Action (CTA) icon. CTAIconClicks int [optional] // Number of times the Call to Action (CTA) content is shown. CTAContentShow int [optional] // Number of times the Call to Action (CTA) content is hidden. CTAContentHide int [optional] // Percentage of Call to Action (CTA) button clicks generated in a template. 0-100 CTALinkClickRate float [optional] } struct VideoAnalyticsUpdate_t { // If the video was played (at least a piece) played int [optional] // Viewing percentage of the video. 0-100 engagementRate int [optional] // if the user click in the Call to Action (CTA) button. CTALinkClicked int [optional] // if the user click in the Call to Action (CTA) icon. CTAIconClicked int [optional] // if the the Call to Action (CTA) content is shown to the user. CTAContentShown int [optional] // if the the Call to Action (CTA) content is hidden by the user. CTAContentHidden int [optional] // Percentage of Call to Action (CTA) button clicks generated in a video. 0-100 playDetails []playDetails_t [optional] } struct TemplateAnalyticsUpdate_t { // If a video in a template was played (at least a piece) played int [optional] // Viewing percentage of all videos in a template. 0-100 engagementRate int [optional] // if the user click in the Call to Action (CTA) button. CTALinkClicked int [optional] // if the user click in the Call to Action (CTA) icon. CTAIconClicked int [optional] // if the the Call to Action (CTA) content is shown to the user. CTAContentShown int [optional] // if the the Call to Action (CTA) content is hidden by the user. CTAContentHidden int [optional] } struct YoutubeMetaData_t { // @desc: creativeCommon or youtube license string [optional] // @desc: private,public or unlisted privacy string [optional] // @desc: check https://developers.google.com/youtube/v3/docs/videoCategories/list category string } struct VideoMetaData_t { name string [optional] description string [optional] // @desc: comma separated values\n@maxLenght: 50 keywords string [optional] data string [optional] youtube YoutubeMetaData_t [optional] } struct VideoUpdate_t { name string [optional] description string [optional] // @desc: Contact first name associated to the created video. firstName string [optional] // @desc: Contact last name associated to the created video. lastName string [optional] // @desc: comma separated values\n@maxLenght: 50 keywords string [optional] data string [optional] formData string [optional] youtube YoutubeMetaData_t [optional] // @desc: Info to create the Landing Page landingInfo LandingInfo_t [optional] // @desc: Info to create a player playerInfo PlayerInfo_t [optional] // @desc: Video analytics analyticsInfo VideoAnalyticsUpdate_t [optional] } struct VideoLink_t { id string profile string [optional] url string [optional] deleted bool [optional] purged bool [optional] } interface PirsonalAPI { // @desc: Creates a new Template @return: the template ID Template_New ( template TemplateNew_t ) string // @desc: Modifies an existing template @return: "OK" Template_Update ( templateID string, update TemplateUpdate_t ) string // @desc: Changes the status of an existing template @return: "OK" Template_SetStatus ( templateID string, status TemplateStatus_t ) string // @desc: Removes an existing template. If removeExternalFiles deletes external videos too (ie: youtube) @return: "OK" Template_Delete ( templateID string, removeExternalFiles bool ) string // @desc: Returns all templates associated with an account @return: An array with all the templates Template_List ( ) []Template_t // @desc: Assings a Media with an script variable within a Template @return: "OK" Template_Media_Assign (templateID string, media Media_t) string @desc: Creates a new Video from a template @return: the video ID Template_Video_New ( templateID string, video Video_t ) string // @desc: Returns an array of videos created with a template @return: An array with the videos Template_Video_List ( templateID string ) []VideoInfo_t // @desc: Returns the video info request by videoID @return: A video Video_Get ( videoID string ) VideoInfo_t // @desc: Issues a short-lived, scoped token for Pirsonal Player measurement events. Measurement_Token_Issue ( videoID string, source string ) string // @desc: Removes a video from an account. If removeFiles deletes external videos too (ie: youtube) @returns: "OK" Video_Delete ( videoID string, removeFiles bool ) string // @desc: Returns the link to download a video stored in Pirsonal @return: id and link of the video Video_Pirsonal_Link ( videoID string, pirsonalID string ) VideoLink_t // @desc: Returns array with all the links to download a video @return: array with video links Video_Get_Links ( videoID string ) []VideoLink_t // @desc: Update video metadata, also in youtube if available @return: "OK" Video_Update_Metadata ( videoID string, metaData VideoMetaData_t ) string // @desc: Update video info @return: "OK" Video_Update ( videoID string, videoUpdate VideoUpdate_t ) string // @desc: Returns an array of medias associated with the account @return: An array with the medias Media_List ( ) []PirsonalMedia_t // @desc: Removes a media associated the the account @return: "OK" Media_Delete ( mediaID string ) string // @desc: Apply a pattern to a media. Parameter for audiolevel are JSON.stringify({threshold: value}) @return: "OK or JSON Error" Media_Apply_Pattern ( mediaID string, patter Pattern_type_t, action Pattern_action_t, parameters string ) string }