Overview

  • Using the Teleport APIs you can create, manage, view and broadcast Teleport feeds.
  • These are simple REST based apis that return JSON or XML, easily consumed from any website or app.
  • Get your APIKEY from the Dashboard -> Api section. It can be either the primary or secondary key.
  • Get your ACCESSKEY from the Feed Dashboard -> Share section. It gives view only access to the feed.

Player embedding

  • The embed code is as follows:
    <iframe width="WIDTH" height="HEIGHT" src="https://api.teleport.io/feed-player/FEEDID?frametime=FRAMETIME&playmode=PLAYMODE&playmodespossible=PLAYMODESPOSSIBLE&framesizingmode=FRAMESIZINGMODE&showsplashbadge=SHOWSPLASHBADGE&showoverlaybadge=SHOWOVERLAYBADGE&overlayopacity=OVERLAYOPACITY&backgroundcolor=BACKGROUNDCOLOR&playframespeed=PLAYFRAMESPEED&playframeskipinterval=PLAYFRAMESKIPINTERVAL&playframecount=PLAYFRAMECOUNT&accesskey=ACCESSKEYcustomArgs#" frameborder="0" allowfullscreen></iframe>
  • You can embed multiple players on a single page by using multiple iframe embed codes.
  • PLAYMODE is one of [liveimage, liveimageloop, livetimelapse, historyimage].
  • WIDTH,HEIGHT are pixel values. Use 100% for width to fill available horizontal space.
  • PLAYMODESPOSSIBLE is a comma separated list of the above.
  • FRAMESIZINGMODE one of [auto, uniformtofill, uniform].
  • FRAMETIME is the timestamp must refer to an existing frame, it the frame does not exist the most recent or live frame will be shown. Format must be 2014-01-14T21:07:17Z, this is the UTC 8601 format. Get this value from the player share section, while viewing the frame of interest.
  • PLAYFRAMESPEED controls how fast frames change in live loop and history image play modes. Value one of [30fps, 10fps, 0.5sec, 1sec, 3sec, 10sec]. Custom value not accepted at this time. Contact us if this is a requirement. 30fps and 10fps play speeds will only begin once all the frames are cached on the client, hence the initial slow playback.
  • PLAYFRAMESKIPINTERVAL controls the time interval between each played frame in live loop and history image play modes. Value one of [sec, min, 5min, 15min, hour, day, month]. Custom value not accepted at this time. Email us if this is a requirement.
  • PLAYFRAMECOUNT controls how many frames to play. Applies to live loop play mode only at this time. Value between 1 and 1000.
  • APIKEY embed the player with an api key, giving it access to all feeds on the given account, including non-public feeds. WARNING: do not use this on public websites!
  • ACCESSKEY embed the player with a share key, giving it access to the feeds using this share key, including non-public feeds.
  • More coming soon. Please contact us via email for help!

Example of an embedded feed player with custom options, uniform sizing and live loop as default play mode

Demo code

V2 Player Embedding

Demo code

V2 player has minimal UI and started life supporting non-interactive scenarios such as digital sign/lobby TV with a custom playlist. UI will be added and it will replace the v1 player shortly.

Access a live feed image

  • https://www.teleport.io/api/v1/frame-get/FEEDID?sizecode=SIZECODE&apikey=APIKEY&accesskey=ACCESSKEY
  • Returns actual jpg image data of the specified image size.
  • SIZECODE is one of [x480, x768, x1080] image sizes
  • The image size is guaranteed to be at most the specified size. It may be smaller if the feed does not have the specified size.
  • Guaranteed to return an image if one exists regardless of SIZECODE.
  • Http method: GET

Demo code

Access a recorded feed image

  • https://www.teleport.io/api/v1/frame-get/FEEDID?frametime=FRAMETIME&sizecode=SIZECODE&apikey=APIKEY&accesskey=ACCESSKEY
  • Returns the jpg image data of the specified image size, recorded at the requested time. If the time must be accurate to the second, otherwise a 404 error is returned.
  • FRAMETIME is in UTC format i.e. 2016-09-21T01:25:47Z
  • SIZECODE is one of [x480, x768, x1080] image sizes
  • The image size is guaranteed to be at most the specified size. It may be smaller if the feed does not have the specified size.
  • Guaranteed to return an image if one exists regardless of SIZECODE.
  • Http method: GET

Demo code

Get feed info

  • https://www.teleport.io/api/v1/feed-info?feedid=FEEDID&apikey=APIKEY&accesskey=ACCESSKEY
  • Returns feed properties, such as name, description, etc.
  • Http method: GET

Demo code

