Triggers
Triggers allow your DroneDeploy App to respond to events happening on the DroneDeploy Platform. For example, you may want to kick off a pre-defined export once your map completes processing.
Triggers are associated with an App's Function. In order for a Trigger event to fire, the user who triggered the event needs to have the App installed, and the Function should have a Trigger defined. You can define Triggers using the DroneDeploy CLI
and the serverless.yml
file. For example:
Listening to Triggers
Currently there is a reserved path under /__ddtriggerfunction
on each DroneDeploy Function for listening to Trigger events.
Your code might look something like this:
You can check out our sample app to see how Triggers are handled.
Supported Triggers
We currently support the following Triggers:
Export:complete
Folder:created
MapPlan:complete
MapPlan:workflow_job_complete
ProgressPhotos:complete
ProgressPhotosPlan:complete
Project:created
Plan:deleted
StandAssessmentPlan:json_uploaded
Manually Executing Trigger Handler
Note: These instructions are specific to a user with admin privileges
Log into DroneDeploy and retrieve your scoped JWT token. See here for more info on retrieving a token.
In Postman (or other REST client) use this token to set the
Authorization
header for the API requestUsing Postman, build a
POST
request tohttps://www.dronedeploy.com/api/v2/trigger
which executes function triggers on-demand.Executing the
POST
request should result in a 200 OK with{}
as the response if successful
Troubleshooting
Attempting to execute a trigger function and receiving a 403
If you are attempting to trigger a function and receiving a 403, it’s potentially because the payload is incorrect.
Make sure that:
You are an organization admin
The bearer token provided belongs to your user
The
user_id
is your user's IDobject_id
is required in the “trigger” API payload and be an ID of the type of object for the trigger (i.e. Map Plan ID, Export ID, Folder ID, etc..)
Non-admin users must authenticate with their API key as a query param. The user_id
is not necessary in the data object as it will be derived from the API key.
Example public request url: https://public-api.dronedeploy.com/v2/trigger?api_key=<api_key>
Last updated