Interactive Message Execution code examples
Below code snippets are using sample Adobe Journey Optimizer API-triggered campaigns.
For each of these examples to run, you first have to create your API-triggered campaigns in the user interface and get ready with your Bearer token and API key. Note that these examples are written in curl but we support the language of your choice.
A detailed description of the API is available here
Copied to your clipboard{"requestId": "3126743632163793","campaignId": "10e2583b-4d1d-4b57-bd6e-fdc79405d67d","recipients": [{"type": "aep","namespace": "phone","userId": "1234567890"}]}
Copied to your clipboard{"requestId": "3126743632163793","campaignId": "10e2583b-4d1d-4b57-bd6e-fdc79405d67d","recipients": [{"type": "aep","namespace": "phone","userId": "test@gmail.com","channelData": {"mobilePhoneNumber": "1234567890"},"context": {"product" : {"name" : "Jackets","category": "Clothes"},"offerCode": "THANKSGIVING"}},{"type": "aep","namespace": "phone","userId": "test1@gmail.com","channelData": {"mobilePhoneNumber": "0921234567"},"context": {"product" : {"name" : "Jackets","category": "Clothes"},"offerCode": "THANKSGIVING"}}]}
Copied to your clipboard{"requestId": "3126743632163793","campaignId": "10e2583b-4d1d-4b57-bd6e-fdc79405d67d","recipients": [{"type": "aep","namespace": "ecid","userId": "12345678901234567890123456789493505531",/* User needs to configure push identity prior to execution. */"channelData": {"pushInfo": {"appID": "#appId#","platform": "#platform#","token": "#token#"}}}]}
Copied to your clipboard{"requestId": "3126743632163793","campaignId": "10e2583b-4d1d-4b57-bd6e-fdc79405d67d","recipients": [{"type": "aep","namespace": "email","userId": "test@gmail.com","context": {"product" : {"name" : "Jackets","category": "Clothes"},"offerCode": "THANKSGIVING"},"profile": {"person":{"name": {"firstName": "John","lastName": "Chao","courtesyTitle": "Mr."},"mobilePhone": {"number": "111-112-3456","primary": true},"personalEmail": {"address": "ajo_im@gmail.com","primary": true}}}}]}
Copied to your clipboard{"requestId": "3126743632163793","campaignId": "10e2583b-4d1d-4b57-bd6e-fdc79405d67d","recipients": [{"type": "aep","namespace": "email","userId": "test@gmail.com","channelData": {"emailAddress": "test123@gmail.com"},"context": {"product" : {"name" : "Jackets","category": "Clothes"},"offerCode": "THANKSGIVING"},"profile": {"person":{"name": {"firstName": "John","lastName": "Chao","courtesyTitle": "Mr."},"mobilePhone": {"number": "111-112-3456","primary": true},"personalEmail": {"address": "ajo_im@gmail.com","primary": true}}}}]}
Copied to your clipboard{"requestId": "3126743632163793","campaignId": "10e2583b-4d1d-4b57-bd6e-fdc79405d67d","recipients": [{"type": "aep","namespace": "email","userId": "test@gmail.com","mergePolicyName": "DefaultTimeBased","mergePolicySchema": "_xdm.context.profile","channelData": {"emailAddress": "test123@gmail.com"}}]}
Copied to your clipboard{"campaignId": "d54c23c4-d31c-429e-b8d1-9556b85a5b1f","context": {"product": {"name": "Jackets","category": "Clothes"},"offerCode": "THANKSGIVING"}}