Show gradio.Warning when clicking a button

I have a button that sends a request to an API but I also want this button to show a message when the API call has completed and run correctly.

I have seen the gradio.Warning message popup but the documentation is a bit scarce and cannot make my head around it in combination with the button handler.

Any help or code snippet that I can check?