Geocaching Australia API: Add Image to Log Entry
Add an image for a log for a geocache
Geocaching Australia API call: https://geocaching.com.au/api/services/logs/images/add/
Parameters not explicitly detailed will be silently ignored if passed.
Calling the method
This method may only be called using a POST method. Any attempt to call via a GET method will return an error. The use of a POST method ensures that data are not passed by URL.
The enctype should be multipart/form-data. No characters are encoded. This value is required when you are using forms that have a file upload control.
Example form:
<form enctype='multipart/form-data' action='https://geocaching.com.au/api/services/logs/images/add/' method='post'>
consumer_key: <input name='consumer_key' type='text' value=''>
image: <input name='image' type='file'>
log_uuid: <input name='log_uuid' type='text' value=''>
caption: <input name='caption' type='text' value=''>
description: <input name='description' type='text' value=''>
<input name='button' type='submit' value='Submit'>
</form>
<form enctype='multipart/form-data' action='https://geocaching.com.au/api/services/logs/images/add/' method='post'>
consumer_key: <input name='consumer_key' type='text' value=''>
image: <input name='image' type='file'>
log_uuid: <input name='log_uuid' type='text' value=''>
caption: <input name='caption' type='text' value=''>
description: <input name='description' type='text' value=''>
<input name='button' type='submit' value='Submit'>
</form>
Field | Definition | Description |
consumer_key | Mandatory | The api key associated with your app. |
log_uuid | Mandatory | The code that identifies the log to have the image attached. The log id must belong to the user. |
image | Mandatory | The file that is to be uploaded. JPEG, GIF and PNG only, please. |
caption | Optional | A short description for the image. |
description | Optional | A long description for the image. |
Validation
Parameter 'method' has invalid value: This method may only be submitted by a POST method.
https://geocaching.com.au/api/services/logs/images/add/
https://geocaching.com.au/api/services/logs/images/add/
Parameter 'consumer_key' has invalid value: Consumer does not exist.
Parameter 'log_uuid' has invalid value: '999999999' You are not the author of this log.
Parameter 'image' has invalid value: No image file detected.
Data Fields Returned
If the submission is successful a dictionary (array) named 'data' will be returned with the following elements.
Field | Description |
success | Boolean true if submission is successful. |
message | Your log image has been updated. |
log_uuid | The unique image ID for this log entry. |
If the submission is not successful as an error has occurred in the image processing a dictionary (array) named 'data' will be returned with the following elements.
Field | Description |
success | Boolean false if submission is not successful. |
message | Various error messages from the image processing software. |
location | null |