Created
October 1, 2018 19:32
-
-
Save phm200/b810c8f60334303f4fd1523affa755cd to your computer and use it in GitHub Desktop.
Connect Contact Attributes API
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
app.post("/submit-updateAttributes", async (req, res) => { | |
const contactId = req.body.contactId; | |
const flagForFollowUpRaw = req.body.flagForFollowUp; // will equal "on" if checked, undefined if false | |
const flagForFollowUp = flagForFollowUpRaw && flagForFollowUpRaw === "on"; | |
var updateContactAttributesParams = { | |
InstanceId: connectInstanceId, | |
InitialContactId: contactId, | |
Attributes: { | |
FlaggedForFollowUp: flagForFollowUp.toString() | |
} | |
}; | |
var updateContactAttributesPromise = connectClient | |
.updateContactAttributes(updateContactAttributesParams) | |
.promise(); | |
var updateContactAttributesResult = await updateContactAttributesPromise; | |
console.log("result", updateContactAttributesResult); | |
res.render("submittedUpdateAttributes", { | |
title: "Contact Attributes Updated" | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment