Impact Summary Totals
Description
Returns the weighted totals (amount * impact multiplier) for each Impact Type Category made for given company or application. Result can be further limited to a single user.
GET
https://impact.dots.eco/api/v1/impact/summary-totals?company={company_id}&app_token={app_token}&user={remote_user_id}
Please check Headers and authorization.
Parameters
company
- required*,integer
- The ID of a company.app_token
- required*,string
- The app identifier, it can be found in the app dashboard. Accepts multiple values (separated by a comma).user
- optional,string
- The remote ID of a user.
* = One of the parameters company
or app_token
is mandatory.
Both parameters can be provided, but this will effectively return results filtered by application token, so it will be equal
to the results of only providing the app_token
.
Example request
The minimal request that will work
curl --location --request GET 'https://impact.dots.eco/api/v1/impact/summary-totals?company=33&app_token=65-b156f001&user=testuser' \
--header 'Content-Type: application/json' \
--header 'auth-token: YOUR_AUTH_TOKEN' \
--data-raw '{
}'
curl --location --request GET 'https://impact.dots.eco/api/v1/impact/summary-totals?company=33&app_token=65-b156f001,63-f1758578&user=testuser' \
--header 'Content-Type: application/json' \
--header 'auth-token: YOUR_AUTH_TOKEN' \
--data-raw '{
}'
Example response
success
{
[integer]: {
"impact_type_category_name": [string],
"impact_unit": [string],
"total": [string],
"unit_text": [string],
"unit_html": [string],
"action_in_past_tense": [string],
"icon": [string]
}
}
Status:200 OK
Key/Value pairs response body
[integer]
- The ID of an Impact Type Category."impact_type_category_name": [string]
- The label of the Impact Type Category."impact_unit": [string]
- The impact unit."total": [string]
- A string representing the amount of total impact for this Impact Type Category (Total number * impact multiplier)."unit_text": [string]
- The impact unit text"unit_html": [string]
- The impact unit HTML."action_in_past_tense": [string]
- The impact action in past tense."icon": [string]
- The URL of impact type category icon.
The above can appear multiple times in the success response, if there are multiple Impact Type Categories.
Example success response
{
"19": {
"impact_type_category_name": "Carbon offset",
"impact_unit": "Kg of carbon emissions",
"total": "12",
"unit_text": "kg",
"unit_html": "<p>kg</p>",
"action_in_past_tense": "offsetted",
"icon": "https://impact.dots.eco/sites/default/files/2023-10/jangomo%20love%20the%20oceans.png"
},
"20": {
"impact_type_category_name": "Save a Sea Turtle",
"impact_unit": "sea turtle hatchling",
"total": "1",
"unit_text": "turtles",
"unit_html": "<p>turtles</p>",
"action_in_past_tense": "saved",
"icon": "https://impact.dots.eco/sites/default/files/2023-10/jangomo%20love%20the%20oceans.png"
}
}
Status:200 OK
Possible error responses
Incorrect app_token
{
"message": "Access denied. You are not a manager of specified company or company that specified app belongs to."
}
Status:403 Forbidden
No app_token and no company query parameter provided
{
"message": "You must provide a value for 'app_token' and/or 'company' query parameter."
}
Status:422 Unprocessable Entity
No results found for specified query parameters
{
"message": "No results found for specified criteria."
}
Status:404 Not Found