Position Green API: Measures

Modified on Tue, 21 Jul at 9:34 AM

TABLE OF CONTENTS


Measures in Position Green define the entire body of data you want to collect during a reporting year, this includes who will report the data, how often, and what organizational units. The measure is created by the Controller in Setup using Measure Builder.


To test the endpoints below, please visit our Swagger UI page.


Properties of a Measure object


PropertyData TypeDescription
idstring (uuid)Unique identifier of the measure
namestringName of the measure
prettyIdnullable stringPretty ID (external identifier) of the measure
aspectNamestringThe aspect it belongs to
globalIdstring (uuid)Global unique identifier of the measure


Get all measures

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

Retrieves a paginated list of measures filtered by year and optional name filter.


Query Parameters

NameTypeDescription
yearId*string (uuid)Required. The unique identifier of the year to filter measures by.
nameFilterstringOptional filter to search for measures by name. Matches partial strings (e.g. *nameFilter*).
firstinteger (int32)The maximum number of measures to return in a single page. Default: 10. Minimum: 1, Maximum: 500.
afterstringOptional cursor pointing to where to continue retrieving measures.
sortBystring (enum)The field to sort measures by. Options: Name (default).
sortDirectionstring (enum)Sort direction. Options: Ascending (default) or Descending.


Responses

200 OK SuccessReturns the paginated list of measures.
400 Bad RequestValidation errors occurred (e.g., missing required yearId, invalid pagination parameters, invalid cursor).
401 UnauthorizedAuthentication required.
500 Server ErrorInternal server error occurred while retrieving measures.


Response Example

{
    "totalCount": 70,
    "pageInfo": {
        "hasNextPage": true,
        "startCursor": "aWR4OzA=",
        "endCursor": "aWR4Ozk="
    },
    "items": [
        {
            "cursor": "aWR4OzA=",
            "node": {
                "id": "da8e4c7d-5ffb-418b-ad3c-35c6be177fe7",
                "name": "Actual working hours",
                "prettyId": "actual-working-hours",
                "aspectName": "OH&S",
                "globalId": "1hfghdeac5-c297-7gfd-95ad-4b43543534552"
            }
        }
    ]
}


Example: getting the first 2 measures containing '201' in the name using curl


curl --location "https://api.positiongreen.com/v1/measures?yearId=<year_id>&first=2&nameFilter=201" \
  --header "Authorization: Bearer <access_token>"


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