Follow

Triggers/API

For technical users who would like to have certain events that occur in dslrBooth trigger an external action, dslrBooth offers Triggers.

Triggers are useful for integrating lights, sounds and other applications with dslrBooth. This will have dslrBooth call an application or a URL when certain events happens. You can set Triggers under: Settings > General > Triggers.

Event Types

The following event types are currently sent:

  • session_start [booth_mode] - When session starts.
  • countdown_start [seconds] - When countdown first starts.
  • countdown [percent complete] - Updates with percentage of countdown complete.
  • capture_start - When app tells camera to capture a photo.
  • file_download [name_of_file_from_camera] - When a file is received from the camera.
  • processing_start - When processing of template, gif, boomerang, or video starts after capture is complete.
  • sharing_screen - When sharing screen is displayed.
  • printing - When application is starting to print.
  • session_end - When sharing screen completes and start screen is about to display.

Here are some sample events that you can receive:

16:20:7.287 { event_type: 'session_start', param1: 'PrintAndGIF' }
16:20:7.839 { event_type: 'countdown_start', param1: '5' }
16:20:12.624 { event_type: 'countdown', param1: '20' } 16:20:12.624 { event_type: 'countdown', param1: '50' } ... 16:20:12.624 { event_type: 'countdown', param1: '100' } 16:20:12.626 { event_type: 'capture_start' } 16:20:13.626 { event_type: 'file_download', param1: '20180202_162013_455.jpg' } 16:20:17.559 { event_type: 'processing_start' } 16:20:30.576 { event_type: 'sharing_screen' } 16:19:47.130 { event_type: 'printing' }
16:19:57.130 { event_type: 'session_end' }

Triggers to URL

The previous log was generated using this NodeJS but you can do the same in any programming language:

const express = require('express')
const app = express()

app.get('/', function(req, res){
  var today = new Date();
  var time = today.getHours() + ":" + today.getMinutes() + ":" + today.get
Seconds() + "." + today.getMilliseconds();
  console.log(time, req.query);
  res.send('Parameters received: '+ JSON.stringify(req.query));
});
app.listen(3000) ;

Triggers to Application

Similarly, the trigger can execute an application with command line arguments.

[appname.exe] [EventType] [param1?] [param2?]
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

15 Comments

  • 0
    Avatar
    Ely Miranda

    Nice.  Will there be anymore documentation?  For instance, what does file_download pertain to?  Is this the session print?

  • 0
    Avatar
    Mike

    We just updated the documentation. Let us know if you have any other questions.

  • 0
    Avatar
    Sebastian Böhm

    Hi, would it also be possible, to write those status in a log file? Another booth software I use simply writes the current states into a log file, overwriting the old. Thus, I always have a short info, what state the booth is currently in :-)

  • 0
    Avatar
    Mike

    Hey Sebastian,

    It should be rather simple to do this using the Trigger to Application with a dos batch file with the following contents:

    :: contents of status.bat
    @echo off
    echo %* > status.txt
    Edited by Mike
  • 0
    Avatar
    Julien Duijsens

    Hello, congratulations for this work, the application is really well thought. 

    I do not quite understand the command line that must be called to run the .bat. 
     
    Could you enlighten me? It's like this?
    C:\photobooth\status.bat [capture_start] 
     
     
  • 0
    Avatar
    Marco

    Hi,

    this is really great stuff!

    I managed to connect dslrBooth with a power automation system and a database. And there are so many more things we can do now!

    As I was (one of) the guy(s) who requested this feature...: Is it too early to ask for enhancements? ;-) Here are my favorite 3:

    1. Please add the number of prints (fortunately the return codes for event "printing" are free for this.

    2. Please return which template was used for creating the prints. Maybe as return code of processing_start?!

    3. If would be much easier to code if you please could return the percentage at "countdown" always as 3-digit number with leading zeros.

    I am really looking forward getting more and more opportunities with your API!

    Thanks a lot, best,

    Marco.

  • 0
    Avatar
    Sebastian Böhm

    Like Julien, I'm afraid i do not understand how this works. The batchfile itself works, cmd-line parameters are written directly into the textfile when i try it manually.

    But it seems, the file itself is not being executed when using dlsrbooth?

     

    Also, the actual printcount would be much appreciated.

    Edited by Sebastian Böhm
  • 0
    Avatar
    Mike

    Yes, dslrBooth will start a new process and run the application you set under Triggers > Application. It's likely the text file is getting written to but in a different directory. Try this instead to specify the full path to the text file.

    echo %* > c:\temp\status.txt
  • 0
    Avatar
    Sebastian Böhm

    You were right, I need to use the full path.

    It works, awesone, thanks!

  • 0
    Avatar
    Andrea

    hi, I would like to start a 20 second application at the start of the first countdown. Could I receive the correct text string to type?

  • 0
    Avatar
    Julien Duijsens

    with the full link to the file, it works great! I like this soft !!!!

    Is it possible to have an event when the application starts and when it stops?

  • 0
    Avatar
    Rakesh574

    Hi Mike, Is there a way to filter out the event that I want instead of getting all of the generated events? Thanks 

  • 0
    Avatar
    Mike

    You'd have to filter in your own code/script.

  • 0
    Avatar
    Master Mark

    Hi guys what command would i use to turn on my leds then off again

    before a camera trigger

    countdown_start

    capture_start  ??

  • 0
    Avatar
    Nacho DM

    Hi, I imagine that this would seem very beginner, but someone could put a link to a website that explains how to program, is that I'm interested but I have no idea what is being talked about here

Please sign in to leave a comment.