Skip to content

Commit d5fe7a5

Browse files
myronkaifungMyron Fung
andauthored
Add IP query param to group and engage endpoints (#1719)
* 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 <myronfung@MyronFung---MP-MBP.local>
1 parent 3903c93 commit d5fe7a5

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed

openapi/src/common/ingestion-api.yaml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,4 +61,14 @@ OptionalRequestParameter:
6161
schema:
6262
$ref: ./schemas.yaml#/IntegerPropertyAsBooleanFlag
6363
description: >-
64-
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.
64+
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.
65+
IP:
66+
in: query
67+
name: ip
68+
required: false
69+
schema:
70+
$ref: ./schemas.yaml#/IntegerPropertyAsBooleanFlag
71+
default: 0
72+
description: >-
73+
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.
74+
Defaults to 1 which would use the IP address of the request to update profile geolocation.

openapi/src/ingestion.openapi.yaml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ paths:
193193
it does exist, it sets the properties to these values, overwriting
194194
existing values.
195195
parameters:
196+
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/IP
196197
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Strict
197198
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Verbose
198199
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/JavascriptWithCallback
@@ -236,6 +237,7 @@ paths:
236237
Works just like "$set", except it will not overwrite existing property
237238
values. This is useful for properties like "First login date".
238239
parameters:
240+
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/IP
239241
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Strict
240242
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Verbose
241243
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/JavascriptWithCallback
@@ -284,6 +286,7 @@ paths:
284286
negative values. This is useful for maintaining the values of properties
285287
like "Number of Logins" or "Files Uploaded".
286288
parameters:
289+
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/IP
287290
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Strict
288291
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Verbose
289292
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/JavascriptWithCallback
@@ -329,6 +332,7 @@ paths:
329332
Adds the specified values to a list property on a user profile and
330333
ensures that those values only appear once. The profile is created if it does not exist.
331334
parameters:
335+
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/IP
332336
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Strict
333337
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Verbose
334338
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/JavascriptWithCallback
@@ -385,6 +389,7 @@ paths:
385389
property that doesn't exist will result in assigning a list with one
386390
element to that property.
387391
parameters:
392+
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/IP
388393
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Strict
389394
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Verbose
390395
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/JavascriptWithCallback
@@ -429,6 +434,7 @@ paths:
429434
is removed from the existing list on the user profile. If it does not
430435
exist, no updates are made.
431436
parameters:
437+
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/IP
432438
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Strict
433439
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Verbose
434440
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/JavascriptWithCallback
@@ -472,6 +478,7 @@ paths:
472478
Takes a JSON list of string property names, and permanently removes the
473479
properties and their values from a profile.
474480
parameters:
481+
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/IP
475482
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Strict
476483
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Verbose
477484
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/JavascriptWithCallback
@@ -524,6 +531,7 @@ paths:
524531
525532
Refer to the respective user profile update commands ($set, $set_once, $add, $union, $append, $remove, $unset, and $delete) on syntax for their parameters.
526533
parameters:
534+
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/IP
527535
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Strict
528536
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Verbose
529537
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/JavascriptWithCallback
@@ -625,6 +633,8 @@ paths:
625633
summary: Update Property
626634
description: Updates or adds properties to a group profile. The profile is created if it does not exist.
627635
parameters:
636+
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/IP
637+
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Strict
628638
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Verbose
629639
requestBody:
630640
required: true
@@ -668,6 +678,8 @@ paths:
668678
summary: Set Property Once
669679
description: Adds properties to a group only if the property is not already set. The profile is created if it does not exist.
670680
parameters:
681+
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/IP
682+
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Strict
671683
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Verbose
672684
requestBody:
673685
required: true
@@ -711,6 +723,8 @@ paths:
711723
summary: Delete Property
712724
description: Unsets specific properties on the group profile.
713725
parameters:
726+
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/IP
727+
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Strict
714728
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Verbose
715729
requestBody:
716730
required: true
@@ -758,6 +772,8 @@ paths:
758772
summary: Remove from List Property
759773
description: Removes a specific value in a list property.
760774
parameters:
775+
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/IP
776+
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Strict
761777
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Verbose
762778
requestBody:
763779
required: true
@@ -803,6 +819,8 @@ paths:
803819
Adds the specified values to a list property on a group profile and
804820
ensures that those values only appear once. The profile is created if it does not exist.
805821
parameters:
822+
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/IP
823+
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Strict
806824
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Verbose
807825
requestBody:
808826
required: true
@@ -864,6 +882,8 @@ paths:
864882
865883
Refer to the respective group profile update commands ($set, $set_once, $add, $union, $remove, $unset, and $delete) on syntax for their parameters.
866884
parameters:
885+
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/IP
886+
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Strict
867887
- $ref: ./common/ingestion-api.yaml#/OptionalRequestParameter/ResponseType/Verbose
868888
requestBody:
869889
required: true

0 commit comments

Comments
 (0)