Last active
April 6, 2020 11:40
-
-
Save zuzannamj/1feb2505c8c83959862ba5d0023ce2a2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//make api call to inject contact to a journey | |
if (email != null && accessToken != null) { | |
var email = Request.GetQueryStringParameter("email"); | |
var headerNames = ["Authorization"]; | |
var headerValues = ["Bearer " + accessToken]; | |
var jsonBody = { | |
"ContactKey": email, | |
"EventDefinitionKey": "APIEvent-xxxxxx", //provide journey EVENT DEFINITION KEY | |
"Data": { | |
"email_field": email | |
} | |
}; | |
var requestUrl = rest_instance_url + "/interaction/v1/events"; | |
var fireEntryEvent = HTTP.Post(requestUrl, contentType, Stringify(jsonBody), headerNames, headerValues); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment