-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Hey CalTopo-python-er(s),
Has anyone figured out the secret to uploading images?
From what I can tell, it's a 3-step dance.
-
POST request to
https://caltopo.com/api/v1/media/<UUID_FOR_IMAGE>with a json payload{"properties":{"creator":"<USER_ID>","filename":"test_image.jpg","exifCreatedTZ":"America/Vancouver"}} -
POST request to
https://caltopo.com/api/v1/media/<UUID_FOR_IMAGE>/datawith the json payload{"data":"/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBw0NDQ0.... <BIG LONG URL-SAFE BASE64-ENCODED IMAGE> ...} -
POST request to
https://caltopo.com/api/v1/map/<MAP_ID>/MapMediaObjectcontaining the marker object, with reference to the image{"type":"Feature","id":null,"geometry":{"type":"Point","coordinates":[<LONGITUDE>,<LATITUDE>]},"properties":{"parentId":"","backendMediaId":"<UUID_FOR_IMAGE>","title":"test_image.jpg","heading":null,"description":"","marker-symbol":"aperture","marker-color":"#FFFFFF","marker-size":1}}
Step 1 works..
But I'm stuck at step 2 - getting a 500 server error in the response, and am at a bit of a loss as to why..
I'm working in Kotlin - otherwise I'd just post the code as a branch here.
Thanks all for any input! Will post the solution if I find it.