DroneDeploy
Search…
Javascript API

App Zones

API Overview

All communication to DroneDeploy is available by instantiating the global api object
1
new DroneDeploy({version: 1}).then(function(dronedeployApi){
2
console.log(dronedeployApi);
3
})
Copied!
You can listen to the result of any dronedeployApi call via promises.
1
new DroneDeploy({version: 1}).then(function(dronedeployApi){
2
dronedeployApi.Class.method(exampleParameter)
3
.then(function(response){
4
console.log(response);
5
}, function(error){
6
console.log(error);
7
});
8
});
Copied!
You can listen to the result of any call via promises.
1
dronedeployApi.Class.method(exampleParameter).then(function(response){
2
console.log(response);
3
}, function(error){
4
console.log(error);
5
});
Copied!
Note: The promise polyfill is loaded into every app. Read More about Promises
If you are subscribing to a stream of data and want to receive multiple values you should use .subscribe.
1
new DroneDeploy({version: 1}).then(function(dronedeployApi){
2
dronedeployApi.Class.method(exampleParameter).subscribe(
3
function(result){ console.log(result)},
4
function(error){ console.log(error)},
5
function(){ console.log('complete')}
6
);
7
});
Copied!
Note: This pattern is inspired by rxjs, but rxjs is not loaded into apps.
Last modified 2yr ago
Copy link