About# Here we list all the available endpoints from Leaf's Configuration API. To call them easily, we recommend using Leaf's Postman collection .
All HTTP methods should be prepended by this service's endpoint:
Copy https://api.withleaf.io/services/config/api
This service has the following endpoints available:
Endpoints# Get API Owner's Configuration# Â GET /configs
Gets the configuration of the API Owner.
Copy TOKEN = YOUR_TOKEN
curl -X GET \
-H "Authorization: Bearer ${TOKEN} " \
"https://api.withleaf.io/services/config/api/configs"
Response# A JSON containing the configuration of the API Owner.
Copy {
"apiOwnerUsername" : "api-owner" ,
"leafUserId" : "" ,
"operationsImageCreation" : true ,
"geoimagesResolution" : 0.00001 ,
"geoimagesShape" : "SQUARE" ,
"geoimagesProjection" : "EPSG:3857" ,
"geoimagesColorRamp" : {
"0%" : [ 200 , 0 , 0 ] ,
"35%" : [ 255 , 40 , 0 ] ,
"45%" : [ 255 , 150 , 0 ] ,
"55%" : [ 255 , 240 , 0 ] ,
"65%" : [ 0 , 230 , 0 ] ,
"75%" : [ 0 , 190 , 0 ] ,
"100%" : [ 0 , 130 , 0 ] ,
"nv" : [ 0 , 0 , 0 , 0 ]
} ,
"fieldsAutoSync" : true ,
"fieldsMergeIntersection" : 0.01 ,
"fieldsAttachIntersection" : 0.01
}
Get Leaf User's Configuration# Â GET configs/{leafUserId}
Gets the configuration of a Leaf User.
Copy TOKEN = YOUR_TOKEN
LEAF_USER_ID = 00000000-0000-0000-0000-000000000000
curl -X GET \
-H "Authorization: Bearer ${TOKEN} " \
"https://api.withleaf.io/services/config/api/configs/ ${LEAF_USER_ID} "
Response# A JSON containing the configuration of the Leaf User.
Copy {
"apiOwnerUsername" : "api-owner" ,
"leafUserId" : "00000000-0000-0000-0000-000000000000" ,
"operationsImageCreation" : true ,
"geoimagesResolution" : 0.00001 ,
"geoimagesShape" : "SQUARE" ,
"geoimagesProjection" : "EPSG:3857" ,
"geoimagesColorRamp" : {
"0%" : [ 200 , 0 , 0 ] ,
"35%" : [ 255 , 40 , 0 ] ,
"45%" : [ 255 , 150 , 0 ] ,
"55%" : [ 255 , 240 , 0 ] ,
"65%" : [ 0 , 230 , 0 ] ,
"75%" : [ 0 , 190 , 0 ] ,
"100%" : [ 0 , 130 , 0 ] ,
"nv" : [ 0 , 0 , 0 , 0 ]
} ,
"fieldsAutoSync" : true ,
"fieldsMergeIntersection" : 0.01 ,
"fieldsAttachIntersection" : 0.01 ,
"fieldsAutoMerge" : true
}
Create Leaf User's Configuration# Â POST /configs/{leafUserId}
Creates the Configuration for the Leaf User leafUserId
. A request body must be provided
containing the configurations to be set. All entries are optional, any missing configuration will be inherited from the API Owner's Configuration.
Request body example:
Copy {
"operationsImageCreation" : true ,
"fieldsAutoSync" : true
}
Copy TOKEN = YOUR_TOKEN
LEAF_USER_ID = 00000000-0000-0000-0000-000000000000
curl -X POST \
-H "Authorization: Bearer ${TOKEN} " \
-H "Content-Type: application/json" \
-d '{ "operationsImageCreation": true, "fieldsAutoSync": true }' \
"https://api.withleaf.io/services/config/api/configs/ ${LEAF_USER_ID} "
Response# A JSON containing the configuration of the Leaf User.
Copy {
"apiOwnerUsername" : "api-owner" ,
"leafUserId" : "00000000-0000-0000-0000-000000000000" ,
"operationsImageCreation" : true ,
"geoimagesResolution" : 0.00001 ,
"geoimagesShape" : "SQUARE" ,
"geoimagesProjection" : "EPSG:3857" ,
"geoimagesColorRamp" : {
"0%" : [ 200 , 0 , 0 ] ,
"35%" : [ 255 , 40 , 0 ] ,
"45%" : [ 255 , 150 , 0 ] ,
"55%" : [ 255 , 240 , 0 ] ,
"65%" : [ 0 , 230 , 0 ] ,
"75%" : [ 0 , 190 , 0 ] ,
"100%" : [ 0 , 130 , 0 ] ,
"nv" : [ 0 , 0 , 0 , 0 ]
} ,
"fieldsAutoSync" : true ,
"fieldsMergeIntersection" : 0.01 ,
"fieldsAttachIntersection" : 0.01 ,
"fieldsAutoMerge" : true
}
Update API Owner's Configuration# Â PATCH /configs
Updates the specified fields of Configuration for the API Owner. A request body must be provided
containing the configurations to be set. All entries are optional.
Request body example:
Copy {
"operationsImageCreation" : true ,
"fieldsAutoSync" : true
}
Copy TOKEN = 'YOUR_TOKEN'
curl -X PATCH \
-H "Authorization: Bearer ${TOKEN} " \
-H "Content-Type: application/json" \
-d '{ "operationsImageCreation": true, "fieldsAutoSync": true }' \
'https://api.withleaf.io/services/config/api/configs'
Response# A JSON containing the configuration of the API Owner.
Copy {
"apiOwnerUsername" : "api-owner" ,
"leafUserId" : "" ,
"operationsImageCreation" : true ,
"geoimagesResolution" : 0.00001 ,
"geoimagesShape" : "SQUARE" ,
"geoimagesProjection" : "EPSG:3857" ,
"geoimagesColorRamp" : {
"0%" : [ 200 , 0 , 0 ] ,
"35%" : [ 255 , 40 , 0 ] ,
"45%" : [ 255 , 150 , 0 ] ,
"55%" : [ 255 , 240 , 0 ] ,
"65%" : [ 0 , 230 , 0 ] ,
"75%" : [ 0 , 190 , 0 ] ,
"100%" : [ 0 , 130 , 0 ] ,
"nv" : [ 0 , 0 , 0 , 0 ]
} ,
"fieldsAutoSync" : true ,
"fieldsMergeIntersection" : 0.01 ,
"fieldsAttachIntersection" : 0.01 ,
"fieldsAutoMerge" : true
}
Update Leaf User's Configuration# Â PATCH /configs/{leafUserId}
Updates the specified fields of Configuration for the Leaf User leafUserId
. A resquest body must be provided containing the configurations to be set. All entries are optional.
Request body example:
Copy {
"operationsImageCreation" : true ,
"fieldsAutoSync" : true
}
Copy TOKEN = YOUR_TOKEN
LEAF_USER_ID = 00000000-0000-0000-0000-000000000000
curl -X PATCH \
-H "Authorization: Bearer ${TOKEN} " \
-H "Content-Type: application/json" \
-d '{ "operationsImageCreation": true, "fieldsAutoSync": true }' \
"https://api.withleaf.io/services/config/api/configs/ ${LEAF_USER_ID} "
Response# A JSON containing the configuration of the Leaf User.
Copy {
"apiOwnerUsername" : "api-owner" ,
"leafUserId" : "00000000-0000-0000-0000-000000000000" ,
"operationsImageCreation" : true ,
"geoimagesResolution" : 0.00001 ,
"geoimagesShape" : "SQUARE" ,
"geoimagesProjection" : "EPSG:3857" ,
"geoimagesColorRamp" : {
"0%" : [ 200 , 0 , 0 ] ,
"35%" : [ 255 , 40 , 0 ] ,
"45%" : [ 255 , 150 , 0 ] ,
"55%" : [ 255 , 240 , 0 ] ,
"65%" : [ 0 , 230 , 0 ] ,
"75%" : [ 0 , 190 , 0 ] ,
"100%" : [ 0 , 130 , 0 ] ,
"nv" : [ 0 , 0 , 0 , 0 ]
} ,
"fieldsAutoSync" : true ,
"fieldsMergeIntersection" : 0.01 ,
"fieldsAttachIntersection" : 0.01 ,
"fieldsAutoMerge" : true
}
Delete Leaf User's Configuration# Â DELETE /configs/{leafUserId}
Deletes the Configuration from the Leaf User leafUserId
. Until a new Configuration is created, the Leaf User will inherit all configurations from the API Owner.
Copy TOKEN = YOUR_TOKEN
LEAF_USER_ID = 00000000-0000-0000-0000-000000000000
curl -X DELETE \
-H "Authorization: Bearer ${TOKEN} " \
"https://api.withleaf.io/services/config/api/configs/ ${LEAF_USER_ID} "