curl --request POST \
--url https://api-{dc}.moengage.com/v1/cards/fetch \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'MOE-APPKEY: <moe-appkey>' \
--data '
{
"uid": "[email protected]",
"platforms": [
"ANDROID",
"WEB"
],
"last_updated_time": 1695987441,
"prev_sync_card_ids": [
"6516b30d2712560fdfae50c3_F_T_CA_AB_0_P_0_L_0_web"
],
"card_category": "Announcements"
}
'{
"status": true,
"request_id": "<string>",
"data": {
"deleted_card_ids": [
"<string>"
],
"cards": [
{
"id": "<string>",
"platform": "android",
"created_at": 123,
"updated_at": 123,
"meta_data": {
"cid": "<string>",
"moe_card_id": "<string>",
"moe_campaign_name": "<string>",
"moe_delivery_type": "One Time",
"moe_campaign_id": "<string>"
},
"template_data": {
"type": "basic",
"containers": [
{
"id": 123,
"type": "basic",
"style": {
"bgColor": "<string>"
},
"widgets": [
{
"id": 123,
"type": "text",
"content": "<string>"
}
],
"actions": [
{
"type": "screenName",
"name": "navigate",
"value": "<string>",
"kvPairs": {}
}
]
}
]
},
"user_activity": {
"is_clicked": true,
"first_seen": 123,
"first_delivered": 123,
"show_count": {}
},
"display_controls": {
"max_times_to_show": 123,
"expire_at": 123,
"expire_after_delivered": 123,
"is_pin": true
},
"category": "<string>"
}
]
},
"error": "<string>",
"title": "<string>",
"description": "<string>",
"code": "<string>"
}Fetch Cards for User
This API retrieves all active and updated cards for a specific user from the MoEngage Cards database. You can filter the search results based on the platform and card category and check if any card was updated for the user since the previous sync.
curl --request POST \
--url https://api-{dc}.moengage.com/v1/cards/fetch \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--header 'MOE-APPKEY: <moe-appkey>' \
--data '
{
"uid": "[email protected]",
"platforms": [
"ANDROID",
"WEB"
],
"last_updated_time": 1695987441,
"prev_sync_card_ids": [
"6516b30d2712560fdfae50c3_F_T_CA_AB_0_P_0_L_0_web"
],
"card_category": "Announcements"
}
'{
"status": true,
"request_id": "<string>",
"data": {
"deleted_card_ids": [
"<string>"
],
"cards": [
{
"id": "<string>",
"platform": "android",
"created_at": 123,
"updated_at": 123,
"meta_data": {
"cid": "<string>",
"moe_card_id": "<string>",
"moe_campaign_name": "<string>",
"moe_delivery_type": "One Time",
"moe_campaign_id": "<string>"
},
"template_data": {
"type": "basic",
"containers": [
{
"id": 123,
"type": "basic",
"style": {
"bgColor": "<string>"
},
"widgets": [
{
"id": 123,
"type": "text",
"content": "<string>"
}
],
"actions": [
{
"type": "screenName",
"name": "navigate",
"value": "<string>",
"kvPairs": {}
}
]
}
]
},
"user_activity": {
"is_clicked": true,
"first_seen": 123,
"first_delivered": 123,
"show_count": {}
},
"display_controls": {
"max_times_to_show": 123,
"expire_at": 123,
"expire_after_delivered": 123,
"is_pin": true
},
"category": "<string>"
}
]
},
"error": "<string>",
"title": "<string>",
"description": "<string>",
"code": "<string>"
}Rate Limit
The rate limit is 50K RPM (Requests Per Minute) and is applicable at the workspace (App) level.承認
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 Campaign report/Business events/Custom templates/Catalog API/Inform Report tile.
For more information on authentication and getting your credentials, refer here.
ヘッダー
クエリパラメータ
ボディ
You must provide either 'uid' or 'unique_id'.
Generating unique_id
The unique_id refers to the device identifier and is platform-specific.
- Android
- iOS:
MoEngageSDKCore.getMoEngageDeviceId(completionHandler: @escaping UserInfoHandler)
The unique_id is the platform-specific device identifier (e.g., IDFA/AAID) that uniquely identifies the user. Refer to Generating unique_id for details.
This field is used to filter the cards according to the platform. Cards of all the platforms that are provided are returned in the search result. When this field is not specified in the request, cards of all platforms are returned. Allowed Values: ANDROID, IOS, WEB.
ANDROID, IOS, WEB This field is used to filter the cards based on the card category. When this field is not specified in the request, cards of all categories are returned. For more information, refer to Card Categories.
This field is used to filter the cards based on the ID of the cards that were fetched earlier using this API. This field will be used to filter cards that do not have any changes made to them since the last fetch. Thus, only those cards that have been updated for the specified user since the last fetch would be returned. This should be used along with last_updated_time.
レスポンス
This response is returned when the request is processed successfully.