Records
As the name suggests, this endpoint allows you to retrieve impact records. On this page, we'll dive into how you can retrieve your impact records or your customer impact records programmatically. If you made an impact on behalf of your customers, those records would appear under customer records.
Retrieve your impact records
This endpoint allows you to query your impact records. Refer to customer records at the bottom to see how to query customer impact records.
Optional query params
- Name
filter_by
- Type
- string
- Description
The impact type of the records you want to query. The value for
filter_by
could be either "tree_planted", "waste_removed", "carbon_captured" or "money_donated". You can provide multiple values forfilter_by
as separate query parameters. For example, '/records?filter_by=carbon_captured&filter_by=waste_removed'.
- Name
start_date
- Type
- string
- Description
The start date after which you want to query the records. The
start_date
should be in the format yyyy-mm-dd.
- Name
end_date
- Type
- string
- Description
The end date up to which you want to query the records. The
end_date
should be in the format yyyy-mm-dd.
- Name
limit
- Type
- integer
- Description
Limit the number of records returned. The default value is 10. The value must be between 0 and 1000.
- Name
cursor
- Type
- string
- Description
The cursor from the response can be used as query parameter in the next request to fetch the subsequent list of records. Refer to Pagination section for more details.
Request
curl --location 'https://api.1clickimpact.com/v1/records' \
--header 'x-api-key: {PRODUCTION API KEY}'
Response
{
"user_records":
[
{
"user_id": "U123",
"time_utc": "2024-09-16T20:30:13.391Z",
"carbon_captured": 5
},
{
"user_id": "U123",
"time_utc": "2024-09-17T13:24:04.429Z",
"waste_removed": 15
},
{
"user_id": "U123",
"time_utc": "2024-09-17T14:32:01.638Z",
"tree_planted": 10
},
{...},
{...}
],
"cursor": "fNJjcmV32dGVkTiOiIyMDI0LTA3LTidXNlcklE3UiVTk2OTQ0MDcwIpT"
}
Retrieve customer impact records
This endpoint allows you to query customer impact records for all or a specific customer.
Optional query params
- Name
customer_email
- Type
- string
- Description
The email of the customer whose records you want to retrieve.
- Name
filter_by
- Type
- string
- Description
The impact type of the records you want to query. The value for
filter_by
could be either "tree_planted", "waste_removed", "carbon_captured" or "money_donated". You can provide multiple values forfilter_by
as separate query parameters. For example, '/customer-records?filter_by=carbon_captured&filter_by=waste_removed'.
- Name
start_date
- Type
- string
- Description
The start date after which you want to query the records. The
start_date
should be in the format yyyy-mm-dd.
- Name
end_date
- Type
- string
- Description
The end date up to which you want to query the records. The
end_date
should be in the format yyyy-mm-dd.
- Name
limit
- Type
- integer
- Description
Limit the number of records returned. The default value is 10. The value must be between 0 and 1000.
- Name
cursor
- Type
- string
- Description
The cursor from the response can be used as query parameter in the next request to fetch the subsequent list of records. Refer to Pagination section for more details.
Request
curl --location 'https://api.1clickimpact.com/v1/customer_records' \
--header 'x-api-key: {PRODUCTION API KEY}'
Response
{
"customer_records":
[
{
"user_id": "U123",
"customer": {
"customer_id": "U1234",
"customer_email": "sample-customer-1@email.com",
"customer_name": "Sample Customer 1"
},
"time_utc": "2024-06-12T15:22:14.753Z",
"waste_removed": 40
},
{
"user_id": "U123",
"customer": {
"customer_id": "U789",
"customer_email": "sample-customer-2@email.com",
"customer_name": "Sample Customer 2"
},
"time_utc": "2024-06-15T16:41:58.323Z",
"carbon_captured": 50
},
{
"user_id": "U123",
"customer": {
"customer_id": "U5678",
"customer_email": "sample-customer-3@email.com",
"customer_name": "Sample Customer 3"
},
"time_utc": "2024-06-21T18:16:02.083Z",
"tree_planted": 10
},
{
"user_id": "U123",
"customer": {
"customer_id": "U3456",
"customer_email": "sample-customer-4@email.com",
"customer_name": "Sample Customer 4"
},
"time_utc": "2024-06-21T20:34:35.913Z",
"money_donated": 1000
},
{...},
{...}
],
"cursor": "eyJjcmVhdGVkT24iOiIyMDI0LTA3LTidXNlcklEIjoiVTk2OTQ0MDcwIn0="
}