salesforce soql

outgoing sync
//"SELECT+Id+FROM+Account+WHERE+Name='${encodedAccountName}'"

//def res = httpClient.get("/services/data/v54.0/query?q=SELECT+Owner.Email+FROM+Case+WHERE+Id=%27${the_id_variable}%27")
//def res = httpClient.get("/services/data/v54.0/query?q=SELECT+Id+FROM+Account+WHERE+Name=%27${the_id_variable}%27")
///query?q=SELECT+CommentBody%2C+CreatedById%2C+CreatedBy.Email+FROM+CaseComment+WHERE+ParentId+%3D+'5007Q00000NP7CvQAL'+ORDER+BY+CreatedDate+DESC+LIMIT+1


def the_id_variable = entity.OwnerId
 
def res = httpClient.get("/services/data/v54.0/query/?q=SELECT+Email+from+User+where+id=%27${the_id_variable}%27")
replica.res = res

/services/data/vXX.X/query?q=SELECT+On_Behalf_Of_Opporunity_owner_C+FROM+Opportunity+WHERE+Id=%27${the_id_variable}%27"


result:



"res": {
      "totalSize": 1,
      "done": true,
      "records": [
        {
          "attributes": {
            "type": "User",
            "url": "/services/data/v54.0/sobjects/User/0057Q000003F2VfQAK"
          },
          "Email": "mathieulepoutre@outlook.com"
        }
        

how to:
workbench soql -> rest api salesforce
mathieu.lepoutre
mathieu.lepoutreAuthor·

def the_id_variable = entity.Id

def res = httpClient.get("/services/data/v54.0/query?q=SELECT+CommentBody%2C+CreatedById%2C+CreatedBy.Email+FROM+CaseComment+WHERE+ParentId=%27${the_id_variable}%27+ORDER+BY+CreatedDate+DESC+LIMIT+1")
replica.res = res