View source: R/odkc_as_survey_media.R
odkc_as_survey_media | R Documentation |
ODKC SiteVisitStart/End as WAStD SurveyMediaObservations
odkc_as_survey_media(data)
data |
ODKC Data, e.g. |
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.
## 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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.