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

Guest

Error making a REST API call from Thingworx

Hi everyone,I am getting following error

Error executing service

Unable to Invoke Service testHttpService on testhttp : Illegal character in query at index 79: http://01hw407758:8088/NoSqlMngWS/rest/1.0/Put/insertThingworxData?textData=abc

I have defined the URL in extension java code like

String url = "http://01hw407758:8088/NoSqlMngWS/rest/1.0/Put/insertThingworxData?textData="+ URLEncoder.encode(Name, "UTF-8");

Can anyone help me with this ?


EDIT : I have made a custom extension which has a Thingtemplate with a service that makes a REST API call to another server .I have validated the URL and it works well on browser.I am facing problem in making call from thingworx platform.

Message was edited by: Sushant Pandey: improved title to correctly reflect the requirement

3 REPLIES 3

Re: Error making a REST API call in thingworx

Hi Kirti,

REST Call seems to be malformed, this is discussed quite in detail you should refer to to the Blog REST API Overview and Examples

In addition to that it would be helpful using tool like Postman for validating your REST calls

Hope this helps.

Re: Error making a REST API call in thingworx

Hi Sushant,Thanks for your quick reply.But I am looking for some other help,I have edited my question.Hoping a response from you on that part.

Re: Error making a REST API call in thingworx

Thanks Kirti for clarifying on that. I will edit your question's heading too since it's kind of not matching with your actual requirement. Apart from this if the question is more on sending REST calls out from ThingWorx for that you can use the Content Loader functions, not sure if you have already checked this blog ContentLoaderFunctions in ThingWorx

Please feel free to correct me if i'm still somehow missing your requirement.

Hope this helps.