Beispiel #1
0
    def users(self, user_email=None, user_external_id=None,
              city=None, state=None, market=None, zipcode=None,
              radius=None, attribute_guids_or=None, attribute_guids_and=None,
              batch_guids=None, return_time_of_day=None):
        """
         The following request params either filter user returns or
        modify what information is returned, as described:

        :param user_email: Match users with the given email.
        :type user_email: str

        :param user_external_id: Match users to an ID to match the
         "external_id" field you used when you first uploaded them.
        :type user_external_id: str

        :param city Match users near the given city/state combo.
         Requires city and state.
        :type city: str

        :param state: Match users near the given city/state combo.
         Requires city and state.
        :type state: str

        :param market: Match users near the given market.
        :type market: str

        :param zipcode: Match users near the given zipcode.
        :type zipcode: str

        :param radius: Match users with any of the given attributes, using
         the global IDs of the attributes (see the attributes/ hook).
        :type radius: str

        :param attribute_guids_or: Match users with all of the given
         attributes, using the global IDs of the attributes.
        :type attribute_guids_or: str

        :param attribute_guids_and: Match users to a list of guids
         (guid is a global ID returned by this hook for each user)
        :type attribute_guids_and: str

        :param batch_guids: Match users to a list of guids (guid is a
         global ID returned by this hook for each user).
        :type batch_guids: str

        :param return_time_of_day: Include the average time of day that each
         user has interacted with your site in the past - this is a boolean
         which defaults to false in the interest of speed.
        :type return_time_of_day: str

        :rtype: dict
        """
        pair_required(city, state)

        params = {}
        for k, v in locals().items():
            if v is not self and k and v:
                params[k] = v

        return self.get(EndPoint.USERS, params)
Beispiel #2
0
    def actions(self, user_guid=None, item_guid=None, city=None, state=None,
                latitude=None, longitude=None, action_type=ActionType.CLICKS,
                market=None, zipcode=None, radius=None,
                item_attribute_guids_or=None, item_attribute_guids_and=None,
                user_attribute_guids_or=None, user_attribute_guids_and=None,
                datetime_start=None, datetime_end=None):
        """
         Get Actions, can filter action returns or modify what information
        returned

        :param user_guid: Match actions with the given user, by user guid.
        :type user_guid: str

        :param item_guid: Match actions with the given item, by item guid.
        :type item_guid: str

        :param city: Match actions near the given city/state combo.
         Requires city and state.
        :type city: str

        :param state: Match actions near the given city/state combo.
         Requires city and state.
        :type state: str

        :param latitude: Match actions near the given lat/lon combo.
         Requires latitude and longitude.
        :type latitude: str

        :param longitude: Match actions near the given lat/lon combo.
         Requires latitude and longitude.
        :type longitude: str

        :param action_type: Filter actions by action type.
         0 for clicks,1 for purchases, 5 for email opens.
        :type action_type: ActionType

        :param market: Match actions near the given lat/lon combo.
         Requires latitude and longitude.
        :type market: str

        :param zipcode: Match actions near the given lat/lon combo.
         Requires latitude and longitude.
        :type zipcode: str

        :param radius: Sets the radius, in rough miles, of location searches.
        :type radius: str

        :param item_attribute_guids_or: Match actions concerning items with
         any of the given attributes, using the global IDs of the attributes
         (see the attributes/ hook).
        :type item_attribute_guids_or: list

        :param item_attribute_guids_and: Match actions concerning items with
         all of the given attributes, using the global IDs of the attributes
         (see the attributes/ hook).
        :type item_attribute_guids_and: list

        :param user_attribute_guids_or: Match actions concerning users with
         any of the given attributes, using the global IDs of the attributes
         (see the attributes/ hook).
        :type user_attribute_guids_or: list

        :param user_attribute_guids_and: Match actions concerning users with
         all of the given attributes, using the global IDs of the attributes
         (see the attributes/ hook).
        :type user_attribute_guids_and: list

        :param datetime_start: Return actions within the given datetimes.
         Both or neither are required.
        :type datetime_start: str

        :param datetime_end:  Return actions within the given datetimes.
         Both or neither are required.
        :type datetime_end: str

        :rtype: dict
        """
        pair_required(city, state)
        pair_required(datetime_start, datetime_end)

        params = {}
        for k, v in locals().items():
            if v is not self and k and v:
                params[k] = v

        return self.get(EndPoint.ACTIONS, params)
Beispiel #3
0
    def items(self, item_name=None, item_external_id=None, item_guid=None,
              city=None, state=None, latitude=None, longtitude=None,
              market=None, zipcode=None, radius=None, attribute_guids_or=None,
              attribute_guids_and=None, variant_filters=None, batch_guids=None,
              skip_useraction_return=False, filter_expired=True):
        """
         Get items, can filter item returns or modify what information
        returned.

        :param item_name: Match items with the given name.
        :type item_name: str

        :param item_external_id: Match items to an ID to match the
         "external_id" field you used when you first uploaded them.
        :type item_external_id: int

        :param item_guid: Match items to a guid. Guids are returned by this
         hook for each item.
        :type item_guid: str

        :param city: Match items to an ID to match the "external_id" field
         you used when you first uploaded them.
        :type city: str

        :param state: Match items to an ID to match the "external_id" field
         you used when you first uploaded them.
        :type state: str

        :param latitude: Match items near the given lat/lon combo.
         Requires latitude and longitude.
        :type latitude: str

        :param longtitude: Match items near the given lat/lon combo.
         Requires latitude and longitude.
        :type longtitude: str

        :param market: Match items near the given market.
        :type market: str

        :param zipcode: Match items near the given zipcode.
        :type zipcode: str

        :param radius: Sets the radius, in rough miles, of location searches.
        :type radius: str

        :param attribute_guids_or: Match items with any of the given
         attributes, using the global IDs of the attributes
         (see the attributes/ hook).
        :type attribute_guids_or: list

        :param attribute_guids_or: Match items with any of the given
         attributes, using the global IDs of the attributes
         (see the attributes/ hook).
        :type attribute_guids_and: list

        :param variant_filters: Match items using properties of their variants.
         Please contact us for help if you'd like to use this hook.
        :type variant_filters: str

        :param batch_guids: Match items to a list of guids.
        :type batch_guids: list

        :param skip_useraction_return: Speeds up this hook by not returning
         any information about purchases of the returned items.
         Defaults to false.
        :type skip_useraction_return: bool

        :param filter_expired: Boolean, defaults to true - only returns items
         that are set to be available in our system.
        :type filter_expired: bool

        :rtype: dict
        """
        pair_required(city, state)
        pair_required(latitude, longtitude)

        params = {}
        for k, v in locals().items():
            if v is not self and k and v:
                params[k] = v

        return self.get(EndPoint.ITEMS, params)