Skip to content

Commit

Permalink
Add IP query param to group and engage endpoints (#1719)
Browse files Browse the repository at this point in the history
* add ip value as a query param for engage and group endpoints

* grammar

* set default value in playground to 0, but clarify that default behavior is 1

---------

Co-authored-by: Myron Fung <[email protected]>
  • Loading branch information
myronkaifung and Myron Fung authored Jan 15, 2025
1 parent 3903c93 commit d5fe7a5
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 1 deletion.
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

0 comments on commit d5fe7a5

Please sign in to comment.