Add an On Click event to the button with the following code:
// Define the endpoint URI
var uri = "https://verjtraining.verj.cloud/apps/api/dice/roll";
// Define the headers map
var headers = { "Accept": "application/json" };
// Define the parameters map
// This specifies the number of dice to roll from the field
var parameters = { dice: fields.dice.value };
// Send the GET request to the endpoint
var response = services.rest.get(uri, headers, parameters);
// Display the results
if (response.isSuccess()) {
fields.myResponse.value = response.getBody();
} else {
fields.myResponse.value = "Error calling endpoint";
}