show me request bodies and response bodies of this route exports.infobipApi = async (request, response) => {
  let action = request.body.data.action;
  let objRequest = {};

  objRequest.apiKey = request.body.data.apiKey;
  objRequest.baseUrl = request.body.data.baseUrl;
  objRequest.to = request.body.data.to;
  objRequest.from = request.body.data.from;
  objRequest.message = request.body.data.message;
  objRequest.title = request.body.data.titleMessage;
  objRequest.smsWebhook = request.body.data.smsWebhook;
  objRequest.omniWebhook = request.body.data.omniWebhook;
  objRequest.mid = request.body.data.mid;
  objRequest.addTracking = request.body.data.addTracking;
  objRequest.removeProtocol = request.body.data.removeProtocol;
  objRequest.choosedDomain = request.body.data.choosedDomain;
  objRequest.dltTemplate = request.body.data.dltTemplate;
  objRequest.principalEntityId = request.body.data.principalEntityId;
  objRequest.contentTemplateId = request.body.data.contentTemplateId;
  
  if (action === 'SMS') {
    objRequest.requestUrl = '/sms/2/text/advanced';
    objRequest.action = 'SMS';
    objRequest.postData = {
      'messages': [{
        'from': objRequest.from,
        'destinations':[{'to': objRequest.to}],
        'text': objRequest.message, 
        'title': objRequest.title, 
        'notifyUrl': objRequest.smsWebhook,
        ...(objRequest.dltTemplate && { // INFB-975
          'regional': {
            'indiaDlt': {
                'contentTemplateId': objRequest.contentTemplateId,
                'principalEntityId': objRequest.principalEntityId // required
              }
            }
        }),
        "callbackData": "test-message"
        }],
        // INFB-765
        ...(objRequest.addTracking && { 'urlOptions': {
            "shortenUrl": true,
            "trackClicks": true,
            "trackingUrl": objRequest.smsWebhook,
            ...(objRequest.removeProtocol && { "removeProtocol": objRequest.removeProtocol }),
            ...(objRequest.choosedDomain && { "customDomain": objRequest.choosedDomain })
          }
        })
      };
  }

  // https://dm1qpg.api.infobip.com/whatsapp/1/message/text
  if (action === 'VIBER') {
    objRequest.requestUrl = '/omni/1/advanced?piIntegrator=89&piPlatform=k3en'
    objRequest.name = 'Viber';
    objRequest.action = 'VIBER';
    objRequest.imageUrl = request.body.data.imageUrl;
    objRequest.buttonUrl = request.body.data.buttonUrl;
    objRequest.buttons = request.body.data.buttons;
    objRequest.scenarioKey = request.body.data.viberSenderKey;
    objRequest.viberSenderKey = request.body.data.viberSenderKey;
    objRequest.buttonText = request.body.data.buttonText;
    objRequest.isPromotional = request.body.data.isPromotional;
    objRequest.urlTracking = request.body.data.urlTracking;
    objRequest.omniWebhook = request.body.data.omniWebhook;
  }

  if (action === 'VIBER-NEW') {
    objRequest.action = 'VIBER-NEW';
    objRequest.imageUrl = request.body.data.imageUrl;
    objRequest.buttonUrl = request.body.data.buttonUrl;
    objRequest.buttons = request.body.data.buttons;
    objRequest.buttonText = request.body.data.buttonText;
    objRequest.isPromotional = request.body.data.isPromotional;
    objRequest.urlTracking = request.body.data.urlTracking;
    objRequest.omniWebhook = request.body.data.omniWebhook;
  }

  if (action === 'KAKAO') {
    objRequest.requestUrl = '/omni/1/advanced?piIntegrator=89&piPlatform=k3en'
    objRequest.name = 'Kakao';
    objRequest.action = 'KAKAO';
    objRequest.buttons = request.body.data.buttons;
    objRequest.imageUrlKakao = request.body.data.imageUrlKakao;
    objRequest.imageLink = request.body.data.imageLink;
    objRequest.scenarioKey = request.body.data.kakaoSenderKey;
    objRequest.kakaoSenderKey = request.body.data.kakaoSenderKey;
    objRequest.key = request.body.data.key;
    objRequest.omniWebhook = request.body.data.omniWebhook;
  }

  if (action === 'WHATSUP') {
    objRequest.name = 'Whatsup';
    objRequest.action = 'WHATSUP';
    objRequest.template = request.body.data.template
    objRequest.templateType = request.body.data.templateType
    objRequest.customParameters = request.body.data.customParameters
    objRequest.templatePicked = request.body.data.templatePicked
    objRequest.templateData = request.body.data.templateData
    objRequest.templateName = request.body.data.templateName
  }

  requestBuilder(objRequest, response, null);
};

