I'm trying to execute an SOQL query via REST API call because I want to retrieve custom labels (ExternalString) previous to a date and by Category.
I generate my query like this
Datetime limitDate = Datetime.now();
String query = 'SELECT Name FROM ExternalString WHERE Category = \'Test\' AND LastModifiedDate >= ' + limitDate;
And I'm trying this request
endpoint = '/services/data/v' + apiversion + '/query/q=' + EncodingUtil.urlEncode(query.replace(' ','+'), 'UTF-8');
HttpResponse result;
Http http = new Http();
HttpRequest req = new HttpRequest();
req.setMethod('GET');
req.setEndpoint(endpoint);
result = http.send(req);
But it's always giving me the following error:
no protocol: /services/data/v48.0/query/q=SELECT%2BName%2BFROM%2BExternalString%2BWHERE%2BCategory%2B%3D%2B%27App%2BM%C3%B3vil%27%2BAND%2BLastModifiedDate%2B%3E%3D%2B2021-03-09%2B23%3A00%3A00
Is there something I'm doing wrong or missing when trying to achieve this functionality?
Thanks in advance!