Position Green API: Tables

Modified on Tue, 21 Jul at 9:16 AM

A table in the API is an exported table from Position Green where you can design the contents of the table. The format of the response is always the same only varying on the number of columns you have set up when designing the table.


Design a table in Position Green


After receiving a link from Position Green to a table you can select what columns and what filters you require to create a table you want to get using the API.


In the example below all organizational units are exported with their corresponding scope 1, 2 and 3 in each column.



Position Green API Swagger

Below you'll find a description of the tables endpoints. To test the endpoints please go to our Swagger page.


Query tables in API

Returns a list of available tables

GET https://api.positiongreen.com/v1/tables

Retrieves a list of all available tables accessible to the authenticated tenant.


Example Response (200 OK)

[
    {
        "id": "201b9192-e565-4680-ad64-30fd78dc4b6d",
        "name": "API Table 1",
        "description": "Scope 1, 2 and 3 overview"
    }
]


Get data for table (JSON)

Returns data for a specific table with optional date filtering

GET https://api.positiongreen.com/v1/tables/{id}

Path Parameters

NameTypeDescription
id*string (uuid)Required. The unique identifier of the table.


Query Parameters

NameTypeDescription
DateFromstring (date)Start date for filtering results (inclusive, format: yyyy-MM-dd, e.g. 2023-01-01)
DateTostring (date)End date for filtering results (inclusive, format: yyyy-MM-dd, e.g. 2023-12-31)


Example response below for a table. Each row in the table is returned as an object where the column name is the key and the cell value is the property value.

[
    {
        "Organisatorisk enhet": "Supplier 2",
        "Scope 1": 2000,
        "Scope 2": 5200,
        "Scope 3": 15700
    },
    {
        "Organisatorisk enhet": "Supplier 1",
        "Scope 1": 1500,
        "Scope 2": 4300,
        "Scope 3": 5800
    }
]


Export table data as CSV

Exports table data in CSV format (.csv) with optional date filtering

GET https://api.positiongreen.com/v1/tables/csv/{id}

Path Parameters

NameTypeDescription
id*string (uuid)Required. The unique identifier of the table to export.


Query Parameters

NameTypeDescription
DateFromstring (date)Start date for filtering results (inclusive, e.g. 2023-01-01)
DateTostring (date)End date for filtering results (inclusive, e.g. 2023-12-31)


Responses

200: OK SuccessReturns generated CSV file stream (binary content).
400: Bad RequestInvalid date range filter or application error.
401: UnauthorizedAuthentication required.
404: Not FoundTable not found with the specified ID.
500: Server ErrorInternal server error occurred while generating the export.


Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article