Class UserSegmentationRestAPI


  • @Path("/lumis/service/analytics/usersegmentation/{si:[a-fA-F0-9]{32}}/rest")
    public class UserSegmentationRestAPI
    extends AbstractMonitorResource
    User segmentation resource.
    Since:
    11.0.0
    Version:
    $Revision: 26533 $ $Date: 2024-07-31 15:28:58 -0300 (Wed, 31 Jul 2024) $
    • Constructor Detail

      • UserSegmentationRestAPI

        public UserSegmentationRestAPI()
    • Method Detail

      • getUsers

        @Path("/users")
        @POST
        @Produces("application/json")
        public Response getUsers​(@FormParam("filters")
                                 java.lang.String jsonData,
                                 @FormParam("maxSize") @DefaultValue("50") @Min(1L) @Max(50L)
                                 @javax.validation.constraints.Min(1L),@javax.validation.constraints.Max(50L) int maxSize,
                                 @FormParam("startAt") @Min(1L) @DefaultValue("1")
                                 @javax.validation.constraints.Min(1L) int startAt)
                          throws PortalException
        Returns the users list based on the given filters.
        Parameters:
        jsonData - the JSON data of applied filters.
        maxSize - the maximum number of hits of the query.
        startAt - the number of first hit of the query.
        serviceInstanceId - the service instance identifier.
        Returns:
        the users list based on the given filters.
        Throws:
        PortalException
        Since:
        11.0.0
      • downloadSegmentationCSV

        @Path("/users/csv")
        @POST
        @Produces("text/csv")
        public Response downloadSegmentationCSV​(@FormParam("filters")
                                                java.lang.String jsonData,
                                                @FormParam("field")
                                                java.util.List<java.lang.String> fields,
                                                @FormParam("columnSeparator") @DefaultValue(";")
                                                java.lang.Character columnSeparator)
                                         throws PortalException
        Returns a CSV file containing the users in a given segmentation list.
        Parameters:
        jsonData - the JSON data of applied filters in the segmentation.
        fields - the service instance identifier.
        Returns:
        the users list based on the given filters.
        Throws:
        PortalException
        Since:
        11.1.0
      • getUserDetails

        @Path("/user/{visitorId}")
        @GET
        @Produces("application/json")
        public Response getUserDetails​(@PathParam("visitorId")
                                       java.lang.String visitorId)
                                throws PortalException
        Returns the user details.
        Parameters:
        jsonData - the JSON data of applied filters.
        Returns:
        the users list based on the given filters.
        Throws:
        PortalException
        Since:
        11.0.0
      • getUserInfoTXT

        @Path("/user/{visitorId}/user.txt")
        @GET
        @Produces("text/plain")
        public void getUserInfoTXT​(@PathParam("visitorId")
                                   java.lang.String visitorId,
                                   @QueryParam("activities")
                                   java.lang.String activities,
                                   @Context
                                   HttpServletResponse response)
        Returns the user details.
        Parameters:
        jsonData - the JSON data of applied filters.
        Since:
        12.3.0
      • getNextActivities

        @Path("/user/{visitorId}/activities/{page}")
        @POST
        @Produces("application/json")
        @Consumes("application/json")
        public Response getNextActivities​(@PathParam("visitorId")
                                          java.lang.String visitorId,
                                          @PathParam("page")
                                          java.lang.Integer page,
                                          @QueryParam("firstEventDateMilliseconds")
                                          java.lang.Long firstEventDateMilli,
                                          lumis.service.analytics.usersegmentation.rest.UserSegmentationRestAPI.NextActivitiesRequest bodyRequest)
                                   throws PortalException
        Returns only activities of user for be appended in the activities of user.
        Parameters:
        visitorId - the visitor user identifier.
        page - the page of pagination.
        firstEventDateMilli - the oldest event date time in the top of event activities list. It avoids to newest events mess up the pagination.
        Returns:
        the next block of activities.
        Throws:
        PortalException
        Since:
        12.1.0
      • getEventProperties

        public static org.json.JSONObject getEventProperties​(SessionConfig sessionConfig,
                                                             ITransaction transaction,
                                                             java.util.Map<java.lang.String,​IMonitorField> fields,
                                                             java.util.Map<java.lang.String,​java.lang.Object> lum_monitor,
                                                             IMonitorEvent event,
                                                             boolean removeUser)
                                                      throws PortalException,
                                                             ManagerException
        Returns the event fields values.
        Parameters:
        sessionConfig - the current session.
        transaction - the transaction.
        fields - the fields.
        lum_monitor - the map with values.
        event - the events.
        removeUser - choose if will remove lum_user from properties list.
        Returns:
        the event fields values.
        Throws:
        PortalException
        ManagerException
        Since:
        14.0.0
      • saveSegmentation

        @Path("/segmentation/{id:[a-fA-F0-9]{32}}")
        @PUT
        @Consumes("application/json")
        @Produces("application/json")
        public Response saveSegmentation​(java.lang.String body,
                                         @PathParam("id") @NotBlank
                                         @NotBlank java.lang.String id)
        Quick save operation for segmentation.
        Parameters:
        segmentationFilter - the segmentation filter.
        id - the segmentation identifier.
        Returns:
        the response.
        Throws:
        PortalException
        Since:
        11.1.0
      • getSegmentation

        @Path("/segmentation/{id:[a-fA-F0-9]{32}}")
        @GET
        @Consumes("application/json")
        @Produces("application/json")
        public Response getSegmentation​(@PathParam("id") @NotBlank
                                        @NotBlank java.lang.String id)
        Return segmentation by id.
        Parameters:
        id - the segmentation identifier.
        Returns:
        the response.
        Since:
        11.1.0
      • parseToJsonObject

        public static org.json.JSONObject parseToJsonObject​(UserSegmentation userSegmentation)
        Receives a entity and returns a json client format.
        Parameters:
        userSegmentation - the entity.
        Returns:
        the json object.
        Since:
        11.1.0
      • deleteMonitorUser

        @Path("/user/{visitorId}")
        @DELETE
        public void deleteMonitorUser​(@NotNull @PathParam("visitorId")
                                      @NotNull java.lang.String visitorId)
                               throws java.lang.Exception
        Delete the monitor user with the given visitorId.
        Parameters:
        visitorId - the visitor identifier of the monitor user.
        Throws:
        java.lang.Exception
        Since:
        12.3.0
      • anonymizeMonitorUser

        @Path("/user/{visitorId}/anonymize")
        @POST
        public void anonymizeMonitorUser​(@NotNull @PathParam("visitorId")
                                         @NotNull java.lang.String visitorId)
                                  throws java.lang.Exception
        Anonymize the monitor user with the given visitorId.
        Parameters:
        visitorId - the visitor identifier of the monitor user.
        Throws:
        java.lang.Exception
        Since:
        12.3.0
      • deleteMonitorUserActivities

        @Path("/user/{visitorId}/activities")
        @DELETE
        public void deleteMonitorUserActivities​(@NotNull @PathParam("visitorId")
                                                @NotNull java.lang.String visitorId)
                                         throws java.lang.Exception
        Delete the activities of the monitor user with the given visitorId.
        Parameters:
        visitorId - the visitor identifier of the monitor user.
        Throws:
        java.lang.Exception
        Since:
        12.3.0