Created
September 14, 2021 14:39
-
-
Save taf2/c8f3051da6467fb870f14e97cab47b3e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
exports.handler = async function(event, context, callback) { | |
// https://api.calltrackingmetrics.com/api/v1/accounts/{{account_id}}/calls/{{id}}/tag?tag={{tag}} | |
const source_tag = event.activity.source_tag; | |
console.log("check for tag: ", source_tag); | |
if (source_tag && source_tag.length) { | |
console.log("apply source tag: ", source_tag) | |
await context.ctm.api_patch(`calls/${event.activity.id}/tag`, {"tag":source_tag}); | |
context.done(); | |
} else { | |
console.log("no source tag") | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment