ICMP Response Javascript

Connector function ICMP-Response JS API guide

This API allows users to receive response of another ICMP-Request Connector Function. You can process the data as necessary.

Response Object

The response object is the main object of the response, it is the payload.

The object received has the following properties:

  • operationResult: Parent object of the result.
    • version: String. Version of the response message received.
    • trustedboot: Boolean. Trusted boot value.
    • operation: Object with the operation properties:
      • response: Object with the response operation properties:
        • id: String. Request Id of the launched operation.
        • name: String. The name of the launched operation.
        • deviceId: String. Entity identifier that receives the operation.
        • resultCode: String. Result code of the launched operation.
        • resultDescription: String. Result description of the launched operation.
        • additionalDescription: String. Additional result description of the launched operation.
        • path: String. Device usage URL.
        • variables: Array with the device usage variables.
        • entityType: Enum. Type of entity that receives the operation. Possible values: “DEVICE”, “SUBSCRIPTION”, “SUBSCRIBER”, “COMMS_MODULE”
        • steps: Array with the steps of the launched operation.
          • name: String. Result step name.
            • result: String. Result step code.
            • description: String. Result step description
            • response: Json. Json information of the step.
            • timestamp: Number. Timestamp of the step.
        • timestamp: Number. Timestamp of the launched operation.
        • iotData: Collection object with the following properties:
          • version: String. Version of the message IoT received.
          • datastreams: Array with information about the launched operation. (IoT message)
            • id: String. Identifier of the datastream collected.
            • datapoints: Array with the information of the datastream.

Example:

{
  "operationResult": {
    "operation": {
      "response": {
      	"id": "86a52ffe-9f4f-427b-8154-aef7bc2935a0",
      	"name": "REFRESH_PRESENCE",
        "resultCode": "SUCCESSFUL",
      	"resultDescription": "RESULT OK",
      	"additionalDescription": "",
      	"deviceId": "devicedId",
      	"timestamp": 1701288987,
      	"path": [ "/deviceId/request" ],
      	"steps": [{
      	  "name": "Step Name",
        	"result": "Step Result",
        	"description": "Step description",
        	"response": {},
        	"timestamp": 1701288960
      	}],
      	"variables": [ "address", "" ],
      	"replacements": {
      	},
      	"entityType": {
      	  "enum": ["DEVICE", "SUBSCRIPTION", "SUBSCRIBER", "COMMS_MODULE"]
      	},
      	"iotData": {
          "version": "1.0",
          "datastreams":[
            {
              "id":"device.communicationModules[].subscription.address",
              "datapoints":[
                {
                   "value":{
                       "value": "10.10.10.174",
                       "type": "IPV4",
                       "apn": "movistar.es"
                   }
                }
              ]
            }
          ]
        }
      }
    }
  }
}