The More Trees public API with basic authorisation, allows you to retrieve information from More Trees and send tree planting requests.
If you require any support, please email info@moretrees.eco.
Access the public validation and public API keys via the platform.
Use the appropriate TreeIdentifier when setting up the 'plant a tree' API.
Project | Type | TreeIdentifier | CO2 | Credits |
---|---|---|---|---|
Any project | Most needed tree | any_tree | 0.3 | 1 |
Madagascar | Most needed tree | most_needed_madagascar | 0.3 | 1 |
Kenya | Most needed tree | most_needed_kenya | 0.3 | 1 |
Haiti | Most needed tree | most_needed_haiti | 0.3 | 1 |
GET
https://api.moretrees.eco/v1/basic/viewCredits
Get total number of available credits.
Key | Value |
---|---|
authorization | Public validation key |
You can find the public validation key under Integration → API on the platform https://plant.moretrees.eco/manage/API
200
{
"status": 1,
"response": "successful",
"message": "Total {number} credits are available.",
"data": {
"credits": {number}
}
}
400
{
"errors": [
{
"status": 0,
"response": "error",
"message": "{Error message from server}"
}
]
}
GET
https://api.moretrees.eco/v1/basic/carbonOffset
Get set of total carbon sequestration, including carbon sequestration by self, for others, by others on your behalf, and total.
Key | Value |
---|---|
authorization | Public validation key |
You can find the public validation key under Integration → API on the platform https://plant.moretrees.eco/manage/API
200
{
"status": 1,
"response": "successful",
"message": "Carbon offset found.",
"data": {
"carbon_offset_by_self": "carbon offset done by self",
"carbon_offset_for_others": "carbon offset done for others",
"carbon_offset_by_others_for_you": "carbon offset done by others for you",
"total_carbon_offset": "total carbon offset"
}
}
400
{
"errors": [
{
"status": 0,
"response": "error",
"message": "{Error message from server}"
}
]
}
GET
https://api.moretrees.eco/v1/basic/viewTypes
Get all active tree types with details including Project Name, Project ID, Category Name, Category ID, Type ID, Type Name, Type Description, Type Image, CO2 Reduction and required credits to plant this tree type.
Key | Value |
---|---|
authorization | Public validation key |
You can find the public validation key under Integration → API on the platform https://plant.moretrees.eco/manage/API
Parameter | Description |
---|---|
Page (optional) | You can pass integer value in this or “all” string. If integer value is passed then API considers this as a page number. This parameter enables paginating functionality for API and API will behave according to the page number. If you want all records without paginating results then simply pass “all” or don’t pass the page parameter. |
200
{
"status": 1,
"response": "successful",
"message": "Carbon offset found.",
"data": [
{
{List of all types with details}
},
{
"total_records": {total records found},
"current_page": {page parameter value},
"total_pages": {total number of page available},
"records_per_page": {per page displaying records}
}
]
}
200
{
"status": 1,
"response": "successful",
"message": "Carbon offset found.",
"data": {
{List of all types with details}
},
}
400
{
"errors": [
{
"status": 0,
"response": "error",
"message": "{Error message from server}"
}
]
}
POST
https://api.moretrees.eco/v1/basic/planttree
Send a request to plant a tree or multiple trees for the user, or to third parties.
Note that when planting a tree for a third party, the third party will receive an email about their tree. This email can be customised in the platform settings (Settings → Email template).
Key | Value |
---|---|
authorization | Public validation key |
You can find the public validation key under Integration → API on the platform https://plant.moretrees.eco/manage/API
Position: JSON object
Parameter | Description |
---|---|
type_slug (required) | This parameter will accept tree slug (you can download the tree slug list from the platform (Integration > API > Tree list). If the wrong slug is passed it will return an error message in response. The type_slug is also called treeidenitfier on some files. |
request_type (required) | There are two types available for request_type parameter. You need to pass 1 if you are planting tree for self or pass 2 if you are planting tree for others. If you pass any other number (except 1 or 2) then error message will be returned in response. |
quantity (required if request_type is 1) | If planting trees for self, the quantity of the trees pass with this parameter. This will only accept numerical values greater than zero. If 0, null and any other string will not be accepted. |
users (required if request_type is 2) | If planting tree for others, you must pass a JSON object as this parameter detailed in the example snippets below. |
{
"first_name": "John",
"email": "john@example.ecom",
"quantity": 8,
"sender_name": "[name] (optional)"
}
[
{
"first_name": "John",
"email": "john@example.ecom",
"quantity": 8,
"sender_name": "[name] (optional)"
},
{
"first_name": "Adam",
"email": "adam@example.ecom",
"quantity": 5
}
]
200
{
"status": 1,
"response": "successful",
"message": "Plant tree request submitted successfully",
"data": {
"certificates": [
{
"name": "John",
"email": "john@example.ecom",
"certificateID": "e66lq7dwkhbz5959e66lq7dwkhbz595a",
"certificateURL": "https://login.thgcarboncapture.com/certificate/e66lq7dwkhbz5959e66lq7dwkhbz595a"
},
{
"name": "Adam",
"email": "adam@example.ecom",
"certificateID": "e66lq7dwkhbz5959e66lq73rwy5cda3u",
"certificateURL": "https://login.thgcarboncapture.com/certificate/e66lq7dwkhbz5959e66lq73rwy5cda3u"
}
]
}
}
400
{
"errors": [
{
"msg": "{parameter name} is not valid or missing",
"param": "error",
"location": "body"
}
]
}
Error responses will have individual error messages for every missing/invalid parameter.
400
{
"errors": [
{
"status": 0,
"response": "error",
"param": "users",
"msg": "users object is not valid! Or missing parameter (name, email, quantity)"
}
]
}
GET
https://api.moretrees.eco/v1/basic/getInfo
Key | Value |
---|---|
authorization | Public validation key |
You can find the public validation key under Integration → API on the platform https://plant.moretrees.eco/manage/API
200
{
"message": "successfully",
"data": {
"credits": 19,
"forest_name": "Alan",
"saved_co2": 25.2,
"quantity_planted": 31,
"quantity_gifted": 53,
"quantity_received": 88,
"forest_url": "https://www.moretrees.eco/forest/Alan/"
}
}