// task // snake case var taskJson = { // this shows up in flex on the task as the primary text "name": "chase@rentdynamics.com", // differentiates between different task queues based on acceptable response times "type": "short-lived", "rd": { // contactCenter -- we might not need this tbh -- especially if we do different flex projects or even different workspaces or workflows per contact center "contact_center_id":1, // spoken language "spoken_language_required": "spanish", // startDate "start_date": "2021-02-04T02:35:14.466Z", // clientId "client_id": 1, // communityGroupId if we have it "community_group_id": 2, // adSourceId here, then we'll put the adSourceName in the "conversations" sub-object "ad_source_id": 124, // could do this same thing using "community_group_priority": 10, // the following could handle all the training requirements "worker_experience_required": 7, // parent task when transferred to "parent_task_sid": "XXSF...", // this lets us know to show the follow up component on the frontend on the child task "parent_task_channel_unique_name": "follow-up", // this will be used to trigger search on the frontend if email "email_message_id": 2132424, // this will be used to trigger search on the frontend if call "call_detail_id": 2132424, // timing - what about holidays? "acceptable_contact_time_min_utc": "0800", "acceptable_contact_time_max_utc": "1630", "acceptable_contact_time_utc": -7, // the following will be used on the frontend to automatically go straight to a lead or resident, also it will be used when transferring a task to a supervisor "lead_id": 3245621, "resident_id": 435563, // used in transfers "transferred_from_user_id": 291, // completion "completed_by_user_id": 291, "call_route_step?": 0, ...{ /* ... any other use-case specific attributes can be added here */ } }, "targetWorker":"client:chasewgibbons", // outbpund call direct assignment added automatically by flex "flexOutboundDialerTargetWorker": "client:chasewgibbons", // outbpund call direct assignment added automatically by flex // direction "direction": "inbound", // todo: make this more robust "conversations" : { // s3 call recording link "segment_link" : "https://api.twilio.com/2010-04-01/Accounts/ACXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX/Recordings/REXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", // parent taskSid to link followUps together in flex insights "conversation_id" : "WTXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX", // whether or not conversation was productive "productive": "true", // example custom metric which doesn't count towards 2 billion unique values limit "conversation_attribute_1" : "Google", // links to above conversation_attribute_1 "conversation_label_1" : "AdSourceName", // integer of some measure, it might link to the conversation_attribute_1 and conversation_label_1 above, idk, need to look this one up.. "conversation_measure_1" : 101, // language used by participants in the conversation "language": "spanish", // outcome of conversation "outcome": "no appointment set" }, // todo: make this more robust "customers":{ "phone":"3059867013", "market_segment":"4th Street Commons", "organization":"Asset Campus Housing", "name":"JESSICA AUJLA", "custom_attr_1":true, "category":"4th Street Commons", "customer_manager":"Asset Campus Housing", // example custom metric which doesn't count towards 2 billion unique values limit "customer_attribute_1" : "544532", // links to above customer_attribute_1 "customer_label_1" : "LeadId", // value of this customer to the business, greater equals more valuable "business_value" : 7500 }, // dictates how flex behaves on frontend, this is added automatically on frontend direct assignments in certain instances as camelcase "autoAnswer":"false", // i'm not sure what this does tbh, but it is added on frontend automatically in certain instances "internal":"false" }