A list in the API is an exported list from Position Green. The documentation for endpoints related to Lists is detailed below. To test the endpoints please go to our Swagger UI page.
Query lists
GET/lists
query parameters | |
first | integer (int32) |
after | nullable string |
Response | |
Success | |
Body | |
totalCount | nullable integer (int64) |
pageInfo | External.API.V1.Controllers.PageInfo (object) |
items | nullable array of External.API.V1.Controllers.Item`1[External.API.V1.Controllers.List.List] (object) |
Request
const response = await fetch('/lists', { method: 'GET', headers: {}, }); const data = await response.json();
Response
{ "totalCount": 0, "pageInfo": { "hasNextPage": false, "startCursor": "text", "endCursor": "text" }, "items": [ { "cursor": "text", "node": { "id": "123e4567-e89b-12d3-a456-426614174000", "name": "text", "prettyId": "text", "source": "text", "createdAt": "2025-01-27T12:06:27.881Z" } } ] }
This API will return meta data for each list and not its content. Content for a specific list can be fetched from https://api.positiongreen.com/v1/lists/{id}/items
Example of a response
{ "totalCount": 1, "pageInfo": { "hasNextPage": false, "startCursor": "aWs41zA=", "endCursor": "aWs41zA=" }, "items": [ { "cursor": "aWs41zA=", "node": { "id": "1f1ec12f-edb6-425a-a2d4-o03bddg1d3c5", "name": "Business", "prettyId": "business", "createdAt": "2022-03-22T11:18:58.237+00:00" } } ] }
Query list items
GET /lists/{id}/items
Path Parameters
Name | Type | Description |
id* | string |
Query Parameters
Name | Type | Description |
after | string | |
maxListItemValues | integer | |
first | integer | |
expand | array | Available options: Values |
{ // see below }
This API will return data for a specific list. An optional query parameter "expand" can be provided to retrieve more data on specific properties.
Example of a response with "expand" set to "Values."
{ "totalCount": 1, "pageInfo": { "hasNextPage": false, "startCursor": "aWR4OzA=", "endCursor": "aWR4OzA=" }, "items": [ { "cursor": "aWR4OzA=", "node": { "id": "c951196e-827f-426e-b9c1-6de65519bf3d", "name": "Regional train, Green electricity", "prettyId": "Regional_train_Green_electricity", "externalId": "", "createdAt": "2022-01-24T12:25:07.5438379+02:00", "listItemValues": [ { "id": "2e0ea5ac-bc44-468d-8336-7c2fa240a3c0", "value": "{\"factor_scope_3\":1E-17,\"unit\":\"ton CO2e/p.km\",\"source\":\"NTM (2018)\"}", "validFrom": "2022-01-01T00:00:00+00:00", "createdAt": "2022-03-24T12:25:07.5438379+02:00" } ] } } ] } ```
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article