Skip to main content
13-Aquamarine
October 17, 2015
Question

How to format json input/output to ThingWorx REST API calls?

  • October 17, 2015
  • 2 replies
  • 2380 views

I am starting work with the REST API.  For now, I am just sending URLs to the platform using a chrome extension - not creating a real application yet.

Many of the services and other REST API calls require json input.  Much of this isn't simple name/value pairs, but may be complex data shapes, data tables, file, or image input.

How do I create the properly-formatted .json file for the service to work, especially when dealing with encoded images?

Once I get the result of the service, how do I parse out the encoded images, like the one from the the getAvatar service into something useful?

2 replies

1-Visitor
December 7, 2015

Any help on this one?  I have a similar requirement.

Nick

1-Visitor
December 7, 2015

I posted too soon.  The answer is to add the accept type into the header of the request.

Accept: application/json

Nick