<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Uploading an image through REST api to an image property in ThingWorx Developers</title>
    <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Uploading-an-image-through-REST-api-to-an-image-property/m-p/506618#M4576</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you using Chrome?&lt;/P&gt;&lt;P&gt;Try this.. Open your dev tools, upload your image to the property manually through the composer, then copy the source from the request payload and try to paste it exactly as it is in your REST call.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 30 Nov 2017 15:38:45 GMT</pubDate>
    <dc:creator>posipova</dc:creator>
    <dc:date>2017-11-30T15:38:45Z</dc:date>
    <item>
      <title>Uploading an image through REST api to an image property</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Uploading-an-image-through-REST-api-to-an-image-property/m-p/506613#M4571</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;If I set up a property as an Image, how do I upload an image to that property using the REST api.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have tried binary using Postman, I have tried base64, and several other. Usually I get 403 Request Forbidden response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Application key is set. The problem is how to actually do the PUT request.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;/Magnus&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Nov 2017 15:56:31 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Uploading-an-image-through-REST-api-to-an-image-property/m-p/506613#M4571</guid>
      <dc:creator>måkerman</dc:creator>
      <dc:date>2017-11-29T15:56:31Z</dc:date>
    </item>
    <item>
      <title>Re: Uploading an image through REST api to an image property</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Uploading-an-image-through-REST-api-to-an-image-property/m-p/506614#M4572</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You would need the following headers: content-type, Accept, appkey.&lt;/P&gt;&lt;P&gt;You would send the image as application/json&lt;/P&gt;&lt;P&gt;For example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-1 jive-image" src="https://www.ptcusercommunity.com/legacyfs/online/thingworx/8147_pastedImage_0.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The image will be in json:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-2 jive-image" src="https://www.ptcusercommunity.com/legacyfs/online/thingworx/8148_pastedImage_1.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Hint: you may use your browser dev tools (Chrome - f12) to see the REST call structure when assigning an image property through the composer:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="image-3 jive-image" src="https://www.ptcusercommunity.com/legacyfs/online/thingworx/8149_pastedImage_2.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Scrolling down to the&amp;nbsp; request-payload, you can view the source:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG class="jive-image image-4" src="https://www.ptcusercommunity.com/legacyfs/online/thingworx/8150_pastedImage_3.png" style="max-width: 1200px; max-height: 900px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Nov 2017 19:57:33 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Uploading-an-image-through-REST-api-to-an-image-property/m-p/506614#M4572</guid>
      <dc:creator>posipova</dc:creator>
      <dc:date>2017-11-29T19:57:33Z</dc:date>
    </item>
    <item>
      <title>Re: Uploading an image through REST api to an image property</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Uploading-an-image-through-REST-api-to-an-image-property/m-p/506615#M4573</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Polina, and thank you!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I tried the exact way you explained and I got mixed result. The image do change in the property but I also get &lt;SPAN style="font-size: 13.3333px;"&gt;(500)&lt;/SPAN&gt; Internal message response.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And the logging of the pimage property does not work even if the image is changed.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you know what it can mean?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Screen Shot 2017-11-30 at 14.59.54.png" class="image-1 jive-image" src="/legacyfs/online/thingworx/8157_Screen Shot 2017-11-30 at 14.59.54.png" style="height: 231px; width: 620px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Nov 2017 15:12:06 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Uploading-an-image-through-REST-api-to-an-image-property/m-p/506615#M4573</guid>
      <dc:creator>måkerman</dc:creator>
      <dc:date>2017-11-30T15:12:06Z</dc:date>
    </item>
    <item>
      <title>Re: Uploading an image through REST api to an image property</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Uploading-an-image-through-REST-api-to-an-image-property/m-p/506616#M4574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you placing it as a PUT request? Is the appkey you are using connected to the Administrator user /has sufficient permissions? Are you passing it as json? I saw this error with a&lt;SPAN style="font-size: 10pt;"&gt; REST service request&amp;nbsp; rejected (HTTP 500 Internal Server Error) by the TW platform when a text value embedded in the JSON payload contains Line Feeds (ASCII 10),,, What is your ThingWorx platform version?&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV style="padding: 0 8px 4px 0;"&gt;&lt;P&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Nov 2017 15:25:40 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Uploading-an-image-through-REST-api-to-an-image-property/m-p/506616#M4574</guid>
      <dc:creator>posipova</dc:creator>
      <dc:date>2017-11-30T15:25:40Z</dc:date>
    </item>
    <item>
      <title>Re: Uploading an image through REST api to an image property</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Uploading-an-image-through-REST-api-to-an-image-property/m-p/506617#M4575</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;User has sufficient permissions? &lt;/P&gt;&lt;P&gt;I have created a new user with read/write permission to the Thing. I connected a key to that user and that key is used for upload.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Are you passing it as json?&lt;/P&gt;&lt;P&gt;Yes.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What is your ThingWorx platform version?&lt;/P&gt;&lt;P&gt;A very reacent installation of the ThingWorx Trial Bundle.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;About line feeds: I also try the exact same thing with a Python program using requests package, like requests.put(url, json). Then I get the exact same result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;What about the image types, could that matter?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Nov 2017 15:34:10 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Uploading-an-image-through-REST-api-to-an-image-property/m-p/506617#M4575</guid>
      <dc:creator>måkerman</dc:creator>
      <dc:date>2017-11-30T15:34:10Z</dc:date>
    </item>
    <item>
      <title>Re: Uploading an image through REST api to an image property</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Uploading-an-image-through-REST-api-to-an-image-property/m-p/506618#M4576</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you using Chrome?&lt;/P&gt;&lt;P&gt;Try this.. Open your dev tools, upload your image to the property manually through the composer, then copy the source from the request payload and try to paste it exactly as it is in your REST call.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 30 Nov 2017 15:38:45 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Uploading-an-image-through-REST-api-to-an-image-property/m-p/506618#M4576</guid>
      <dc:creator>posipova</dc:creator>
      <dc:date>2017-11-30T15:38:45Z</dc:date>
    </item>
    <item>
      <title>Re: Uploading an image through REST api to an image property</title>
      <link>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Uploading-an-image-through-REST-api-to-an-image-property/m-p/506619#M4577</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN style="font-size: 10pt;"&gt;The problem was due to access rights. I used a different user to upload and that user did not have access to ThingworxPersistenceProvider.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I found the solution by reading this thread:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.thingworx.com/message/64892"&gt;REST API property value update do not fire value change event&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 02 Dec 2017 16:41:34 GMT</pubDate>
      <guid>https://www.ptcusercommunity.com/t5/ThingWorx-Developers/Uploading-an-image-through-REST-api-to-an-image-property/m-p/506619#M4577</guid>
      <dc:creator>måkerman</dc:creator>
      <dc:date>2017-12-02T16:41:34Z</dc:date>
    </item>
  </channel>
</rss>

