8 – Passing option value into webservice

I am trying to pass an option value into a webservice using Drupal 8 webform JS, after doing an onchange for an element.

Anyone mind pointing me on the right path? Thank you so much.

What I have so far…

(function($, Drupal) {
Drupal.behaviors.getValue = {
    attach: function(context, settings) {
$(document.body).on('change',"value",function (e) {
   var optVal= $("value option:selected").val();
});         
    function service() {
                        }                       
                        var api = 'URL';
                        var format = '?_format=json';
                        var response = optVal;
                            $.ajax({
                              url: api + optVal + format,
                              method: 'GET',
                              headers: {
                                'Content-Type': 'application/json',
                                'Authorization': 'Basic value'
                              },
                          data: JSON.stringify(optVal),
                          success: service(data)

               });
        }       
    };
} )(jQuery, Drupal);