Documentation

For all projects using Node.js, Ziggeo Node SDK is the best module to bring video to your apps.

To download it you can either:

  1. Use the direct link to download the Node.js SDK
  2. Download from or fork our Node.js SDK Github repository.

To see a quck demo you should check out the following repository: Ziggeo Demo App - Node JS With it you can quickly see some of the methods utilized giving you a quick Node JS proof of concept for your app or service video requirements.

Fork me on GitHub
To use Ziggeo Node.js SDK you would first need to install it:
npm install ziggeo
To use the methods from SDK in your code you would need to include it first. To include Node.js SDK you would use the following call:
Ziggeo = require('ziggeo');
var ZiggeoSdk = new Ziggeo('YOUR APP TOKEN', 'YOUR_APP_PRIVATE_KEY', 'YOUR_APP_ENCRYPTION_KEY');
Calling methods is as simple as:
ZiggeoSdk.Resource.method(args)
The following is the list of methods and their function calls

videos

  • index
    ZiggeoSdk.Videos.index(arguments, [callbacks])
    
    Returns JSON
    [
    	{
    	"volatile":false,
    	"token":"a7edab8c635ec37047d8ae75411528e3",
    	"key":null,
    	"state":5,
    	"max_duration":null,
    	"duration":1,
    	"tags":null,
    	"submission_date":1390257799,
    	"resubmission_date":1390257799,
    	"stream_submission_date":1390257799,
    	"delete_old_streams":true,
    	"type":"ApiVideo",
    	"created":1390257798,
    	"owned":false,
    	"state_string":"READY",
    	"streams":[
    	{
    		"volatile":false,
    		"token":"d751140b4e1cf0a243f32092f6110296",
    		"key":null,
    		"creation_type":5,
    		"state":5,
    		"streamable":2,
    		"video_type":"mp4",
    		"video_sub_type":"other",
    		"image_size":0,
    		"video_size":36078,
    		"video_width":640,
    		"video_height":360,
    		"duration":1,
    		"has_video":true,
    		"has_image":true,
    		"submission_date":1390257799,
    		"type":"ApiVideoStream",
    		"created":1390257799,
    		"owned":true,
    		"creation_type_string":"SERVER_UPLOAD",
    		"streamable_string":"DEGRADED",
    		"state_string":"READY"
    	}],
    	"original_stream":
    	{
    		"volatile":false,
    		"token":"d751140b4e1cf0a243f32092f6110296",
    		"key":null,
    		"creation_type":5,
    		"state":5,
    		"streamable":2,
    		"video_type":"mp4",
    		"video_sub_type":"other",
    		"image_size":0,
    		"video_size":36078,
    		"video_width":640,
    		"video_height":360,
    		"duration":1,
    		"has_video":true,
    		"has_image":true,
    		"submission_date":1390257799,
    		"type":"ApiVideoStream",
    		"created":1390257799,
    		"owned":true,
    		"creation_type_string":"SERVER_UPLOAD",
    		"streamable_string":"DEGRADED",
    		"state_string":"READY"
    	},
    	"default_stream":
    	{
    		"volatile":false,
    		"token":"d751140b4e1cf0a243f32092f6110296",
    		"key":null,
    		"creation_type":5,
    		"state":5,
    		"streamable":2,
    		"video_type":"mp4",
    		"video_sub_type":"other",
    		"image_size":0,
    		"video_size":36078,
    		"video_width":640,
    		"video_height":360,
    		"duration":1,
    		"has_video":true,
    		"has_image":true,
    		"submission_date":1390257799,
    		"type":"ApiVideoStream",
    		"created":1390257799,
    		"owned":true,
    		"creation_type_string":"SERVER_UPLOAD",
    		"streamable_string":"DEGRADED",
    		"state_string":"READY"
    	}}]
    
    1. limit Limit the number of returned videos. Can be set up to 100.
    2. skip Skip the first [n] entries.
    3. reverse Reverse the order in which videos are returned.
    4. states Filter videos by state
    5. tags Filter the search result to certain tags, encoded as a comma-separated string
  • count
    ZiggeoSdk.Videos.count(arguments, [callbacks])
    
    Returns JSON
    1. states Filter videos by state
    2. tags Filter the search result to certain tags, encoded as a comma-separated string
  • get
    ZiggeoSdk.Videos.get(token_or_key, [callbacks])
    
    Returns JSON
    {
    	"volatile":false,
    	"token":"a7edab8c635ec37047d8ae75411528e3",
    	"key":null,
    	"state":5,
    	"max_duration":null,
    	"duration":1,
    	"tags":null,
    	"submission_date":1390257799,
    	"resubmission_date":1390257799,
    	"stream_submission_date":1390257799,
    	"delete_old_streams":true,
    	"type":"ApiVideo",
    	"created":1390257798,
    	"owned":false,
    	"state_string":"READY",
    	"streams":[
    	{
    		"volatile":false,
    		"token":"d751140b4e1cf0a243f32092f6110296",
    		"key":null,
    		"creation_type":5,
    		"state":5,
    		"streamable":2,
    		"video_type":"mp4",
    		"video_sub_type":"other",
    		"image_size":0,
    		"video_size":36078,
    		"video_width":640,
    		"video_height":360,
    		"duration":1,
    		"has_video":true,
    		"has_image":true,
    		"submission_date":1390257799,
    		"type":"ApiVideoStream",
    		"created":1390257799,
    		"owned":true,
    		"creation_type_string":"SERVER_UPLOAD",
    		"streamable_string":"DEGRADED",
    		"state_string":"READY"
    	}],
    	"original_stream":
    	{
    		"volatile":false,
    		"token":"d751140b4e1cf0a243f32092f6110296",
    		"key":null,
    		"creation_type":5,
    		"state":5,
    		"streamable":2,
    		"video_type":"mp4",
    		"video_sub_type":"other",
    		"image_size":0,
    		"video_size":36078,
    		"video_width":640,
    		"video_height":360,
    		"duration":1,
    		"has_video":true,
    		"has_image":true,
    		"submission_date":1390257799,
    		"type":"ApiVideoStream",
    		"created":1390257799,
    		"owned":true,
    		"creation_type_string":"SERVER_UPLOAD",
    		"streamable_string":"DEGRADED",
    		"state_string":"READY"
    	},
    	"default_stream":
    	{
    		"volatile":false,
    		"token":"d751140b4e1cf0a243f32092f6110296",
    		"key":null,
    		"creation_type":5,
    		"state":5,
    		"streamable":2,
    		"video_type":"mp4",
    		"video_sub_type":"other",
    		"image_size":0,
    		"video_size":36078,
    		"video_width":640,
    		"video_height":360,
    		"duration":1,
    		"has_video":true,
    		"has_image":true,
    		"submission_date":1390257799,
    		"type":"ApiVideoStream",
    		"created":1390257799,
    		"owned":true,
    		"creation_type_string":"SERVER_UPLOAD",
    		"streamable_string":"DEGRADED",
    		"state_string":"READY"
    	}}
    
  • get_bulk
    ZiggeoSdk.Videos.get_bulk(arguments, [callbacks])
    
    Returns JSON
    1. tokens_or_keys Comma-separated list with the desired videos tokens or keys (Limit: 100 tokens or keys).
  • stats_bulk
    ZiggeoSdk.Videos.stats_bulk(arguments, [callbacks])
    
    Returns JSON
    1. tokens_or_keys Comma-separated list with the desired videos tokens or keys (Limit: 100 tokens or keys).
    2. summarize Boolean. Set it to TRUE to get the stats summarized. Set it to FALSE to get the stats for each video in a separate array. Default: TRUE.
  • download_video
    ZiggeoSdk.Videos.download_video(token_or_key, [callbacks])
    
    Returns DATA
  • download_image
    ZiggeoSdk.Videos.download_image(token_or_key, [callbacks])
    
    Returns DATA
  • get_stats
    ZiggeoSdk.Videos.get_stats(token_or_key, [callbacks])
    
    Returns JSON
  • push_to_service
    ZiggeoSdk.Videos.push_to_service(token_or_key, arguments, [callbacks])
    
    Returns JSON
    1. pushservicetoken Push Services's token (from the Push Services configured for the app)
  • apply_effect
    ZiggeoSdk.Videos.apply_effect(token_or_key, arguments, [callbacks])
    
    Returns JSON
    1. effectprofiletoken Effect Profile token (from the Effect Profiles configured for the app)
  • apply_meta
    ZiggeoSdk.Videos.apply_meta(token_or_key, arguments, [callbacks])
    
    Returns JSON
    1. metaprofiletoken Meta Profile token (from the Meta Profiles configured for the app)
  • update
    ZiggeoSdk.Videos.update(token_or_key, arguments, [callbacks])
    
    Returns JSON
    {
    	"volatile":false,
    	"token":"a7edab8c635ec37047d8ae75411528e3",
    	"key":"brandnewname",
    	"state":5,
    	"max_duration":"10",
    	"duration":1,
    	"tags":null,
    	"submission_date":1390257799,
    	"resubmission_date":1390257799,
    	"stream_submission_date":1390257799,
    	"delete_old_streams":true,
    	"type":"ApiVideo",
    	"created":1390257798,
    	"owned":false,
    	"state_string":"READY",
    	"streams":[
    	{
    		"volatile":false,
    		"token":"d751140b4e1cf0a243f32092f6110296",
    		"key":null,
    		"creation_type":5,
    		"state":5,
    		"streamable":2,
    		"video_type":"mp4",
    		"video_sub_type":"other",
    		"image_size":0,
    		"video_size":36078,
    		"video_width":640,
    		"video_height":360,
    		"duration":1,
    		"has_video":true,
    		"has_image":true,
    		"submission_date":1390257799,
    		"type":"ApiVideoStream",
    		"created":1390257799,
    		"owned":true,
    		"creation_type_string":"SERVER_UPLOAD",
    		"streamable_string":"DEGRADED",
    		"state_string":"READY"
    	}],
    	"original_stream":
    	{
    		"volatile":false,
    		"token":"d751140b4e1cf0a243f32092f6110296",
    		"key":null,
    		"creation_type":5,
    		"state":5,
    		"streamable":2,
    		"video_type":"mp4",
    		"video_sub_type":"other",
    		"image_size":0,
    		"video_size":36078,
    		"video_width":640,
    		"video_height":360,
    		"duration":1,
    		"has_video":true,
    		"has_image":true,
    		"submission_date":1390257799,
    		"type":"ApiVideoStream",
    		"created":1390257799,
    		"owned":true,
    		"creation_type_string":"SERVER_UPLOAD",
    		"streamable_string":"DEGRADED",
    		"state_string":"READY"
    	},
    	"default_stream":
    	{
    		"volatile":false,
    		"token":"d751140b4e1cf0a243f32092f6110296",
    		"key":null,
    		"creation_type":5,
    		"state":5,
    		"streamable":2,
    		"video_type":"mp4",
    		"video_sub_type":"other",
    		"image_size":0,
    		"video_size":36078,
    		"video_width":640,
    		"video_height":360,
    		"duration":1,
    		"has_video":true,
    		"has_image":true,
    		"submission_date":1390257799,
    		"type":"ApiVideoStream",
    		"created":1390257799,
    		"owned":true,
    		"creation_type_string":"SERVER_UPLOAD",
    		"streamable_string":"DEGRADED",
    		"state_string":"READY"
    	}}
    
    1. min_duration Minimal duration of video
    2. max_duration Maximal duration of video
    3. tags Video Tags
    4. key Unique (optional) name of video
    5. volatile Automatically removed this video if it remains empty
    6. expiration_days After how many days will this video be deleted
  • update_bulk
    ZiggeoSdk.Videos.update_bulk(arguments, [callbacks])
    
    Returns JSON
    1. tokens_or_keys Comma-separated list with the desired videos tokens or keys (Limit: 100 tokens or keys).
    2. min_duration Minimal duration of video
    3. max_duration Maximal duration of video
    4. tags Video Tags
    5. volatile Automatically removed this video if it remains empty
    6. expiration_days After how many days will this video be deleted
  • delete
    ZiggeoSdk.Videos.destroy(token_or_key, [callbacks])
    
  • create
    ZiggeoSdk.Videos.create(arguments, [callbacks])
    
    Returns JSON
    {
    	"volatile":true,
    	"token":"a7edab8c635ec37047d8ae75411528e3",
    	"key":null,
    	"state":3,
    	"max_duration":null,
    	"duration":null,
    	"tags":null,
    	"submission_date":null,
    	"resubmission_date":null,
    	"stream_submission_date":null,
    	"delete_old_streams":true,
    	"type":"ApiVideo",
    	"created":1390257798,
    	"owned":false,
    	"state_string":"EMPTY",
    	"streams":[],
    	"original_stream":null,
    	"default_stream":null
    }
    
    1. file Video file to be uploaded
    2. min_duration Minimal duration of video
    3. max_duration Maximal duration of video
    4. tags Video Tags
    5. key Unique (optional) name of video
    6. volatile Automatically removed this video if it remains empty
  • analytics
    ZiggeoSdk.Videos.analytics(token_or_key, arguments, [callbacks])
    
    Returns JSON
    1. from A UNIX timestamp in microseconds used as the start date of the query
    2. to A UNIX timestamp in microseconds used as the end date of the query
    3. date A UNIX timestamp in microseconds to retrieve data from a single date. If set, it overwrites the from and to params.
    4. query The query you want to run. It can be one of the following: device_views_by_os, device_views_by_date, total_plays_by_country, full_plays_by_country, total_plays_by_hour, full_plays_by_hour, total_plays_by_browser, full_plays_by_browser

