<?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: Imagine preview not displaying (webex rest api) in Webex for Developers</title>
    <link>https://community.cisco.com/t5/webex-for-developers/imagine-preview-not-displaying-webex-rest-api/m-p/4691599#M1505</link>
    <description>&lt;P&gt;Local file upload&lt;/P&gt;</description>
    <pubDate>Wed, 21 Sep 2022 19:00:57 GMT</pubDate>
    <dc:creator>Josh Flori</dc:creator>
    <dc:date>2022-09-21T19:00:57Z</dc:date>
    <item>
      <title>Imagine preview not displaying (webex rest api)</title>
      <link>https://community.cisco.com/t5/webex-for-developers/imagine-preview-not-displaying-webex-rest-api/m-p/4691473#M1503</link>
      <description>&lt;P&gt;I follow the simple attachment post request &lt;A href="https://developer.webex.com/docs/basics" target="_self"&gt;here&amp;nbsp;&lt;/A&gt;and post a jpg or pdf into a webex chat.&lt;/P&gt;&lt;P&gt;The preview does not display. But previews DO display when inserting manually.&lt;/P&gt;&lt;P&gt;Results are consistent across time.&lt;/P&gt;&lt;P&gt;Thoughts?&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2022 15:13:46 GMT</pubDate>
      <guid>https://community.cisco.com/t5/webex-for-developers/imagine-preview-not-displaying-webex-rest-api/m-p/4691473#M1503</guid>
      <dc:creator>Josh Flori</dc:creator>
      <dc:date>2022-09-21T15:13:46Z</dc:date>
    </item>
    <item>
      <title>Re: Imagine preview not displaying (webex rest api)</title>
      <link>https://community.cisco.com/t5/webex-for-developers/imagine-preview-not-displaying-webex-rest-api/m-p/4691594#M1504</link>
      <description>&lt;P&gt;Are you sending the attachment using a URL or sending as a local file upload?&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2022 18:52:39 GMT</pubDate>
      <guid>https://community.cisco.com/t5/webex-for-developers/imagine-preview-not-displaying-webex-rest-api/m-p/4691594#M1504</guid>
      <dc:creator>Jeff Marshall</dc:creator>
      <dc:date>2022-09-21T18:52:39Z</dc:date>
    </item>
    <item>
      <title>Re: Imagine preview not displaying (webex rest api)</title>
      <link>https://community.cisco.com/t5/webex-for-developers/imagine-preview-not-displaying-webex-rest-api/m-p/4691599#M1505</link>
      <description>&lt;P&gt;Local file upload&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2022 19:00:57 GMT</pubDate>
      <guid>https://community.cisco.com/t5/webex-for-developers/imagine-preview-not-displaying-webex-rest-api/m-p/4691599#M1505</guid>
      <dc:creator>Josh Flori</dc:creator>
      <dc:date>2022-09-21T19:00:57Z</dc:date>
    </item>
    <item>
      <title>Re: Imagine preview not displaying (webex rest api)</title>
      <link>https://community.cisco.com/t5/webex-for-developers/imagine-preview-not-displaying-webex-rest-api/m-p/4691600#M1506</link>
      <description>Local file upload&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 21 Sep 2022 19:00:57 GMT</pubDate>
      <guid>https://community.cisco.com/t5/webex-for-developers/imagine-preview-not-displaying-webex-rest-api/m-p/4691600#M1506</guid>
      <dc:creator>Josh Flori</dc:creator>
      <dc:date>2022-09-21T19:00:57Z</dc:date>
    </item>
    <item>
      <title>Re: Imagine preview not displaying (webex rest api)</title>
      <link>https://community.cisco.com/t5/webex-for-developers/imagine-preview-not-displaying-webex-rest-api/m-p/4691619#M1508</link>
      <description>&lt;P&gt;That should work and this is a curl example where the .jpg file did render the preview correctly. &lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;curl --location --request POST 'https://webexapis.com/v1/messages' \
