Skip to main content
POST
/
cards
/
fetch
Fetch Cards for User
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": "<string>",
"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.

Action Examples

Below are examples of the JSON structure for different Action types returned within the Card object.
{
    "name": "navigate",
    "type": "richLanding",
    "value": "<value>",
    "kvPairs": {<KV Pairs>}
}

Authorizations

Authorization
string
header
required

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.

Headers

MOE-APPKEY
string
required

This is the Workspace ID of your MoEngage account that must be passed with the request. You can find it in the MoEngage dashboard at Settings > Account > APIs > Workspace ID (earlier app id).

Query Parameters

page
integer
default:1

This field contains the index of the pages to be returned in the search result. When this value is not passed in the request, one page is returned in the search result. The value should be a number greater than zero.

Required range: x >= 1
limit
integer

This field contains the number of cards returned in the search result. When this value is not passed in the request, all the cards are fetched and returned in the search result. The value should be a number greater than zero.

Required range: x >= 1

Body

application/json

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)
uid
string

The uid is the unique MoEngage Standard ID (Email ID Standard or Mobile Number Standard) that identifies the user. You can get the uid from the User Profile page of your dashboard.

This field is used to filter the cards based on the unique_id or uid specified in the request.

unique_id
string

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.

platforms
enum<string>[]

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.

Available options:
ANDROID,
IOS,
WEB
card_category
string

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.

prev_sync_card_ids
string[]

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.

last_updated_time
integer<int64>

This field is used to filter the cards based on the last time the cards were synced. This should be used along with prev_sync_card_ids to identify if there has been any update to the cards since the last sync. (Unix epoch time).

Response

This response is returned when the request is processed successfully.

status
boolean

Indicates if the request was successful (true) or unsuccessful (false).

request_id
string

Unique identifier for this API request.

data
object

This field contains the list of cards that satisfy the search criteria.

error
string | null

Error message if status is false.

title
string | null

Error title if status is false.

description
string | null

Error description if status is false.

code
string | null

Error code if status is false.