odkc_as_survey_media: ODKC SiteVisitStart/End as WAStD SurveyMediaObservations

View source: R/odkc_as_survey_media.R

odkc_as_survey_mediaR Documentation

ODKC SiteVisitStart/End as WAStD SurveyMediaObservations

Description

ODKC SiteVisitStart/End as WAStD SurveyMediaObservations

Usage

odkc_as_survey_media(data)

Arguments

data

ODKC Data, e.g. odkc_data.

Value

A tibble of records which can be uploaded ONE BY ONE to WAStD's SurveyMediaAttachment API as per function examples. The field "attachment" has to be turned into an httr::upload_file before upload.

Examples

## Not run: 
wastdr::wastdr_setup(api_url = Sys.getenv("WASTDR_API_DEV_URL"),
                     api_token = Sys.getenv("WASTDR_API_DEV_TOKEN"))
drake::loadd(odkc_ex)
x <- odkc_as_survey_media(odkc_ex)
upload_survey_media(x)


# Outside R, using curl (with correct auth token)
curl -i -X POST
  -H 'Authorization: Token c5575c09f6a0171668f31d5dd5013f02658668bd'
  -F 'attachment=@my_photo.jpg'
  -F survey_source=odk
  -F survey_source_id=5f027f76-7276-11eb-8ce8-e9c53fd9c3f2
  -F source=2
  -F source_id=5f027f76-7276-11eb-8ce8-e9c53fd9c3f2-photo-start
  -F title='Photo site conditions at start of survey'
  http://localhost:8220/api/1/survey-media-attachments/

## End(Not run)

dbca-wa/etlTurtleNesting documentation built on Nov. 18, 2022, 8:03 a.m.