post https://{regionAndDomain}.com/api/app/projects//connectors
Cloud provider-independent params
connector_type
(string enum) :“s3Import”
,“gcsImport”
compression
(string enum) :“none”
,“gzip”
data_format
(string enum) :“mixpanel_event”
,“mixpanel_group”
,“mixpanel_people”
,"remap_event"
,"remap_people"
,"remap_group"
this is how we know which type of data to process.
Cloud provider-specific params
s3/gcs_bucket
(string) : name of buckets3/gcs_prefix
(string) : prefix or directory path of files to be imported. Use“”
(empty string) to import all contents of the bucket.s3_role
(string) : s3 IAMs3_region
(string) : region of the bucket. Please refer to S3 Endpoint and refer to column Region for accepted values
Template for each bucket type
Template for GCS
{
"connector_type": "gcsImport",
"connector_properties": {
"gcs_bucket": "sample-data",
"gcs_prefix": "cloudimport/event",
},
"category_properties": {
"data_format": "mixpanel_event",
"compression": "none"
}
}
Template for S3
{
"connector_type": "s3Import",
"connector_properties": {
"s3_bucket": "sample-data",
"s3_prefix": "cloudimport/event",
"s3_region": "us",
"s3_role": "arn:aws:iam::485438090326:role/test-mixpanel",
},
"category_properties": {
"data_format": "mixpanel_event",
"compression": "none"
}
}
Sample cURL command
curl --request POST \
--url https://mixpanel.com/api/app/projects/{projectId}/connectors \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--data '
{
"connector_type": "s3Import",
"connector_properties": {
"s3_region": "us-east-2"
}
}
'
Sample Response
{
"status": "ok",
"results": {
"connector_id": "232f40cc-7ccc-4da3-b9c3-d8c1d14142c6",
"label": "",
"connector_type": "gcsImport",
"connector_properties": {
"gcs_bucket": "sample-data",
"gcs_prefix": "cloudimport/event",
},
"category_properties": {
"data_format": "mixpanel_event",
"compression": "none"
},
"status": "active",
"created_at": "2020-09-17T02:10:33.799738Z",
"created_by": "[email protected]"
}
}