--header 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
--form 'files=@"/Users/jeffmar/Downloads/Sample_Icon.jpg"' \
--form 'markdown="File sent using curl"' \
--form 'toPersonEmail="user@example.com"'&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Sep 2022 19:47:34 GMT</pubDate>
      <guid>https://community.cisco.com/t5/webex-for-developers/imagine-preview-not-displaying-webex-rest-api/m-p/4691619#M1508</guid>
      <dc:creator>Jeff Marshall</dc:creator>
      <dc:date>2022-09-21T19:47:34Z</dc:date>
    </item>
    <item>
      <title>Re: Imagine preview not displaying (webex rest api)</title>
      <link>https://community.cisco.com/t5/webex-for-developers/imagine-preview-not-displaying-webex-rest-api/m-p/4699103#M1583</link>
      <description>&lt;P&gt;I'm having a similar issue working in Powershell, the image does send but no preview. Any suggestions?&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;$uri = "https://api.ciscospark.com/v1/messages"
$filePath = "C:\Users\Harry\Documents\WebexTestImage.png"

$file = Get-Item -Path $filePath

$form = @{
    toPersonEmail = "MYEMAIL"
    markdown = "TestImage"
    files = $file
}

$params = @{
    Method = "Post"
    Uri = $uri
    Form = $form
    Headers = @{"Authorization"="Bearer $Ciscobottoken"}
}

Invoke-WebRequest @params​&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 09:31:02 GMT</pubDate>
      <guid>https://community.cisco.com/t5/webex-for-developers/imagine-preview-not-displaying-webex-rest-api/m-p/4699103#M1583</guid>
      <dc:creator>Harry Pickthall</dc:creator>
      <dc:date>2022-10-06T09:31:02Z</dc:date>
    </item>
    <item>
      <title>Re: Imagine preview not displaying (webex rest api)</title>
      <link>https://community.cisco.com/t5/webex-for-developers/imagine-preview-not-displaying-webex-rest-api/m-p/4699563#M1584</link>
      <description>&lt;P&gt;Running this request and looking at the raw HTTP, it looks like the Content-Type of the file part is set to "application/octet-stream" (i.e. a default/non-descript binary file type), whereas I suspect Webex is expecting this to be "image/png" if you want PNG image preview treatments.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dstaudt_0-1665085297237.png" style="width: 400px;"&gt;&lt;img src="https://community.cisco.com/t5/image/serverpage/image-id/164213i1DA13FA35B2AD6B0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dstaudt_0-1665085297237.png" alt="dstaudt_0-1665085297237.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;The Curl and Python samples in the Webex docs re &lt;A href="https://developer.webex.com/docs/basics#message-attachments" target="_self"&gt;Message Attachments&lt;/A&gt; seem to indicate indicating the mime-type specifically like this is expected.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="dstaudt_1-1665085554944.png" style="width: 400px;"&gt;&lt;img src="https://community.cisco.com/t5/image/serverpage/image-id/164214iC44E83C782985F74/image-size/medium?v=v2&amp;amp;px=400" role="button" title="dstaudt_1-1665085554944.png" alt="dstaudt_1-1665085554944.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;A bit of research didn't turn up a way to set a custom Content-Type for sub-parts using the PowerShell IWK -Form mechanism you're using.&amp;nbsp; If that's not possible, may need to construct the message using more "manual"/specific mechanisms, e.g.: &lt;A href="https://get-powershellblog.blogspot.com/2017/09/multipartform-data-support-for-invoke.html" target="_blank" rel="noopener"&gt;https://get-powershellblog.blogspot.com/2017/09/multipartform-data-support-for-invoke.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 19:47:16 GMT</pubDate>
      <guid>https://community.cisco.com/t5/webex-for-developers/imagine-preview-not-displaying-webex-rest-api/m-p/4699563#M1584</guid>
      <dc:creator>dstaudt</dc:creator>
      <dc:date>2022-10-06T19:47:16Z</dc:date>
    </item>
  </channel>
</rss>