Query recorded frames

  • http://www.teleport.io/api/v1/frame-query/FEEDID?starttime=STARTTIME&endtime=ENDTIME&interval=INTERVAL&apikey=APIKEY&accesskey=ACCESSKEY
  • Returns an array of timestamps, for use in a frame-get or frame-delete method.
  • STARTTIME is in UTC format i.e. 2016-09-21T01:25:47Z
  • ENDTIME is in UTC format i.e. 2016-09-21T01:25:47Z
  • INTERVAL is how many seconds between each frame, use this to reduce the set of returned values. i.e. 3600 to return frames 1 hour apart.
  • Http method: GET

Demo code

Delete recorded frames

  • http://www.teleport.io/api/v1/frame-delete/FEEDID?frametime=FRAMETIME&apikey=APIKEY
  • Permanently deletes the specified frame.
  • Use the frame-query API to get frame timestamps.
  • FRAMETIME the exact frame timestamp to delete, it is in UTC format i.e. 2016-09-21T01:25:47Z
  • APIKEY is required to delete on all feeds. ACCESSKEY is ignored by this method.
  • Http method: DELETE

Demo code

Upload an image to a feed

  • http://www.teleport.io/api/v1/frame-set/FEEDID?frametime=FRAMETIME&broadcastkey=BROADCASTKEY&apikey=APIKEY
  • Permanently deletes the selected frames.
  • FRAMETIME is time the frame was recorded, in UTC format i.e. 2016-09-21T01:25:47Z. If not present the current UTC time is used.
  • A broadcast key or an api key is required to upload frames.
  • The body of the request must contain the image data in binary representation. PNG or JPEG are supported.
  • The content must be less than 10MB.
  • Http method: POST

Demo code, upload from file

Demo code, upload from webcam (chrome, firefox, opera, android only)

Use Powershell to broadcast live and historical images

Teleport data export

How to use the Teleport PowerShell export script:

  • The script isn't signed so you may get warnings from Windows as you should only download and run scripts you know about. Right click on the downloaded file, goto Properties and Unblock it.
  • To run the script, get into PowerShell, one way is to hit Windows + R and type powershell and click 'OK'.
  • On prompt type $PSVersionTable.PSVersion to get the Powershell version, if Major isn't 4 or greater you need to upgarde. Install Powershell 7.1 from here.
  • Next enable execution policy on your computer, to do this you must run PowerShell as Administrator. Right click on the PowerShell icon in the task bar and click Run as administrator. Type Set-ExecutionPolicy Unrestricted. Once you're done exporting type Set-ExecutionPolicty Restricted to bring it back for best practice.
  • Now in the PowerShell window go to the folder where the script is downloaded using cd C:\Users\UserName\Downloads command.
  • And finally type .\teleport-export.ps1 to run the script. Here you will be asked to enter all parameters and begin the export. For each command type !? to get help.
  • To run directly from command you use : .\teleport-export.ps1 -feedId 'feedid' -startTime 20140601T000000 -endTime 20140901T000000 -interval 20000 -sizeCodes ('x480', 'x768', 'x1080', 'x2160', 'x4320') -key 'apikey or accesskey' -exportFolder 'C:\TeleportExport\'
  • The interval argument is the time between exported frames in seconds. i.e. a value of 0 exports all frames, 60 export frames 60 sec apart.
  • To export only the largest available images (skipping scaled down copies) use just the 'x4320' sizeCode argument or leave it empty.
  • To load the script into Powershell, run . .\teleport-export.ps1 (note the extra . and space before the main command)
  • Once you do this, type Teleport-Export to run the export function directly, or get-help Teleport-Export -detailed to get help.

Download the export script using command line on Linux, OSX or Windows

  • Install Powershell for Linux or OSX
  • Run Powershell and execute this command to download the export script:
     
        # on Linux or OSX
        wget -q http://blob.teleport.io/apps/win/powershell/teleport-export.ps1 -O teleport-export.ps1
        
        # on Windows this is done using
        Invoke-WebRequest -Uri http://blob.teleport.io/apps/win/powershell/teleport-export.ps1 -OutFile teleport-export.ps1
    
    
  • Give it execute permission, not required on Windows:
    
        chmod +x teleport-export.ps1
    
    
  • And run it:
    
        ./teleport-export.sh
    
    

Here is an example command, which will export the 4K, and 1080p images between the given dates, interval 0 downloads all images.

    .\Teleport-Export -feedId yourFeedId -sizeCodes 'x2160', 'x1080' -key yourApiKey -startTime 2018-01-22T00:00:00Z -endTime 2021-01-22T00:00:00Z -interval 0 -exportFolder "C:\TeleportExport\"