I would think either your query string or token has an illegal character in it. How are you building it?
Assuming you have the query string in a variable called $queryString, and the token in a variable called $token, you could look to build the URL using urlEncode to encode those value like this.
'https://saas.afrigis.co.za/intiendols/autocomplete/?query=' + urlEncode($queryString) + '&token=' + urlEncode($token)