Add Users to File Segment
curl --request PUT \
--url https://api-{dc}.moengage.com/v2/custom-segments/file-segment/add-users \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'MOE-DBNAME: <moe-dbname>' \
--data '
{
"name": "custom_segment_unique_name",
"cs_id": "<unique cs id>",
"attribute_name": "unique_identifier",
"attribute_type": "string",
"file_url": "https://s3.amazonaws.com/Sample_GAIDs_add.csv",
"callback_url": "http://example.com/moengage-callback",
"emails": [
"[email protected]"
]
}
'{
"message": "File-segment user-add request accepted",
"success": true,
"cs_name": "custom_segment_unique_name",
"cs_id": "6a1d8c3292d59351fe910b13"
}{
"title": "Invalid request",
"description": "expiry_time - Field is required but value is None : None"
}{
"title": "Authentication required",
"description": "APP_SECRET key mismatch. Please login to the dashboard to verify key"
}{
"title": "Entity Not Found",
"description": "Custom segment not found for the given name or cs_id: custom_segment_unique_name"
}{
"title": "Too Many Requests",
"description": "File segment operations limit breached. Please retry after some time."
}{
"title": "Internal Server Error"
}Add Users to File Segment
This API adds a list of users from a CSV file to an existing file segment.
PUT
/
v2
/
custom-segments
/
file-segment
/
add-users
Add Users to File Segment
curl --request PUT \
--url https://api-{dc}.moengage.com/v2/custom-segments/file-segment/add-users \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'MOE-DBNAME: <moe-dbname>' \
--data '
{
"name": "custom_segment_unique_name",
"cs_id": "<unique cs id>",
"attribute_name": "unique_identifier",
"attribute_type": "string",
"file_url": "https://s3.amazonaws.com/Sample_GAIDs_add.csv",
"callback_url": "http://example.com/moengage-callback",
"emails": [
"[email protected]"
]
}
'{
"message": "File-segment user-add request accepted",
"success": true,
"cs_name": "custom_segment_unique_name",
"cs_id": "6a1d8c3292d59351fe910b13"
}{
"title": "Invalid request",
"description": "expiry_time - Field is required but value is None : None"
}{
"title": "Authentication required",
"description": "APP_SECRET key mismatch. Please login to the dashboard to verify key"
}{
"title": "Entity Not Found",
"description": "Custom segment not found for the given name or cs_id: custom_segment_unique_name"
}{
"title": "Too Many Requests",
"description": "File segment operations limit breached. Please retry after some time."
}{
"title": "Internal Server Error"
}This API endpoint does not currently support Team-level scoping. All segments generated using this call will be assigned to the Default Team automatically.
Rate Limit
This operation counts toward the shared file segment operation budget of 10 operations per hour and 100 operations per day per workspace, combined across all file segment operations. See Create File Segment for the full list of file segment limits.承認
Authentication is done via Basic Auth. This requires a base64-encoded string of your credentials in the format 'username:password'.
- Username: Use your MoEngage workspace ID (also known as the App ID). You can find it in the MoEngage dashboard at Settings > Account > APIs > Workspace ID (earlier app id).
- Password: Use your API Key, which you can find within the Data tile.
For more information on authentication and getting your credentials, refer here.
ボディ
application/json
Details of the segment to update and the file URL of users to add.
Schema for updating an existing file segment (add, remove, replace users).
レスポンス
Request accepted for processing.
Response returned when a file segment request is accepted for processing.