streams

  • index
    ZiggeoSdk.Streams.index(video_token_or_key, arguments, [callbacks])
    
    Returns JSON
    [
    	{
    	"volatile":false,
    	"token":"d751140b4e1cf0a243f32092f6110296",
    	"key":null,
    	"creation_type":5,
    	"state":5,
    	"streamable":2,
    	"video_type":"mp4",
    	"video_sub_type":"other",
    	"image_size":0,
    	"video_size":36078,
    	"video_width":640,
    	"video_height":360,
    	"duration":1,
    	"has_video":true,
    	"has_image":true,
    	"submission_date":1390257799,
    	"type":"ApiVideoStream",
    	"created":1390257799,
    	"owned":true,
    	"creation_type_string":"SERVER_UPLOAD",
    	"streamable_string":"DEGRADED",
    	"state_string":"READY"
    }]
    
    1. states Filter streams by state
  • get
    ZiggeoSdk.Streams.get(video_token_or_key, token_or_key, [callbacks])
    
    Returns JSON
    {
    	"volatile":false,
    	"token":"d751140b4e1cf0a243f32092f6110296",
    	"key":null,
    	"creation_type":5,
    	"state":5,
    	"streamable":2,
    	"video_type":"mp4",
    	"video_sub_type":"other",
    	"image_size":0,
    	"video_size":36078,
    	"video_width":640,
    	"video_height":360,
    	"duration":1,
    	"has_video":true,
    	"has_image":true,
    	"submission_date":1390257799,
    	"type":"ApiVideoStream",
    	"created":1390257799,
    	"owned":true,
    	"creation_type_string":"SERVER_UPLOAD",
    	"streamable_string":"DEGRADED",
    	"state_string":"READY"
    }
    
  • download_video
    ZiggeoSdk.Streams.download_video(video_token_or_key, token_or_key, [callbacks])
    
    Returns DATA
  • download_image
    ZiggeoSdk.Streams.download_image(video_token_or_key, token_or_key, [callbacks])
    
    Returns DATA
  • push_to_service
    ZiggeoSdk.Streams.push_to_service(video_token_or_key, token_or_key, arguments, [callbacks])
    
    Returns JSON
    1. pushservicetoken Push Services's token (from the Push Services configured for the app)
  • delete
    ZiggeoSdk.Streams.destroy(video_token_or_key, token_or_key, [callbacks])
    
  • create
    ZiggeoSdk.Streams.create(video_token_or_key, arguments, [callbacks])
    
    Returns JSON
    {
    	"volatile":false,
    	"token":"d751140b4e1cf0a243f32092f6110296",
    	"key":null,
    	"creation_type":5,
    	"state":5,
    	"streamable":2,
    	"video_type":"mp4",
    	"video_sub_type":"other",
    	"image_size":0,
    	"video_size":36078,
    	"video_width":640,
    	"video_height":360,
    	"duration":1,
    	"has_video":true,
    	"has_image":true,
    	"submission_date":1390257799,
    	"type":"ApiVideoStream",
    	"created":1390257799,
    	"owned":true,
    	"creation_type_string":"SERVER_UPLOAD",
    	"streamable_string":"DEGRADED",
    	"state_string":"READY"
    }
    
    1. file Video file to be uploaded
  • attach_image
    ZiggeoSdk.Streams.attach_image(video_token_or_key, token_or_key, arguments, [callbacks])
    
    Returns JSON
    1. file Image file to be attached
  • attach_video
    ZiggeoSdk.Streams.attach_video(video_token_or_key, token_or_key, arguments, [callbacks])
    
    Returns JSON
    1. file Video file to be attached
  • bind
    ZiggeoSdk.Streams.bind(video_token_or_key, token_or_key, arguments, [callbacks])
    
    Returns JSON

