I am currently using leaflet.js to generate polygons and I would like to add them to my table in cartodb. I.e. a geojson object :
{
"type": "Feature",
"properties": {
"name": "wing1"
},
"geometry": {
"type": "Polygon",
"coordinates": [
[
[
-60.1171875,
54.16243396806781
],
[
5.9765625,
70.0205873017406
],
[
41.484375,
49.15296965617039
],
[
11.25,
1.0546279422758869
],
[
-60.1171875,
54.16243396806781
]
]
]
}
},
I am aware I can use the following api to insert new data to cartodb table.
https://{username}.carto.com/api/v2/sql?q=INSERT INTO test_table (column_name, column_name_2, the_geom) VALUES ('this is a string', 11, ST_SetSRID(ST_Point(-110, 43),4326))&api_key={api_key}
But can someone explain to me how I can send a geojson object using the existing api?