def fetchMessage(self,nextPageToken=None):
        """
        Function to fetch messages from ETD message search api
        :param nextPageToken: token to fetch messages from next page, default value is None
        :return: messages fetched if successful, else empty dictionary
        """
        # Construct headers
        messageHeaders = {
            "Host": "api." + self.region + ".etd.cisco.com",
            "x-api-key": self.apiKey,
            "Accept": "application/json",
            "Authorization": "Bearer "+ self.secretToken
        }
        # Construct body
        messageJson = {
            "timestamp":[self.lastExecutedTime, self.currentUtcTime],
            "verdicts": self.messageFilter,
            "pageSize": PAGESIZE  #Each page will consist of PAGESIZE messages
        }
        # Append pageToken to body, if "nextPageToken" field contains value
        if nextPageToken:
            messageJson["pageToken"] = nextPageToken

        messageResponse = retryRequest(self.messageUrl, messageHeaders, messageJson)
        if messageResponse:
            if messageResponse.status_code == HTTPStatus.OK:
                logging.info("Message search API call successful")
                return messageResponse.json()
            elif messageResponse.status_code == HTTPStatus.UNAUTHORIZED:
                if not self.generateToken():
                    logging.error("Error in generating token for the request")
                    return {}
                messageHeaders["Authorization"] = "Bearer " + self.secretToken
                messageResponse = retryRequest(self.messageUrl, messageHeaders, messageJson)
                if messageResponse:
                    if messageResponse.status_code == HTTPStatus.OK:
                        logging.info("Message search API call successful")
                        return messageResponse.json()
                else:
                    return {}
            else:
                return {}
        else:
            logging.error("Message search API call failed")
            return {}

        Function to fetch messages from ETD message search api
        :param nextPageToken: token to fetch messages from next page, default value is None
        :return: messages fetched if successful, else empty dictionary
        
Solutions/Cisco ETD/Data Connectors/CiscoETDAzureSentinelConnector/__init__.py