authtokens

  • get
    ZiggeoSdk.Authtokens.get(token, [callbacks])
    
    Returns JSON
  • update
    ZiggeoSdk.Authtokens.update(token_or_key, arguments, [callbacks])
    
    Returns JSON
    1. volatile Will this object automatically be deleted if it remains empty?
    2. hidden If hidden, the token cannot be used directly.
    3. expiration_date Expiration date for the auth token
    4. usage_experitation_time Expiration time per session
    5. session_limit Maximal number of sessions
    6. grants Permissions this tokens grants
  • delete
    ZiggeoSdk.Authtokens.destroy(token_or_key, [callbacks])
    
  • create
    ZiggeoSdk.Authtokens.create(arguments, [callbacks])
    
    Returns JSON
    1. volatile Will this object automatically be deleted if it remains empty?
    2. hidden If hidden, the token cannot be used directly.
    3. expiration_date Expiration date for the auth token
    4. usage_experitation_time Expiration time per session
    5. session_limit Maximal number of sessions
    6. grants Permissions this tokens grants

application

  • get
    ZiggeoSdk.Application.get([callbacks])
    
    Returns JSON
  • update
    ZiggeoSdk.Application.update(arguments, [callbacks])
    
    Returns JSON
    1. volatile Will this object automatically be deleted if it remains empty?
    2. name Name of the application
    3. auth_token_required_for_create Require auth token for creating videos
    4. auth_token_required_for_update Require auth token for updating videos
    5. auth_token_required_for_read Require auth token for reading videos
    6. auth_token_required_for_destroy Require auth token for deleting videos
    7. client_can_index_videos Client is allowed to perform the index operation
    8. client_cannot_access_unaccepted_videos Client cannot view unaccepted videos
    9. enable_video_subpages Enable hosted video pages
  • get_stats
    ZiggeoSdk.Application.get_stats(arguments, [callbacks])
    
    Returns JSON
    1. period Optional. Can be 'year' or 'month'.

