Created
August 6, 2020 15:56
-
-
Save taf2/0c33b0bb66a2e593788c1d7aede0c815 to your computer and use it in GitHub Desktop.
Update Zendesk Ticket with Chat Transcription
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 = function(event, context, callback) { | |
const ticket = event.activity.custom_fields.zd_ticket.match(/\d+/)[0] | |
const data = {call_id: event.activity.id, ticket_id: ticket, ticket_data: {"ticket": {"status": "open", "comment": { "body": event.activity.chat_transcription }}}} | |
var authHeaders = {'Authorization': process.env.ZDAuth}; | |
context.http_post('https://app.calltrackingmetrics.com/api/v1/accounts/25/zendesk/update_ticket', | |
JSON.stringify(data), | |
authHeaders).then(function(request) { | |
context.done(); | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment