Ashcam API Documentation - WEBCAM API

Get webcam images.

GET METHODS

Select Webcam.
https://avo.alaska.edu/ashcam-api/webcamApi/webcam/{WEBCAM_CODE}

Select all Webcams.
https://avo.alaska.edu/ashcam-api/webcamApi/webcams

Get webcams in GEO JSON Format Within Predefined Area
https://avo.alaska.edu/ashcam-api/webcamApi/geojson?lat1=60&lat2=70&long1=-150&long2=-160

CREATE OR UPDATE WEBCAM

Will create webcam if not found, else update. Because image paths use the webcamCode value, it cannot be changed (once created) when using the API. The webcamCode is used for the image path so avoid spaces and special characters, it must be unique. Webcam name is displayed within the webapp and used for sorting, it is required. Other values are optional, but latitude and longitude are needed to determine if the image is daytime or nighttime. The optional vnum, volcano_name values are the value assigned by the Smithsonian Institution for a volcano webcam views.

curl -i --header "username:USERNAME" --header "password:PASSWORD" -X POST -d '{ "webcamCode":"TEST","webcamName":"Test webcam label","latitude":"90.0", "longitude":"160.0","elevationM":"900","bearingDeg":"45","externalUrl":"", "vnum":"", "vName":"", "faaInd":"N" }' https://avo.alaska.edu/ashcam-api/webcamApi/webcam

List all changes that would be made via the sync commands.
https://avo.alaska.edu/ashcam-api/webcamApi/listWebcamsToSync/{MIRROR_API_URL_ID}

Sync webcams from mirror

Adds webcams that don't exist in the database from mirror, and updates webcams that exist in the database with data from from mirror. Webcam names are not updated.

curl -Li --header "username:USERNAME" --header "password:PASSWORD" -X POST -d "mirror_api_url=https://avo-volcview.wr.usgs.gov/ashcam-api/" https://avo.alaska.edu/ashcam-api/webcamApi/syncWebcamsFromMirror

Add webcams from mirror

Adds webcams that don't exist in the database from mirror.

curl -Li --header "username:USERNAME" --header "password:PASSWORD" -X POST -d "mirror_api_url=https://avo-volcview.wr.usgs.gov/ashcam-api/" https://avo.alaska.edu/ashcam-api/webcamApi/addWebcamsFromMirror

Sync data for webcams in local database from mirror

Updates webcams that exist in the database with data from from mirror. Webcam names are not updated.

curl -Li --header "username:USERNAME" --header "password:PASSWORD" -X POST -d "mirror_api_url=https://avo-volcview.wr.usgs.gov/ashcam-api/" https://avo.alaska.edu/ashcam-api/webcamApi/syncWebcamDataFromMirror

Refresh All Webcam image information.

Refreshes the hasImages and newestImage values for all webcams.

curl -i --header "username:USERNAME" --header "password:PASSWORD" -X POST https://avo.alaska.edu/ashcam-api/webcamApi/refreshAll

ARCHIVE FUNCTIONS

Update Archive Status for All Webcams

Checks for a webcam's archive folder and updates the archive status for each webcam accordingly.

curl -i --header "username:USERNAME" --header "password:PASSWORD" -X POST https://avo.alaska.edu/ashcam-api/webcamApi/updateWebcamArchiveStatus

Get archived webcams

Returns a list of webcams that have archived images.

https://avo.alaska.edu/ashcam-api/webcamApi/archivedWebcams

Get webcam record of specific archive webcam

Returns a JSON record of a webcam that has archived images.

https://avo.alaska.edu/ashcam-api/webcamApi/archive/webcam/{WEBCAM_CODE}

UPDATE CLEAR IMAGE INFORMATION

Copies webcam image from image directory to clear image directory. Enables clear image slider in webcam viewer. The imageIdentifier value can be either the imageID or the image md5 value.

curl -i --header "username:USERNAME" --header "password:PASSWORD" -X GET https://avo.alaska.edu/ashcam-api/webcamApi/assignClearImage/{WEBCAM_CODE}/{imageIdentifier}

Pull clear images from mirror

Copies clear images from mirror to local clear image directory. Enables clear image slider in webcam viewer.

curl -i --header "username:USERNAME" --header "password:PASSWORD" -X GET https://avo.alaska.edu/ashcam-api/webcamApi/retriveClearImages/{MIRROR_API_URL_ID}

Get Webcams associated with volcano

Returns a list of webcams associated with a volcano.

https://avo.alaska.edu/ashcam-api/webcamApi/volcanoWebcams?volcano={VOLCANO_CODE}

Get Webcams in a list

Returns all webcams in a list.

https://avo.alaska.edu/ashcam-api/webcamApi/webcamList?list={LIST_NAME}

UPDATE WEBCAM Volcano Info

Sets the vnum and volcano name for selected webcam.

curl -i --header "username:USERNAME" --header "password:PASSWORD" -X POST -d '{ "webcamCode":"TEST","vnum":"", "vName":"" }' https://avo.alaska.edu/ashcam-api/webcamApi/assignVolcano