effectProfiles

  • create
    ZiggeoSdk.EffectProfiles.create(arguments, [callbacks])
    
    Returns JSON
    1. key Effect profile key.
    2. title Effect profile title.
    3. default_effect Boolean. If TRUE, sets an effect profile as default. If FALSE, removes the default status for the given effect
  • index
    ZiggeoSdk.EffectProfiles.index(arguments, [callbacks])
    
    Returns JSON
    1. limit Limit the number of returned effect profiles. Can be set up to 100.
    2. skip Skip the first [n] entries.
    3. reverse Reverse the order in which effect profiles are returned.
  • get
    ZiggeoSdk.EffectProfiles.get(token_or_key, [callbacks])
    
    Returns JSON
  • delete
    ZiggeoSdk.EffectProfiles.destroy(token_or_key, [callbacks])
    
  • update
    ZiggeoSdk.EffectProfiles.update(token_or_key, arguments, [callbacks])
    
    Returns JSON
    1. default_effect Boolean. If TRUE, sets an effect profile as default. If FALSE, removes the default status for the given effect

effectProfileProcess

  • index
    ZiggeoSdk.EffectProfileProcess.index(effect_token_or_key, arguments, [callbacks])
    
    Returns JSON
    1. states Filter streams by state
  • get
    ZiggeoSdk.EffectProfileProcess.get(effect_token_or_key, token_or_key, [callbacks])
    
    Returns JSON
  • delete
    ZiggeoSdk.EffectProfileProcess.destroy(effect_token_or_key, token_or_key, [callbacks])
    
  • create_filter_process
    ZiggeoSdk.EffectProfileProcess.create_filter_process(effect_token_or_key, arguments, [callbacks])
    
    Returns JSON
    1. effect Effect to be applied in the process
  • create_watermark_process
    ZiggeoSdk.EffectProfileProcess.create_watermark_process(effect_token_or_key, arguments, [callbacks])
    
    Returns JSON
    1. file Image file to be attached
    2. vertical_position Specify the vertical position of your watermark (a value between 0.0 and 1.0)
    3. horizontal_position Specify the horizontal position of your watermark (a value between 0.0 and 1.0)
    4. video_scale Specify the image scale of your watermark (a value between 0.0 and 1.0)

