Then you can put this "guest" to Properties step and then add it to endpoint like this:-
def testStep = testRunner.testCase.getTestStepByName("REST_REQUEST_NAME");
def propGues = testRunner.testCase.testSteps["Properties"].getPropertyValue("guest")
String EndPointUrl = testStep.getHttpRequest().getEndpoint()+ propGues
log.info EndPointUrl
String path = testStep.getHttpRequest().getPath()
String url = EndPointUrl+path
String requestMethod = testStep.getHttpRequest().getMethod();
And it will print this :-
https://api.test.com/abc/def/guest/52
You like the reply. Know how to give kudos.