Closed arugifa closed 1 year ago
I've never tried with Mapbox, but I signed up just now to try it. Here's what worked for me.
URL
https://api.mapbox.com/datasets/v1/xxxxxxxxxxxx/xxxxxxxxxxxxxxxx/features/%TIMESTAMP?access_token=sk.xxxxxxxxxxxxxxxxx
In your example did you substitute the username and datasetid and access token with your own values?
HTTP Body
{"id": "%TIMESTAMP", "type": "Feature", "geometry": { "type": "Point", "coordinates": [ %LON, %LAT ] }, "properties":{}}
I think that this needs to be long-lat, because it's GeoJSON.
HTTP Headers
Content-Type: application/json
HTTP Method
PUT
Wow, thanks a lot for the test, and your quick answer! :star_struck:
I gave a try to reversing latitude-longitude order, but it didn't help (to solve the HTTP request failure; but you were right, I was setting them in the wrong order).
So I did like you, and also added an empty properties
dictionary to the HTTP body, and it worked! :smiley:
Hope it will help other people who want to use MapBox too.
Thanks a lot for your help, work, and great app :)
No worries, good to know.
I am trying to use the custom URL feature in order to update a dataset on MapBox.com, but without any success until now.
I think it should be possible, but I might do something wrong.
According to MapBox's documentation, I should send a PUT request with a new feature to an already created dataset. So here is how I configured GPS Logger:
URL:
https://api.mapbox.com/datasets/v1/{username}/{dataset_id}/features/%TIMESTAMP?access_token={access_token}
HTTP Body:{"id": "%TIMESTAMP", "type": "Feature", "geometry": { "type": "Point", "coordinates": [ %LAT, %LON ] } }
HTTP Headers:Content-Type: application/json
HTTP Method: PUTI validated SSL certificate with success. But when looking in the logs, I can see:
Have you already tried to upload GPS points to Mapbox?
Also, not sure if the HTTP response is truncated. It might contain more information about the problem. But it looks like my JSON payload is somehow invalid :thinking: