Sezion API

API Description

NEW: Easily connect Sezion to over 350 apps with Zapier. Learn more.

Our API use a RPC protocol called JSON-RPC over HTTPS.

All calls to our API follow the following URL schema:

https://sezion.com/api?accountID=[ACCOUNT_ID]&accountSecret=[ACCOUNT_SECRET]

Where ACCOUNT_ID and ACCOUNT_SECRET are the account identifier and secret token provided in the account web page.

You can use barrister to easily create you own client.

For Ruby use gem at https://github.com/iwiznia/barrister-ruby/ which includes HTTPS support.

Media Upload

Upload details

  • Maximum upload size is 50 MB
  • Mandatory HTTP HEADER: Content-type: (video/* | image/* | audio/*)
  • Mandatory HTTP HEADER: Content-length: 1 to 50000000
  • Optional HTTP HEADER: X-SZN-FILENAME: (max length 200)
  • Optional HTTP HEADER: X-SZN_DESCRIPTION: (max length 1000)

Account uploads

Media will be stored in your account storage.

End-point:

https://sezion.com/api/upload?accountID=[ACCOUNT_ID]&accountSecret=[ACCOUNT_SECRET]

Per video uploads

Video will be deleted after video generation

End-point:

https://sezion.com/api/upload?accountID=[ACCOUNT_ID]&templateID=[TEMPLATE_ID]&templateSecret=[TEMPLATE_SECRET]

Code examples

API Methods

WebHook

With webhooks we give you the possibility to react automatically every time a video is generated. A webhook is basically a URL where we send an HTTP POST request to, every time a video is generated. You can manage your webhooks in a per TEMPLATE basis, via the API or you can use the web interface.

Our call to the webhook includes a JSON encoded video object with detailed information about the video in it’s POST body.

Webhooks Details

  • We expect a http status code of 200 in the response of our webhook call.
  • Every content in the body will be discarded, so you might just leave that blank.
  • If the webhook call to one webhook fails a Notification will be added to your account

Webhook call example

  POST / HTTP/1.1
  Accept: */*
  Connection: close
  User-Agent: Sezion
  Content-Type: application/json
  Content-Length: 432
  Host: localhost:10000

  {
    "accountID":"533154e50fa92a6755582c8c",
    "description":"Test video for webhoook",
    "duration":2000,
    "name":"Test video",
    "templateID":"533155ec0fa92a6755582c8e",
    "outFiles":[
      { 
        "name":"5331669c0fa92a6755582c9e.MP4_H264_AAC_640x480.mp4",
        "profile":"MP4_H264_AAC_640x480_24fps",
        "size":27841,
        "storage":{
          "sezionID":"5331669c0fa92a6755582c9e.MP4_H264_AAC_640x480_24fps"
        }
      }
    ],
    "status": {"code":"done"},
    "date":"2014-03-25T11:21:00.047Z",
    "id":"5331669c0fa92a6755582c9e",
    "data" : "String passed as data parameter to Video Object when Template_VideoNew was called"
  }

API Error codes

 { code: undefined, message: undefined } 
 { code: 1000, message: Template not found } 
 { code: 1001, message: Media not found } 
 { code: 1002, message: MediaID not found in scripts } 
 { code: 1003, message: Inputs not allowed for this template } 
 { code: 1004, message: Scripts inputs and medias mismatch } 
 { code: 1005, message: Bad script } 
 { code: 1006, message: Video file not found } 
 { code: 1007, message: Video not found } 
 { code: 1008, message: Media in use in templates } 
 { code: 1009, message: No scripts } 
 { code: 1010, message: Account not found } 
 { code: 1011, message: Error downloading medias } 
 { code: 1012, message: Error processing video } 
 { code: 1013, message: Error uploading to Youtube } 
 { code: 1014, message: Youtube Account not Found } 
 { code: 1015, message: Authentication error } 
 { code: 1016, message: Email already used } 
 { code: 1017, message: Bad password } 
 { code: 1018, message: Bad secret } 
 { code: 1019, message: No size specified (content-length) } 
 { code: 1020, message: Invalid Content-Type } 
 { code: 1021, message: Account not active } 
 { code: 1023, message: Youtube upload bad token } 
 { code: 1025, message: Account type not found } 
 { code: 1026, message: Payment client error } 
 { code: 1027, message: Payment mismatch } 
 { code: 1028, message: Template inactive } 
 { code: 1029, message: Bad input media } 
 { code: 1030, message: Error deleting video files } 
 { code: 1031, message: Video is not in Youtube } 
 { code: 1032, message: This account type does not allow custom video profiles } 
 { code: 1032, message: No video profiles in template } 
 { code: 1032, message: Duplicated profile name } 
 { code: 2000, message: Stored videos size limit reached } 
 { code: 2001, message: Stored medias size limit reached } 
 { code: 2002, message: Video profile not allowed } 
 { code: 2003, message: Too much free objects in template } 
 { code: 2004, message: No credit } 
 { code: 2005, message: Max templates reached } 
 { code: 2005, message: Not all variables defined } 
 { code: 2006, message: CTA start time cannot be empty. } 
 { code: 2007, message: Atleast one field must be specified. } 
 { code: 2007, message: More than one elements have the same start time. } 
 { code: 2007, message: More than one elements have the same end time. } 
 { code: 5000, message: Internal Error } 

API Test

Account ID:
Account Secret:

Method Execute

Request

Response