Welcome to the Mangocam API version 1.5
========================================

Please be aware this API will be retired at the end of June 2016.

The documentation forms part of the API.

All responses with the exception of the: help, echo, jpeg and mjpeg pages are JSON formatted for ease of parsing.

Most pages require a cookie / session to be sent for authentication (this is set during login).

Mangocam accepts no responsibility for third party use.

Please advise if you are planning to use our API extensively (more than 500 calls per day).

The API (especially the login page) should be used via HTTPS.

Usage: https://www.mangocam.com/mapi.php?cmd=COMMAND

Example: https://www.mangocam.com/mapi.php?cmd=login:b3Blbg==:c2VzYW1l
      => {"Login":[{"error":"1", "response":"Error, incorrect username or password"}]}
      => example user name / password: open / sesame

Command                              Description
================================================
echo					# test echo
version					# show API version
help					# show API documentation (this page)
login:username:password			# login using user / base64 encoded username and password - creates valid authenticated session
logout                               # logout, destroy session
getusrinfo                           # get user data, time zone, email, 24h, membership
getcaminfo                           # get list of cameras
getalertinfo                         # get list of alerts # NEW
getgrpinfo                           # get list of groups
getschedinfo                         # get schedule info
getallinfo                           # get user, cameras, groups, schedules and alerts in one call (as required for the dashboard)
enablecam:id                         # enable camera with id - returns OK or ERR
disablecam:id                        # disable camera with id - returns OK or ERR
enablesched:id                       # enable schedule with id - returns OK or ERR
disablesched:id                      # disable schedule with id - returns OK or ERR
enablealert:id                       # enable alert with id - returns OK or ERR
disablealert:id                      # disable alert with id - returns OK or ERR
viewlive:id:x:y                      # get live (mjpeg) stream for camera id - with x*y resolution (x=640 y=480, x=320 etc.) - use this first, will redirect
viewliveloc:id:x:y                   # get live (mjpeg) stream for camera id - with x*y resolution (x=640 y=480, x=320 etc.) - locally
geteventlog                          # get system event log for the user - last 250 lines
getmotevents                         # get motion events for user - last 250 lines
showframe:chunk:frame:x:y            # get single jpeg image at location chunk_id, frame_id with x*y resolution
getrecs:id                           # get list of available recordings / chunks for all cameras for the last 3 days only - if id is set, only for camera id
                                     # if the chunks have the same grab_start time stamp, they belong together and need to be added up (time, size, frames)
getcrecs:id                          # as above, but chunks have been combined to 8 hour max recordings - and only for the last 24 hours
startrec:id:mins                     # start instant recording of camera id for mins minutes (5,10,20,60,120,240)
playrec:camid:grabstart:starttime    # play recording (mjpeg stream - currently always 640x480 or whatever has been recorded / uploaded)
getplayloc:id                        # get current player location for camera id (in unix epoch seconds)
playcmd:id:cmd                       # send control command to current recording (pause, play, skip, fast forward etc.)

available playback commands:

pause      = pause playback
play       = resume
fwd        = increase / double fast forward speed
skip5      = skip 5 minutes forward
skip20     = skip 20 minutes forward
skip60     = skip 1 hour forward
back       = rewind to the beginning of the chunk or the last (about 5 mins max)
next       = single frame forward, pauses playback
rec        = save the currently displayed picture in snapshots
nextmotion = forward to the next motion event
number     = skip to position (unix epoch time, needs to be between starttime and endtime)

# not implemented yet, coming in a later version:
# / stoprec:id # stop recording of camera id
# adding / editing of schedules, cameras, groups, alerts etc.

Please send any queries or feedback to: support@mangocam.com. 

Thanks for your interest and support.