Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add IP query param to group and engage endpoints #1719

Merged
merged 4 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion openapi/src/common/ingestion-api.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,14 @@ OptionalRequestParameter:
schema:
$ref: ./schemas.yaml#/IntegerPropertyAsBooleanFlag
description: >-
If present and equal to 1, Mixpanel will validate the provided records and return a JSON object with per-record error messages for records that fail validation.
If present and equal to 1, Mixpanel will validate the provided records and return a JSON object with per-record error messages for records that fail validation.
IP:
in: query
name: ip
required: false
schema:
$ref: ./schemas.yaml#/IntegerPropertyAsBooleanFlag
default: 0
description: >-
If present and equal to 0, Mixpanel will not perform geolocation parsing using the IP address of the request. We recommend setting the ip to "0" when making requests from the server-side to prevent the unintentional effect of overwriting your profile's geolocation with your server location.
Defaults to 1 which would use the IP address of the request to update profile geolocation.
20 changes: 20 additions & 0 deletions openapi/src/ingestion.openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ paths:
it does exist, it sets the properties to these values, overwriting
existing values.
parameters:
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/IP
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Strict
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Verbose
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/JavascriptWithCallback
Expand Down Expand Up @@ -236,6 +237,7 @@ paths:
Works just like "$set", except it will not overwrite existing property
values. This is useful for properties like "First login date".
parameters:
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/IP
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Strict
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Verbose
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/JavascriptWithCallback
Expand Down Expand Up @@ -284,6 +286,7 @@ paths:
negative values. This is useful for maintaining the values of properties
like "Number of Logins" or "Files Uploaded".
parameters:
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/IP
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Strict
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Verbose
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/JavascriptWithCallback
Expand Down Expand Up @@ -329,6 +332,7 @@ paths:
Adds the specified values to a list property on a user profile and
ensures that those values only appear once. The profile is created if it does not exist.
parameters:
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/IP
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Strict
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Verbose
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/JavascriptWithCallback
Expand Down Expand Up @@ -385,6 +389,7 @@ paths:
property that doesn't exist will result in assigning a list with one
element to that property.
parameters:
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/IP
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Strict
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Verbose
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/JavascriptWithCallback
Expand Down Expand Up @@ -429,6 +434,7 @@ paths:
is removed from the existing list on the user profile. If it does not
exist, no updates are made.
parameters:
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/IP
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Strict
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Verbose
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/JavascriptWithCallback
Expand Down Expand Up @@ -472,6 +478,7 @@ paths:
Takes a JSON list of string property names, and permanently removes the
properties and their values from a profile.
parameters:
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/IP
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Strict
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Verbose
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/JavascriptWithCallback
Expand Down Expand Up @@ -524,6 +531,7 @@ paths:

Refer to the respective user profile update commands ($set, $set_once, $add, $union, $append, $remove, $unset, and $delete) on syntax for their parameters.
parameters:
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/IP
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Strict
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Verbose
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/JavascriptWithCallback
Expand Down Expand Up @@ -625,6 +633,8 @@ paths:
summary: Update Property
description: Updates or adds properties to a group profile. The profile is created if it does not exist.
parameters:
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/IP
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Strict
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Verbose
requestBody:
required: true
Expand Down Expand Up @@ -668,6 +678,8 @@ paths:
summary: Set Property Once
description: Adds properties to a group only if the property is not already set. The profile is created if it does not exist.
parameters:
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/IP
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Strict
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Verbose
requestBody:
required: true
Expand Down Expand Up @@ -711,6 +723,8 @@ paths:
summary: Delete Property
description: Unsets specific properties on the group profile.
parameters:
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/IP
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Strict
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Verbose
requestBody:
required: true
Expand Down Expand Up @@ -758,6 +772,8 @@ paths:
summary: Remove from List Property
description: Removes a specific value in a list property.
parameters:
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/IP
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Strict
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Verbose
requestBody:
required: true
Expand Down Expand Up @@ -803,6 +819,8 @@ paths:
Adds the specified values to a list property on a group profile and
ensures that those values only appear once. The profile is created if it does not exist.
parameters:
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/IP
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Strict
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Verbose
requestBody:
required: true
Expand Down Expand Up @@ -864,6 +882,8 @@ paths:

Refer to the respective group profile update commands ($set, $set_once, $add, $union, $remove, $unset, and $delete) on syntax for their parameters.
parameters:
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/IP
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Strict
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Verbose
requestBody:
required: true
Expand Down
Loading