The EcoMachter RESTful API gives you programmatic access to share (give, donate, send) adopted trees with customers, employees or other relations.
This page describes version 1.0 of the EcoMatcher RESTful API; this is the latest version.
Before you get started, you’ll need to create and account and adopt some trees. Next you need to contact us to request access to the API; this will give you a unique key which is needed for using the API.
All API resources are accessed from a base URL. This URL will be mentioned in the email you will receive with your API key.
All calls to the what3words API must be authenticated by a valid API key; this needs to be specified as an HTTP request header. If an invalid API key is passed or if the API key is missing, an HTTP status of
401 Unauthorized will be returned in both the response headers and in the response status field.
A valid API key must be passed as a request header in the form
All EcoMatcher API resources support Cross-Origin Resource Sharing or CORS. Each response from the EcoMatcher API will contain the
All responses to API requests are provided in the JSON format.
The /dcus endpoint is a resource that refers to all Digital Cause Units (DCUs). Each DCU represents one or more trees.
The /dcus endpoint accepts a request using the POST method to allocate and/or send trees to our contacts.
- A valid API key linked to your account
- Sufficient number of adopted trees available for allocating / sending to contacts
- In case you use the API to send an email: a correctly configured email template
The request body specification is described through the following JSON Schema:
Some options can be specified in the request body:
- “send_email”: true/false. Default true. If false, no email will be sent by EcoMatcher, only the trees will be allocated and codes and links returned
- “store_meta”: true/false. Default false. If true, meta data that is sent in the request (see example), and which could be used in the mail merge, will be stored by EcoMatcher after usage, for possible future use. By default this data is not stored separately after sending an email (only the email message itself is logged, if send_email=true).
- “meta_data” may include any values you would like to use in your email template or other meta_data you would like to store.