metaProfiles

  • create
    ZiggeoSdk.MetaProfiles.create(arguments, [callbacks])
    
    Returns JSON
    1. key Meta Profile profile key.
    2. title Meta Profile profile title.
  • index
    ZiggeoSdk.MetaProfiles.index(arguments, [callbacks])
    
    Returns JSON
    1. limit Limit the number of returned meta profiles. Can be set up to 100.
    2. skip Skip the first [n] entries.
    3. reverse Reverse the order in which meta profiles are returned.
  • get
    ZiggeoSdk.MetaProfiles.get(token_or_key, [callbacks])
    
    Returns JSON
  • delete
    ZiggeoSdk.MetaProfiles.destroy(token_or_key, [callbacks])
    

metaProfileProcess

  • index
    ZiggeoSdk.MetaProfileProcess.index(meta_token_or_key, [callbacks])
    
    Returns JSON
  • get
    ZiggeoSdk.MetaProfileProcess.get(meta_token_or_key, token_or_key, [callbacks])
    
    Returns JSON
  • delete
    ZiggeoSdk.MetaProfileProcess.destroy(meta_token_or_key, token_or_key, [callbacks])
    
  • create_video_analysis_process
    ZiggeoSdk.MetaProfileProcess.create_video_analysis_process(meta_token_or_key, [callbacks])
    
    Returns JSON
  • create_audio_transcription_process
    ZiggeoSdk.MetaProfileProcess.create_audio_transcription_process(meta_token_or_key, [callbacks])
    
    Returns JSON
  • create_nsfw_process
    ZiggeoSdk.MetaProfileProcess.create_nsfw_process(meta_token_or_key, arguments, [callbacks])
    
    Returns JSON
    1. nsfw_action One of the following three: approve, reject, nothing.

webhooks

  • create
    ZiggeoSdk.Webhooks.create(arguments, [callbacks])
    
    Returns string
    1. target_url The url that will catch the events
    2. encoding Data encoding to be used by the webhook to send the events.
    3. events Comma-separated list of the events the webhook will catch. They must be valid webhook type events.
  • delete
    ZiggeoSdk.Webhooks.destroy(arguments, [callbacks])
    
    Returns string
    1. target_url The url that will catch the events

analytics

  • get
    ZiggeoSdk.Analytics.get(arguments, [callbacks])
    
    Returns JSON
    1. from A UNIX timestamp in microseconds used as the start date of the query
    2. to A UNIX timestamp in microseconds used as the end date of the query
    3. date A UNIX timestamp in microseconds to retrieve data from a single date. If set, it overwrites the from and to params.
    4. query The query you want to run. It can be one of the following: device_views_by_os, device_views_by_date, total_plays_by_country, full_plays_by_country, total_plays_by_hour, full_plays_by_hour, total_plays_by_browser, full_plays_by_browser