def set_payload(self, start_datetime, end_datetime, token=None):
        """Set payload for api call.

        Args:
            start_datetime (string): start of data fetching
            end_datetime (string): end date of data fetching
            token (string, optional): next token . Defaults to None.

        Raises:
            MimecastException: MimecastException
            MimecastException: KeyError
            MimecastException: Unknown error

        Returns:
            json: will be passed in body of api call
        """
        __method_name = inspect.currentframe().f_code.co_name
        try:

            payload = {
                "meta": {"pagination": {"pageSize": consts.MAX_PAGE_SIZE}},
                "data": [
                    {"startDateTime": start_datetime, "endDateTime": end_datetime}
                ],
            }
            if token:
                payload["meta"]["pagination"]["pageToken"] = token

            applogger.info(
                self.log_format.format(
                    consts.LOGS_STARTS_WITH,
                    __method_name,
                    self.azure_function_name,
                    "Payload set with start date : {} and end date : {}".format(
                        start_datetime, end_datetime
                    ),
                )
            )

            return payload
        except MimecastException:
            raise MimecastException()
        except KeyError as key_error:
            applogger.error(
                self.log_format.format(
                    consts.LOGS_STARTS_WITH,
                    __method_name,
                    self.azure_function_name,
                    consts.KEY_ERROR_MSG.format(key_error),
                )
            )
            raise MimecastException()
        except Exception as err:
            applogger.error(
                self.log_format.format(
                    consts.LOGS_STARTS_WITH,
                    __method_name,
                    self.azure_function_name,
                    consts.UNEXPECTED_ERROR_MSG.format(err),
                )
            )
            raise MimecastException()
Set payload for api call.

        Args:
            start_datetime (string): start of data fetching
            end_datetime (string): end date of data fetching
            token (string, optional): next token . Defaults to None.

        Raises:
            MimecastException: MimecastException
            MimecastException: KeyError
            MimecastException: Unknown error

        Returns:
            json: will be passed in body of api call
        
Solutions/Mimecast/Data Connectors/MimecastAudit/MimecastAudit/mimecast_audit_to_sentinel.py