.. include:: /atkeywords.rst .. _Contract_RestApiModule_Memory: ######################################### RestApiModule - Memory Api ######################################### .. _Contract_RestApiModule_Memory_GetAllMemoriesOrByMemoryName: Get all or one or more memory values by memoryName ************************************************** Returns all available memory values or one or more memory values by passing their memoryName. See :ref:`SupportedDevices ` to learn more about what memory values are available. **Authorization level** * :red:`30 (RestApiModuleGetData )` **URL parameters** * **endcustomerId**: Endcustomer Id. * **assetId**: Asset Id. * **deviceId**: Device Id of peripheral linked to the asset. * **memoryName1 / memoryName2**: (optional) See :ref:`SupportedDevices ` to learn more about what memory values are available. .. http:get:: /endcustomers/{endcustomerId}/assets/{assetId}/restapi/hal/devices/{deviceId}/memory?memoryName={memoryName1}&memoryName={memoryName2} **Example request**: .. sourcecode:: http GET /endcustomers/edfd1133-88ec-4f2d-abb8-16238c6ad926/assets/10401990013-123455789/restapi/hal/devices/WTIO1/memory HTTP/1.1 Accept: application/json Authorization: Bearer eyJhbGciOiJS... X-API-Version: 1.0 **Example response**: .. sourcecode:: http HTTP/1.1 200 OK Content-Type: application/json; charset=utf-8 Api-Supported-Versions: 1.0 [ { "name": "MEM1", "value": 0 }, { "name": "MEM2", "value": 8 }, //...more memory values... { "name": "MEM12", "value": 0 } ] :statuscode 200: OK :statuscode 400: Bad Request, parameters validation failed :statuscode 401: Unauthorized. Something is wrong with the :mailheader:`Authorization` header of the request :statuscode 403: Forbidden. :statuscode 429: Too Many Requests. :statuscode 500: Internal Server Error :resheader Content-Type: application/json; charset=utf-8 :resheader Api-Supported-Versions: supported api versions :>json array memory: array with memory and their values. The max value depends on the memory type. See :ref:`memory types ` for more info and check the :ref:`device specifications ` to know which types are supported. .. _Contract_RestApiModule_Memory_Types: Memory Types ============ 3 main types of memory are available: +--------------------------------+----------------+--------------------------------+--------------------------------+ | | RAM | ROM | NVRAM | +--------------------------------+----------------+--------------------------------+--------------------------------+ | Memory state after power up | Non known Data | Same data as before power fail | Same data as before power fail | +--------------------------------+----------------+--------------------------------+--------------------------------+ | Set Value in Preparation mode? | Yes | Yes | Yes | +--------------------------------+----------------+--------------------------------+--------------------------------+ | Set Value in Action mode? | Yes | No | Yes | +--------------------------------+----------------+--------------------------------+--------------------------------+ | Writing cycles | 1 Milion | 1000 | 1 Milion | +--------------------------------+----------------+--------------------------------+--------------------------------+ Remarks: * Preparation and Action mode mentioned in the table above refer to specific terminology used for Alphatronics generation2 devices: - preparation mode: configuration mode for the device - action mode: normal operational mode for the device * The max memory value depends on the data size. These data size can sometimes be pre-configured depending on the type of device. Supported data length values are: - 1bit: [0,1] - 1Byte: [0,15] - 2Byte (word): [0,256] - 4Byte (long word): [0,65535] .. _Contract_RestApiModule_Memory_Events: Events ****** A webhook message is sent when a memory value changes. **Authorization level** * :red:`32 (RestApiModuleNotification )` **Properties** * **event.methodName** (string): "receiveMemory" * **event.arguments** (array): array of changed memory values. See also :ref:`get all or one or more memory values `. * **event.deviceId** (string): id of I/O module attached to the gateway. * **event.version** (string): '1.0' * **event.$type** (int): '300' = events coming from the RestApiModule. See :ref:`webhook message event types `. * **moduleId**: See :ref:`webhook common webhook message properties `. * **$type**: See :ref:`webhook common webhook message properties `. * **version**: See :ref:`webhook common webhook message properties `. * **createdUtc**: See :ref:`webhook common webhook message properties `. * **reportedUtc**: See :ref:`webhook common webhook message properties `. * **id**: See :ref:`webhook common webhook message properties `. * **assetId**: See :ref:`webhook common webhook message properties `. :: { "event": { "methodName": "receiveMemory", "arguments": [ { "memory": [ { "name": "MEM1", "value": 20 }], "deviceId": "WTIO1", "version": "1.0" }], "$type": 300 }, "moduleId": "RestApiModule1", "$type": 2, "version": 1, "createdUtc": "2026-11-20T10:56:56.0170712Z", "reportedUtc": "2026-11-20T10:56:47.056Z", "id": "7b1ad0e7-2759-48a4-8465-1a795f72c61c", "assetId": "10401990013-123004002" }