If you are using KS < 6.1.0 this can be a problem (more info: Can't use variables in Web Service Request URL).
My approach in 5.10.1:
- Set Global variables in profile: “G_URLProtocol”, “G_URLHost” and “G_URLPort”
- In Object Repository → API request → Variables set local variables from global.
- Build URL in “Endpoint” variable (screen). If you do not need protocol from variable or you are using KS => 6.1.0 you do not have to create this, just use local variables in rest URL.