Get A User's Campaign History
API to get user’s campaign history.
Please Note
This is a premium feature, and in order to enable it, please contact your CSM or you can reach to our support team on [email protected]
WebEngage has opened up APIs that will allow clients to fetch all communications (with personalized value) sent to a particular user.
This will help clients achieve use cases like:
- Keeping a copy of all the communications sent to each end user.
- Helping client’s customer support teams to get access to all communication sent to the end users (along with its status) and accordingly provide better and faster resolutions.
Data upto last 15 days can be requested (from the date of calling the API).
This API is currently supported for Email, SMS, WhatsApp and Push.
To increase the request period, kindly reach out to you CSM or raise a ticket to support on [email protected].
Request format:
METHOD: POST
URL STRUCTURE:
- US/Global Environment:
curl --location --request POST 'https://api.webengage.com/v2/accounts/<YOUR_WEBENGAGE_LICENSE_CODE>/campaign-audit?uid=USER_ID'
- IN Environment:
curl --location --request POST '<https://api.in.webengage.com/v2/accounts/>\<YOUR_WEBENGAGE_LICENSE_CODE>/campaign-audit?uid=USER_ID'\
AUTHENTICATION: Bearer <YOUR_API_KEY>
Content-Type: application/json
Find your WebEngage License Code and API Key
Example:
curl --location --request POST 'https://api.webengage.com/v2//v2/accounts/\<YOUR_WEBENGAGE_LICENSE_CODE>/campaign-audit?uid=USER_ID' \
--header 'Authorization: Bearer <YOUR_API_KEY>' \
--header 'Content-Type: application/json' \
-data-raw '{
"channel": "ENTER CHANNEL_NAME"
"experimentId": "CAMPAIGN_ID"
data-raw
params are optional and are used to add filters while sending the request. If data-raw
params are not added then a user's entire campaign data for for last 15 days for all the channels will be sent as in response.
Following fields can be added in data-raw
:
Data-raw Parameters | Type | Description | Is mandatory |
---|---|---|---|
channel | string | Add this field in case communication details of a particular channel are required. If data is required for all channels then no need to add this key. | No |
experimentId | string | To be added in case communication details of a particular campaign are needed to be fetched | No |
from | date | If data is needed from a particular date then this param can be used. Note: Data can only be fetched within last 15 days from the query. | No |
to | date | If data is needed till a particular date then this param can be used. Note: Data can only be fetched within last 15 days from the query. | No |
Response format:
Response format for each channel:
{
"response": {
"data": {
"uid": "pp_push",
"licenseCode": "stg~aa133b83",
"messages": [
{
"experimentId": "~1h2enml",
"variationId": "~21n0tp",
"status": "SENT",
"channelType": "SMS",
"scope": "~336cej341092ec8_4a292459-9090-4adf-99c5-d9e7fad2f739:1696936033846",
"creationTime": "2023-10-10T11:08:56.487Z",
"category": "announcement",
"campaignName": "CA SMS_more length",
"serviceProvider": "INFOBIP",
"message": {
"description": ":tada: Don't miss out on our massive SALE! :shopping_bags: Get up to 50% OFF on our entire range of products :gift:. Hurry, limited stock available :alarm_clock:. Visit our store now or shop online :globe_with_meridians: to snag amazing deals and discounts :money_with_wings:. Happy shopping! :shopping_bags:DON'T MISS OUT ON THIS OPPORTUNITY TO SAVE BIG :moneybag:. VISIT US TODAY!\n:tada: Don't miss out on our massive SALE! :shopping_bags: Get up to 50% OFF on our entire range of products :gift:. Hurry, limited stock available :alarm_clock:. Visit our store now or shop online :globe_with_meridians: to snag amazing deals and discounts :money_with_wings:. Happy shopping! :shopping_bags:DON'T MISS OUT ON THIS OPPORTUNITY TO SAVE BIG :moneybag:. VISIT US TODAY!",
"layoutType": "TEXT",
"sms": {
"fromNumber": "WBENGE"
}
}
},
{
"experimentId": "37hd42q",
"variationId": "~4kj4bm",
"status": "SENT",
"channelType": "SMS",
"scope": "~351g8e2eee34e60_37b8b3ff-ce7d-44bd-82cb-aeab7edcd4a3:1696916948833",
"creationTime": "2023-10-10T05:50:57.641Z",
"category": "announcement",
"campaignName": "appinbox_ca_sms_sanity_stag",
"serviceProvider": "INFOBIP",
"message": {
"description": "Hi appinbox_valens, text for Internal development and testing of SMS appinbox2 - WebEngage",
"layoutType": "TEXT",
"sms": {
"fromNumber": "WBENGE"
}
}
},
{
"experimentId": "~10l2n6h",
"variationId": "f3603l",
"status": "SENT",
"channelType": "SMS",
"scope": "~5cbfjia3443i5d4_498d9b1f-e70d-47e7-adae-7abf16686cd3:1695974818056",
"creationTime": "2023-09-29T08:08:41.791Z",
"category": "announcement",
"campaignName": "FIX_CA sanity_1_fix_2",
"serviceProvider": "INFOBIP",
"message": {
"description": "Hi ca_fixsanity, text for Internal development and testing of SMS appinbox2 - WebEngage",
"layoutType": "TEXT",
"sms": {
"fromNumber": "WBENGE"
}
}
}
]
},
"message": "success",
"status": "success"
}
}
{
"response": {
"data": {
"uid": "pp_push",
"licenseCode": "stg~aa133b83",
"messages": [
{
"experimentId": "~2kn9p33",
"variationId": "367643f",
"status": "SENT",
"channelType": "EMAIL",
"scope": "~2jg57942dd0if54_848a7531-615b-459d-a1f6-e303fe7d24a9:1697092726733",
"creationTime": "2023-10-12T06:39:03.538Z",
"category": "announcement",
"campaignName": "appinbox _ca_email",
"serviceProvider": "SPARKPOST",
"message": {
"title": "Test email",
"description": "<!doctype html><html><head>\n</head>\n<body>\n<p>Test</p>\n\n</body></html>",
"layoutType": "TEXT",
"email": {
"fromEmail": "[email protected]",
"fromName": "testemail_appinbox",
"mediaAttachmentDetails": [
{
"fileName": "Samplemage1.jpeg",
"extension": "png",
"uploadUrl": "https://afiles.stg.webengage.biz/stg~aa133b83/abfab2b8-c90f-42ee-ba2f-b86744956ec1.jpeg"
}
],
"fallback": "<!doctype html><html><head>\n</head>\n<body>\n<p>Test</p>\n\n</body></html>"
}
}
},
{
"experimentId": "~2kn9p33",
"variationId": "367643f",
"status": "SENT",
"channelType": "EMAIL",
"scope": "~2jg57942dd0if54_848a7531-615b-459d-a1f6-e303fe7d24a9:1697092726733",
"creationTime": "2023-10-12T06:39:03.538Z",
"category": "announcement",
"campaignName": "appinbox _ca_email",
"serviceProvider": "SPARKPOST",
"message": {
"title": "Test email",
"description": "<!doctype html><html><head>\n</head>\n<body>\n<p>Test</p>\n\n</body></html>",
"layoutType": "TEXT",
"email": {
"fromEmail": "[email protected]",
"fromName": "testemail_appinbox",
"mediaAttachmentDetails": [
{
"fileName": "Samplemage1.jpeg",
"extension": "png",
"uploadUrl": "https://afiles.stg.webengage.biz/stg~aa133b83/abfab2b8-c90f-42ee-ba2f-b86744956ec1.jpeg"
}
],
"fallback": "<!doctype html><html><head>\n</head>\n<body>\n<p>Test</p>\n\n</body></html>"
}
}
}
]
},
"message": "success",
"status": "success"
}
}
{
"response": {
"data": {
"uid": "pp_whatsapp",
"licenseCode": "stg~aa133b83",
"messages": [
{
"experimentId": "~2ask1gl",
"variationId": "~38rlbb8",
"status": "SENT",
"channelType": "WHATSAPP",
"scope": "2cfac9612418457_1d76b2f2-5f55-4b5a-82a1-1a0b6eed9131:1697432453259",
"creationTime": "2023-10-16T05:01:26.259Z",
"category": "announcement",
"campaignName": "CA_WA_appinbox_ns_CE changes_2",
"serviceProvider": "INTERAKT",
"message": {
"description": "Hi appinbox_ns_wa_CE_changes_2 your order is shipped.",
"layoutType": "VIDEO",
"whatsapp": {
"fromNumber": "19382533689",
"footer": "",
"mediaAttachmentDetails": {
"mediaUrl": "https://jsoncompare.org/LearningContainer/SampleFiles/Video/MP4/sample-mp4-file.mp4"
}
}
}
},
{
"experimentId": "13cjj5n",
"variationId": "~2dgir4c",
"status": "SENT",
"channelType": "WHATSAPP",
"scope": "~1757322f09a213c_ccfcdca7-f3ed-48b6-b7c5-15a13569039b:1697196348526",
"creationTime": "2023-10-13T12:11:48.131Z",
"category": "announcement",
"campaignName": "CA_WA_appinbox_ns_CE changes_1",
"serviceProvider": "INTERAKT",
"message": {
"description": "Hi appinbox_ns_wa_CE_changes_1 your order is shipped.",
"layoutType": "VIDEO",
"whatsapp": {
"fromNumber": "19382533689",
"footer": "",
"mediaAttachmentDetails": {
"mediaUrl": "https://jsoncompare.org/LearningContainer/SampleFiles/Video/MP4/sample-mp4-file.mp4"
}
}
}
},
{
"experimentId": "~a2n552",
"variationId": "~f03qg9",
"status": "SENT",
"channelType": "WHATSAPP",
"scope": "58272a21-c5d4-4424-aaa8-3bdb6a43ade3",
"creationTime": "2023-10-03T07:04:13.000Z",
"category": "announcement",
"campaignName": "relay_WA_CA",
"journeyId": "~hhc9e0",
"serviceProvider": "INTERAKT",
"message": {
"description": "Hi relay_wa_campaign your order is shipped.",
"layoutType": "VIDEO",
"whatsapp": {
"fromNumber": "19382533689",
"footer": "",
"mediaAttachmentDetails": {
"mediaUrl": "https://jsoncompare.org/LearningContainer/SampleFiles/Video/MP4/sample-mp4-file.mp4"
}
}
}
}
]
},
"message": "success",
"status": "success"
}
}
{
"response": {
"data": {
"uid": "SG_001",
"licenseCode": "stg~aa133b83",
"messages": [
{
"experimentId": "2sl6hn",
"variationId": "~2j5a76m",
"status": "SENT",
"channelType": "PUSH_NOTIFICATION",
"scope": "~2a2f1ggdi7d7hf3_e4e42598-c8c6-44c9-a901-cf8ced90cd46#1:1697177047218",
"creationTime": "2023-10-13T06:04:10.157Z",
"category": "announcement",
"campaignName": "push all",
"message": {
"title": "Testing",
"description": "Testing",
"backgroundColor": "#DFCECE",
"layoutType": "TEXT",
"androidDetails": {
"advancedCustomizations": {}
},
"iosDetails": {
"advancedCustomizations": {}
},
"customizations": {
"richTitle": "<!DOCTYPE html><html><head></head><body>Testing</body></html>",
"richMessage": "<!DOCTYPE html><html><head></head><body>Testing</body></html>"
}
}
},
{
"experimentId": "~3bcidqn",
"variationId": "~4jbkilk",
"status": "SENT",
"channelType": "PUSH_NOTIFICATION",
"scope": "~448gjihc54i6afc_d2950ac2-9d6e-459b-8002-d5c699ec77e8#1:1696502635526",
"creationTime": "2023-10-05T10:43:56.528Z",
"category": "announcement",
"campaignName": "NI sanity CA ",
"message": {
"title": "NI sanity CA",
"description": "NI sanity CA desc",
"backgroundColor": "",
"layoutType": "TEXT",
"androidDetails": {
"advancedCustomizations": {}
},
"iosDetails": {
"advancedCustomizations": {}
},
"customizations": {
"richTitle": "<!DOCTYPE html><html><head></head><body>NI sanity CA</body></html>",
"richMessage": "<!DOCTYPE html><html><head></head><body>NI sanity CA desc</body></html>"
}
}
}
]
},
"message": "success",
"status": "success"
}
}
Response format for multiple channels :
{
"response": {
"data": {
"uid": "pp_withcc",
"licenseCode": "aa131d2c",
"messages": [
{
"experimentId": "~qd373c",
"variationId": "vcp7iu",
"status": "SENT",
"channelType": "SMS",
"scope": "~2bhifbg4c176gi9_e2d325d6-8311-40dc-875b-c6424d93d9ff:1699255633355",
"creationTime": "2023-11-06T07:27:17.531Z",
"category": "announcement",
"campaignName": "Prod Deployment CA sanity_fix",
"serviceProvider": "INFOBIP",
"message": {
"description": "Hi pritesh_withcc, text for Internal development and testing of SMS pp2 - WebEngage",
"layoutType": "TEXT",
"sms": {
"fromNumber": "WBENGE"
}
}
},
{
"experimentId": "~2kn6q7g",
"variationId": "28q22qi",
"status": "SENT",
"channelType": "WHATSAPP",
"scope": "~399fd1bb8i86de9_cbdb1d5a-c512-45b7-9b11-5fad7d033cf8:1699255427406",
"creationTime": "2023-11-06T07:25:03.721Z",
"category": "announcement",
"campaignName": "Test CA New CE deploy whatsap_new01_fix",
"serviceProvider": "INTERAKT",
"message": {
"description": "Hi us_fix_cca_ce_sanity your order is shipped.",
"layoutType": "VIDEO",
"whatsapp": {
"fromNumber": "19382533689",
"footer": "",
"mediaAttachmentDetails": {
"mediaUrl": "https://jsoncompare.org/LearningContainer/SampleFiles/Video/MP4/sample-mp4-file.mp4"
}
}
}
},
{
"experimentId": "~qd373b",
"variationId": "32ag04q",
"status": "SENT",
"channelType": "WHATSAPP",
"scope": "f34a6c0e-5523-45a9-be77-bba5b7a24817",
"creationTime": "2023-11-06T07:20:17.904Z",
"category": "announcement",
"campaignName": "CA CE fix NEW txn",
"message": {
"description": "Hi US FIX TXN your order is shipped.",
"layoutType": "VIDEO",
"whatsapp": {
"fromNumber": "19382533689",
"footer": "",
"mediaAttachmentDetails": {
"mediaUrl": "https://jsoncompare.org/LearningContainer/SampleFiles/Video/MP4/sample-mp4-file.mp4"
}
}
}
},
{
"experimentId": "~2ra02sc",
"variationId": "jclddt",
"status": "SENT",
"channelType": "SMS",
"scope": "null_36179a6a-9459-460f-9416-917a8ba3bf80:1699249326407",
"creationTime": "2023-11-06T05:42:14.093Z",
"category": "announcement",
"campaignName": "Prod CE worker deployment_TTJ",
"serviceProvider": "INFOBIP",
"message": {
"description": "Hi pritesh_withcc, text for Internal development and testing of SMS pp2 - WebEngage",
"layoutType": "TEXT",
"sms": {
"fromNumber": "WBENGE"
}
}
},
{
"experimentId": "9fhbe8",
"variationId": "~k1ssf8",
"status": "SENT",
"channelType": "SMS",
"scope": "null_29d50c86-f731-4e51-b67c-d60c34bf1c4d:1699249326400",
"creationTime": "2023-11-06T05:42:13.731Z",
"category": "announcement",
"campaignName": "trigger SMS check",
"serviceProvider": "INFOBIP",
"message": {
"description": "Hi pritesh_withcc, text for Internal development and testing of SMS pp2 - WebEngage",
"layoutType": "TEXT",
"sms": {
"fromNumber": "WBENGE"
}
}
},
{
"experimentId": "~gidc73",
"variationId": "43hc1e7",
"status": "SENT",
"channelType": "WHATSAPP",
"scope": "~4ejj28eg772f8a9_277a1ca0-c483-480d-b118-6144dc7afffb:1698850619235",
"creationTime": "2023-11-01T14:57:02.931Z",
"category": "announcement",
"campaignName": "Test CA New CE deploy whatsap_new01",
"serviceProvider": "INTERAKT",
"message": {
"description": "Hi beta_ce_streamer_new your order is shipped.",
"layoutType": "VIDEO",
"whatsapp": {
"fromNumber": "19382533689",
"footer": "",
"mediaAttachmentDetails": {
"mediaUrl": "https://jsoncompare.org/LearningContainer/SampleFiles/Video/MP4/sample-mp4-file.mp4"
}
}
}
},
{
"experimentId": "3hc5qgs",
"variationId": "1embie7",
"status": "SENT",
"channelType": "SMS",
"scope": "3a779j17j12b17j_48bcef37-a9a8-4b81-9729-066c0c511b36:1698849200862",
"creationTime": "2023-11-01T14:33:43.261Z",
"category": "announcement",
"campaignName": "Prod Deployment CA sanity",
"serviceProvider": "INFOBIP",
"message": {
"description": "Hi pritesh_withcc, text for Internal development and testing of SMS pp2 - WebEngage",
"layoutType": "TEXT",
"sms": {
"fromNumber": "WBENGE"
}
}
},
{
"experimentId": "16kj6og",
"variationId": "1ivr24o",
"status": "SENT",
"channelType": "SMS",
"scope": "custom-scope-2",
"creationTime": "2023-10-31T13:45:48.179Z",
"category": "announcement",
"campaignName": "Prod CE CA worker ",
"serviceProvider": "INFOBIP",
"message": {
"description": "Hi pritesh_withcc, text for Internal development and testing of SMS pp2 - WebEngage",
"layoutType": "TEXT",
"sms": {
"fromNumber": "WBENGE"
}
}
},
{
"experimentId": "16kj6og",
"variationId": "1ivr24o",
"status": "SENT",
"channelType": "SMS",
"scope": "custom-scope",
"creationTime": "2023-10-31T13:40:07.166Z",
"category": "announcement",
"campaignName": "Prod CE CA worker ",
"serviceProvider": "INFOBIP",
"message": {
"description": "Hi pritesh_withcc, text for Internal development and testing of SMS pp2 - WebEngage",
"layoutType": "TEXT",
"sms": {
"fromNumber": "WBENGE"
}
}
},
{
"experimentId": "~dagnmo",
"variationId": "1act1l1",
"status": "SENT",
"channelType": "SMS",
"scope": "5aa791f2-8803-4605-8246-6630140a68c2",
"creationTime": "2023-10-31T07:33:12.283Z",
"category": "announcement",
"campaignName": "J_CA CE workde deployment ",
"journeyId": "abmlfc7",
"serviceProvider": "INFOBIP",
"message": {
"description": "Hi pritesh_withcc, text for Internal development and testing of SMS pp2 - WebEngage",
"layoutType": "TEXT",
"sms": {
"fromNumber": "WBENGE"
}
}
}
]
},
"message": "success",
"status": "success"
}
}
Errors
List of API error status codes.
Please feel free to drop in a few lines at [email protected] or get in touch with your Onboarding Manager in case you have any further queries.
Updated 12 months ago