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

Community Tip - If community subscription notifications are filling up your inbox you can set up a daily digest and get all your notifications in a single email. X

How to post an image from ThingWorx to an external web server using REST API?

vvaidya
1-Visitor

How to post an image from ThingWorx to an external web server using REST API?

Hi All,

I am trying to post/send an image which is stored as a property in TW to an external web server using Rest API. I have used POSTImage snippet to try this out. But  I am getting the below error

Wrapped java.lang.Exception: Unable To Convert From [B to JSON Cause: Unable To Convert From [B to JSON


I am not very sure if  PostImage snippet is actually meant to meet the above requirement.

Is there any other way?

Thanks and Regards,

Vishal Vaidya

2 REPLIES 2
miikkae
12-Amethyst
(To:vvaidya)

I'm pretty new to whole ThingWorx and havent' tried posting images but have you thought about base64 encoding the image as a string, submitting that, and converting back to image on ThingWorx side?

This was just an idea on top of my head. Not that ThingWorx specific solution.

vvaidya
1-Visitor
(To:miikkae)

Thanks Miikka,

Even i thought the same but not sure how to encode image as string in Thingworx. Though there are snippet available but i have not come across any proper example where image is encoded in string or vice versa using base64EncodeBytes or similar services.

Regards,

Vishal Vaidya

Announcements


Top Tags