> ## Documentation Index > Fetch the complete documentation index at: https://learn.servitly.com/llms.txt > Use this file to discover all available pages before exploring further. # Get thing metric values > Retrieves the values for a metric belonging to a thing.
This method returns at maximum 1000 values at a time sorted by decreasing timestamp; to retrieve more values, multiple requests must be made with the last returned pageToken. If a time aggregation has been defined (e.g. AVG_HOURS_1), a maximum of 100 values are returned; to retrieve more values, multiple requests must be made with different start and end timestamps.

Required permissions: READ_THING. ## OpenAPI ````json GET /data/values { "openapi": "3.1.0", "info": { "title": "Servitly DPS API", "version": "1.0.0" }, "servers": [ { "url": "https://api.servitly-sandbox.com", "description": "[AWS SANDBOX]" }, { "url": "https://api.servitly.com", "description": "[AWS PRODUCTION Ireland]" }, { "url": "https://api-ap.servitly.com", "description": "[AWS Hong Kong]" }, { "url": "https://azapi.servitly-dev.com", "description": "[AZURE DEV Frankfurt]" }, { "url": "https://azapi.servitly-staging.com", "description": "[AZURE STAGING Frankfurt]" }, { "url": "https://azapi.servitly.com", "description": "[AZURE PRODUCTION Frankfurt]" } ], "security": [ { "bearerAuth": [] } ], "tags": [ { "name": "ACTIONS" }, { "name": "ALERTS" }, { "name": "API GATEWAY" }, { "name": "AUTHENTICATION" }, { "name": "AUTHORIZATIONS" }, { "name": "CUSTOMERS" }, { "name": "DATA IMPORT / EXPORT" }, { "name": "EVENTS" }, { "name": "LOCATIONS" }, { "name": "MAINTENANCE" }, { "name": "MAPPING" }, { "name": "METRIC DATA" }, { "name": "MOBILE APP" }, { "name": "ORGANIZATION" }, { "name": "PARTNERS" }, { "name": "PRODUCT MODELS" }, { "name": "SPARE PARTS" }, { "name": "STATISTICS" }, { "name": "STORE ORDERS" }, { "name": "SUBSCRIPTIONS" }, { "name": "SUBSCRIPTIONS (OLD)" }, { "name": "THING CONTROL" }, { "name": "THING DEFINITIONS" }, { "name": "THING MANAGEMENT" }, { "name": "THINGS" }, { "name": "TICKETS" }, { "name": "USER TYPES" }, { "name": "USERS" }, { "name": "WORK SESSIONS" } ], "paths": { "/data/values": { "get": { "summary": "Get thing metric values", "description": "Retrieves the values for a metric belonging to a thing.
This method returns at maximum 1000 values at a time sorted by decreasing timestamp; to retrieve more values, multiple requests must be made with the last returned pageToken. If a time aggregation has been defined (e.g. AVG_HOURS_1), a maximum of 100 values are returned; to retrieve more values, multiple requests must be made with different start and end timestamps.

Required permissions: READ_THING.", "tags": [ "METRIC DATA" ], "parameters": [ { "$ref": "#/components/parameters/tenantNameHeader" }, { "in": "query", "name": "thingId", "required": "true", "schema": { "$ref": "#/components/schemas/ObjectId" }, "description": "The identifier of the thing whose metric data is to be retrieved." }, { "in": "query", "name": "metricName", "required": "true", "schema": { "type": "string", "maximum": "1" }, "description": "The name of the metric whose values must be retrieved." }, { "in": "query", "name": "pageSize", "schema": { "type": "integer" }, "description": "The number of results to return in each result page (maximum = 1000).", "example": "1" }, { "in": "query", "name": "endDate", "schema": { "type": "integer", "format": "int64" }, "description": "The end-date in milliseconds filtering result values." }, { "in": "query", "name": "startDate", "schema": { "type": "integer", "format": "int64" }, "description": "The start-date in milliseconds filtering result values." }, { "in": "query", "name": "pageToken", "schema": { "type": "string", "maximum": "1" }, "description": "The page token used to retrieve the next page when there are more items than the page size." }, { "in": "query", "name": "aggregation", "schema": { "type": "string", "maximum": "1" }, "description": "The aggregation function to be used to retrieve data. You can use AVG, DELTA, MIN, or MAX, and optionally concatenate the timeframe (e.g. AVG_DAYS_1), which can be one of the following: AUTO, HOURS_1, DAYS_1, MONTHS_1, YEARS_1.
According to the timeframe, the requested period is divided into a maximum of 100 intervals. If there are more than 100 intervals, the timeframe is automatically increased until the result interval count is less than or equal to 100. If AUTO is used, the best timeframe is selected in order to accommodate at maximum 100 intervals within the period. Without period aggregation, only one value is returned." } ], "responses": { "200": { "description": "Successful operation.", "content": { "application/json": { "schema": { "$ref": "#/components/schemas/MetricValues" } } } }, "400": { "$ref": "#/components/responses/BadRequest" }, "401": { "$ref": "#/components/responses/NotAuthenticated" }, "403": { "$ref": "#/components/responses/NotAuthorized" }, "404": { "$ref": "#/components/responses/NotFound" }, "429": { "$ref": "#/components/responses/ApiLimit" }, "500": { "$ref": "#/components/responses/IntError" } } } } }, "components": { "parameters": { "tenantNameHeader": { "in": "header", "name": "X-Servitly-Tenant", "required": "true", "schema": { "type": "string", "example": "{{tenantName}}" }, "description": "The name of the tenant (e.g. acme)." } }, "schemas": { "ObjectId": { "type": "string", "example": "abcd1234", "minimum": "1", "description": "The object identifier (e.g. 6620e4bb42541977c406b984)." }, "MetricValues": { "type": "object", "properties": { "data": { "type": "array", "items": { "type": "object", "properties": { "timestamp": { "type": "integer", "format": "int64", "description": "The timestamp the metric value is associated with.", "example": "1695045244000" }, "values": { "type": "array", "items": { "type": "object", "properties": { "name": { "type": "string", "description": "The metric mapping name.", "example": "status" }, "value": { "type": "string", "description": "The metric value.", "example": "WORKING" } } } } } } }, "nextPageToken": { "type": "string", "description": "The page token used to retrieve the next page when there are more items than the page size. If there are no more results the returned pageToken is null." } } } }, "responses": { "BadRequest": { "description": "Request data not valid.", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "description": "The error response.", "example": "Bad request" } } } } } }, "NotAuthenticated": { "description": "User not authenticated.", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "description": "The error response.", "example": "User not authenticated" } } } } } }, "NotAuthorized": { "description": "User not authorized.", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "description": "The error response.", "example": "User not authorized" } } } } } }, "NotFound": { "description": "Resource was not found.", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "description": "The error response.", "example": "Resource not found" } } } } } }, "ApiLimit": { "description": "API call rate limit exceeded.", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "description": "The error response.", "example": "API call rate limit exceeded" } } } } } }, "IntError": { "description": "Internal server error.", "content": { "application/json": { "schema": { "type": "object", "properties": { "message": { "type": "string", "description": "The error response.", "example": "Internal Server Error" } } } } } } }, "securitySchemes": { "bearerAuth": { "type": "http", "scheme": "bearer" } } } } ````