how to trigger WEBAPI dynamically

I have a Requirement where I need to trigger the WEB API in different Environments(this can be multiple selection) ,and this has to be done dynamically.The problem here is how can I pass the user name and passwords for different Environments in a!httpAuthenticationBasic() of HTTP query smart service dynamically based on user selection(we are in 17.1 version )

  Discussion posts and replies are publicly visible