cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Error making a REST API call from Thingworx - Illegal Character

Visitor

Error making a REST API call from Thingworx - Illegal Character

Hi All,

 

I am creating a service within a "Thing" and the service tries to get data from a REST API endpoint. I am using "ContentLoaderFunctions" (GetJSON) to send the GET request to the endpoint. It works well, when the URL doesn't have any special characters.

But it throws an error "llegal character in query at index 57: https://myserver/webapi/resource?path=myparameter"

 

As anyone faced this issue? Is there any function available to encode the URL ?

 

Regards,

Jaison Rodrigues

Tags (2)
5 REPLIES 5

Re: Error making a REST API call from Thingworx - Illegal Character

did you check the URLEncoder?

 

Thanks,

Sami

Re: Error making a REST API call from Thingworx - Illegal Character

Yes. I tried to use it but it gives me error. Not sure if I am using it correctly since I am using JAVA syntax.

 

 

Re: Error making a REST API call from Thingworx - Illegal Character

The platform does not accept "\" and considers it as an "Illegal Character". "?, &, -, =" works fine. I replaced "\" with "%5C" and it worked.

Re: Error making a REST API call from Thingworx - Illegal Character

Hi @jaison.

 

If you are comfortable with the solution you found, please mark it as the Accepted Solution for the benefit of others with the same question.

 

Regards.

 

--Sharon

Re: Error making a REST API call from Thingworx - Illegal Character

It’s more a workaround than a solution. Still looking for a solution if some in the community has used URLEncoder successfully to make a REST API call or any other method that encodes the URL is standard format.
Announcements

Thingworx Navigate content has a new home! Click here to access the new Thingworx Navigate forum! ______________________________