requestBuilder = async (objRequest, response, journeyInfo) => {
  /**/
  /* Checking Channels */  
  /**/
  objRequest.uuid = uuidv4();
  let client = appInsights.defaultClient;
  if (!objRequest.to) {
    client.trackEvent({name: "Validation", properties: {errorContentPostData: `${objRequest.activityName} ${objRequest.mid}` }});
    response.status(400).json({messageData: 'test output', messageStatus: 'Error: Missing phone number in request'});
    return;
  }

  if (objRequest.action === 'VIBER-NEW') {
    let content = {
      "content": {
        "text": objRequest.message,
        "mediaUrl": objRequest.imageUrl,
        "button": {
          "title": objRequest.buttonText,
          "action": objRequest.buttonUrl
          }
      },
    };

    removeEmptyProperties(content);
    objRequest.requestUrl = `/viber/1/message/${content.content.mediaUrl ? 'image?piIntegrator=89&piPlatform=k3en' : 'text?piIntegrator=89&piPlatform=k3en'}`;

    const dataPrepared = {
      "from": objRequest.from,
      "to": objRequest.to.replace('+', ''),
      "messageId": objRequest.uuid,
      ...content,
      "callbackData": journeyInfo // INFB-729
        ? `{
          "ActivityId": "${journeyInfo ? journeyInfo.activityId : "activityIdEmpty"}",
          "BulkId": "${objRequest.activityName}",
          "From": "${objRequest.from ? objRequest.from : "fromEmpty"}",
          "Message": "${objRequest.message ? objRequest.message : "messageEmpty"}",
          "JourneyName": "${objRequest.journeyName ? objRequest.journeyName : "journeyNameEmpty"}",
          "VersionId": "${journeyInfo ? journeyInfo.journeyId : "versionIdEmpty"}",
          "VersionNumber": "${objRequest.versionNumber ? objRequest.versionNumber : "versionNumberEmpty"}",
          "ContactKey": "${objRequest.contactKeyNew || objRequest.contactKey || "contactKeyEmpty"}",
          "MID": "${objRequest.mid}"
        }` // INFB-409, INFB-437, INFB-621, INFB-622
        : "test-message",
      "notifyUrl": objRequest.omniWebhook,
      // INFB-765 // INFB-764
      ...(objRequest.addTracking && { 'urlOptions': {
          "shortenUrl": true,
          "trackClicks": true,
          "trackingUrl": objRequest.omniWebhook,
          ...(objRequest.removeProtocol && { "removeProtocol": objRequest.removeProtocol }),
          ...(objRequest.choosedDomain && { "customDomain": objRequest.choosedDomain })
        }
      })
    };

    if (objRequest.requestUrl.includes('image')) {  
      objRequest.postData = dataPrepared
    } else {
      objRequest.postData =  {
          messages: [{...dataPrepared}]
      }
    }
  }

  if (objRequest.action === 'VIBER') {
    // INFB-450
    // INFB-564
    if (objRequest.imageUrl && !objRequest.message && !objRequest.buttonText && !objRequest.buttonUrl) {
      delete objRequest.message;
      delete objRequest.buttonText;
      delete objRequest.buttonUrl;
    }

    objRequest.postData = {
      "scenarioKey": objRequest.scenarioKey || objRequest.viberSenderKey,
      "destinations": [
        {
          "to": {
              "phoneNumber": objRequest.to
          },
          "messageId": objRequest.uuid
        }
      ],
      "viber": {
        "text": objRequest.message,
        "isPromotional": true,
        "imageURL": objRequest.imageUrl,
        "buttonText": objRequest.buttonText,
        "buttonURL": objRequest.buttonUrl
      },
      "callbackData": journeyInfo // INFB-729
        ? `{
          "ActivityId": "${journeyInfo ? journeyInfo.activityId : "activityIdEmpty"}",
          "BulkId": "${objRequest.activityName}",
          "From": "${objRequest.from ? objRequest.from : "fromEmpty"}",
          "Message": "${objRequest.message ? objRequest.message : "messageEmpty"}",
          "JourneyName": "${objRequest.journeyName ? objRequest.journeyName : "journeyNameEmpty"}",
          "VersionId": "${journeyInfo ? journeyInfo.journeyId : "versionIdEmpty"}",
          "VersionNumber": "${objRequest.versionNumber ? objRequest.versionNumber : "versionNumberEmpty"}",
          "ContactKey": "${objRequest.contactKey ? objRequest.contactKey : "contactKeyEmpty"}",
          "MID": "${objRequest.mid}"
        }` // INFB-409, INFB-437, INFB-621, INFB-622
        : "test-message",
        "notifyUrl": objRequest.omniWebhook
    };

    // INFB-436
    if (objRequest.urlTracking) {
      objRequest.postData["notifySeenStatus"] = "true";
      objRequest.postData["notifyUrlOpen"] = "true";
      objRequest.postData["urlOptions"] = { "shorten": true };
      objRequest.postData["messageTracking"] = {
        "type": "STATUS_CLICKED",
        "webhook": objRequest.omniWebhook
      };
    }
  }

  if (objRequest.action === 'KAKAO') {
      objRequest.postData = {
        "scenarioKey": objRequest.scenarioKey || objRequest.kakaoSenderKey, 
        "destinations": [
            {
                "to": {
                    "phoneNumber": objRequest.to
                },
                "messageId": objRequest.uuid
            }
        ],
        "kakaoChingu": {
            "text": objRequest.message,
            "buttons": objRequest.buttons,
            "imageUrl": objRequest.imageUrlKakao,
            "imageLink": objRequest.imageLink,
            "isPromotional": objRequest.isPromotional
          },
        "callbackData": journeyInfo // INFB-729
          ? `{
            "ActivityId": "${journeyInfo ? journeyInfo.activityId : "activityIdEmpty"}",
            "BulkId": "${objRequest.activityName}",
            "From": "${objRequest.kakaoSenderId ? objRequest.kakaoSenderId : "fromEmpty"}",
            "Message": "${objRequest.message ? objRequest.message : "messageEmpty"}",
            "JourneyName": "${objRequest.journeyName ? objRequest.journeyName : "journeyNameEmpty"}",
            "VersionId": "${journeyInfo.journeyId ? journeyInfo.journeyId : "versionIdEmpty"}",
            "VersionNumber": "${objRequest.versionNumber ? objRequest.versionNumber : "versionNumberEmpty"}",
            "ContactKey": "${objRequest.contactKey ? objRequest.contactKey : "contactKeyEmpty"}",
            "MID": "${objRequest.mid}"
          }` // INFB-409, INFB-437, INFB-621, INFB-622
          : "test-message",
          "notifyUrl": objRequest.omniWebhook
      };
  }

  if (objRequest.action === 'WHATSUP') {
    let whatsAppRequest = setWhatsAppRequest(objRequest, null, journeyInfo);
    objRequest = whatsAppRequest;
  }

  if (objRequest.action === 'SMS') {
    objRequest.postData = 
      { 'messages': [{
        'from': objRequest.from,
        'destinations':[{'to': objRequest.phoneDynamicField || objRequest.to, 'messageId': objRequest.uuid}],
        'text': objRequest.message, 
        "callbackData": `{
          "ActivityId": "${journeyInfo ? journeyInfo.activityId : "activityIdEmpty"}",
          "BulkId": "${objRequest.activityName}",
          "From": "${objRequest.from ? objRequest.from : "fromEmpty"}",
          "Message": "${objRequest.message ? objRequest.message : "messageEmpty"}",
          "JourneyName": "${objRequest.journeyName ? objRequest.journeyName : "journeyNameEmpty"}",
          "VersionId": "${objRequest.journeyId ? objRequest.journeyId : "versionIdEmpty"}",
          "VersionNumber": "${objRequest.versionNumber ? objRequest.versionNumber : "versionNumberEmpty"}",
          "ContactKey": "${objRequest.contactKey ? objRequest.contactKey : "contactKeyEmpty"}",
          "MID": "${objRequest.mid}"
        }`, // INFB-409, INFB-437, INFB-621, INFB-622
        'title': objRequest.title, 
        'notifyUrl': objRequest.smsWebhook,
        ...(objRequest.dltTemplate && { // INFB-975
          'regional': {
            'indiaDlt': {
                'contentTemplateId': objRequest.contentTemplateId,
                'principalEntityId': objRequest.principalEntityId // required
              }
            }
          }),
        }],
        // INFB-765
        ...(objRequest.addTracking && { 'urlOptions': {
            "shortenUrl": true,
            "trackClicks": true,
            "trackingUrl": objRequest.smsWebhook,
            ...(objRequest.removeProtocol && { "removeProtocol": objRequest.removeProtocol }),
            ...(objRequest.choosedDomain && { "customDomain": objRequest.choosedDomain })
          }
        })
      };
  }


  const queueName = `${objRequest.action.toLocaleLowerCase()}-${objRequest.mid}`;

  // Create a Service Bus client using the connection string to the Service Bus namespace
  const sbClient = new ServiceBusClient(connectionString);

  // Create a sender that can be used to send messages to the queue
  const sender = sbClient.createSender(queueName);
  let channelName = objRequest.action === 'WHATSUP' ? 'whatsapp' : objRequest.action.toLocaleLowerCase().replace('-', '');

  // Create the message object
  const postData = JSON.stringify(objRequest.postData);
  const message = {
    body: {
      requestId: objRequest.uuid,
      channel: channelName,
      quote: queueName,
      requestOptions: {
        method: "POST",
        hostname: objRequest.baseUrl,
        path: objRequest.action === 'SMS' ? `${objRequest.requestUrl}?piIntegrator=89&piPlatform=k3en` : objRequest.requestUrl,
        headers: {
          Authorization: `App ${objRequest.apiKey}`,
          "Content-Type": "application/json",
          Accept: "application/json",
        },
        maxRedirects: 20,
      },
      content: postData,
    },
  };

  if (objRequest.isNotSingleSend) {
  // Send the message to the queue

  sender.sendMessages(message)
    .then(() => {
      // Close the sender and the Service Bus client
      sender.close()
        .then(() => {
          client.trackEvent({name: "Message Added Sucesfully", properties: {content: `Success: Send message to quote ${queueName}` }});
          response.status(200).json({messageData: objRequest.uuid, messageStatus: 'Success'});
          sbClient.close();
        })
        .catch((err) => {
          response.status(400);
          client.trackEvent({name: "QuoteError", properties: {errorContentPostData: `Error: Send message to quote ${JSON.stringify(err)}` }});
        });
    })
    .catch((err) => {
      response.status(400);
      client.trackEvent({name: "QuoteError", properties: {errorContentPostData: `Error: Send message to quote ${JSON.stringify(err)}` }});
    });
  } else {
    let req = https.request(message.body.requestOptions, function (res) {
      var chunks = [];

      res.on('data', function (chunk) {
        chunks.push(chunk);
      });
      res.on('end', async function () {
        try {
          let body = Buffer.concat(chunks);
          let str = body.toString();
          let responseData = JSON.parse(str);
          let messageId = responseData.messages ? responseData.messages[0]['messageId']
          : responseData.messageId ? responseData.messageId
          : 'MSG_ERROR';
          if (messageId !== 'MSG_ERROR') {
            response.status(200).json({messageSend: 'ok'});
          } else {
            client.trackEvent({name: "Error from infobip", properties: {errorContent: responseData}});
            response.status(400).json({Error: responseData});
          }
        } catch (e) {
          client.trackEvent({name: "Error from infobip", properties: {errorContent: e}});
          response.status(400).json({Error: e});
        }
      });
      res.on('error', async function (error) {
        client.trackEvent({name: "Error from infobip", properties: {errorContent: error}});
      });
      req.on('timeout', async () => {
        client.trackEvent({name: "Error from infobip", properties: {errorContent: 'timeout'}});
      });
    });

    req.write(message.body.content);
    req.end();
  }
}