<?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: The remote server returned an error: (415) Unsupported Media Type in Webex for Developers</title>
    <link>https://community.cisco.com/t5/webex-for-developers/the-remote-server-returned-an-error-415-unsupported-media-type/m-p/4704868#M1620</link>
    <description>&lt;P&gt;Tested in Powershell using the following and it did work correctly. &lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Content-Type", "application/json")
$headers.Add("Accept", "application/json")
$headers.Add("Authorization", "Bearer OTdjYjA5N2EtYWN........")

$response = Invoke-RestMethod 'https://webexapis.com/v1/telephony/calls/history?type=missed' -Method 'GET' -Headers $headers
$response | ConvertTo-Json&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 18 Oct 2022 12:50:45 GMT</pubDate>
    <dc:creator>Jeff Marshall</dc:creator>
    <dc:date>2022-10-18T12:50:45Z</dc:date>
    <item>
      <title>The remote server returned an error: (415) Unsupported Media Type</title>
      <link>https://community.cisco.com/t5/webex-for-developers/the-remote-server-returned-an-error-415-unsupported-media-type/m-p/4701863#M1602</link>
      <description>&lt;P&gt;I am trying to get webex calling "call history" report using API but keep getting "The remote server returned an error: (415) Unsupported Media Type error". The sample powershell code is as follows:-&lt;/P&gt;&lt;P&gt;$token: "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"&lt;/P&gt;&lt;P&gt;$headers = @{&lt;BR /&gt;"Authorization" = "Bearer $token"&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;$webexUrl = "&lt;A href="https://webexapis.com/v1/telephony/calls/history?type=missed" target="_blank" rel="noopener"&gt;https://webexapis.com/v1/telephony/calls/history?type=missed&lt;/A&gt;"&lt;/P&gt;&lt;P&gt;Invoke-restmethod -Method get -Uri $webexUrl -Headers $headers&lt;/P&gt;&lt;P&gt;Error:&lt;/P&gt;&lt;P&gt;Invoke-restmethod : The remote server returned an error: (415) Unsupported Media Type.&lt;BR /&gt;At line:1 char:1&lt;BR /&gt;+ Invoke-restmethod -Method get -Uri $webexCHUrl -Headers $headers&lt;BR /&gt;+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~&lt;BR /&gt;+ CategoryInfo : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invok&lt;BR /&gt;e-RestMethod], WebException&lt;BR /&gt;+ FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeR&lt;BR /&gt;estMethodCommand&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2022 11:33:17 GMT</pubDate>
      <guid>https://community.cisco.com/t5/webex-for-developers/the-remote-server-returned-an-error-415-unsupported-media-type/m-p/4701863#M1602</guid>
      <dc:creator>vbj1995</dc:creator>
      <dc:date>2022-10-12T11:33:17Z</dc:date>
    </item>
    <item>
      <title>Re: The remote server returned an error: (415) Unsupported Media Type</title>
      <link>https://community.cisco.com/t5/webex-for-developers/the-remote-server-returned-an-error-415-unsupported-media-type/m-p/4702186#M1605</link>
      <description>&lt;P&gt;The code doesn't appear to be specifying the return content format - can you add a header for "Accept" = "application/json" ?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Oct 2022 17:56:00 GMT</pubDate>
      <guid>https://community.cisco.com/t5/webex-for-developers/the-remote-server-returned-an-error-415-unsupported-media-type/m-p/4702186#M1605</guid>
      <dc:creator>dstaudt</dc:creator>
      <dc:date>2022-10-12T17:56:00Z</dc:date>
    </item>
    <item>
      <title>Re: The remote server returned an error: (415) Unsupported Media Type</title>
      <link>https://community.cisco.com/t5/webex-for-developers/the-remote-server-returned-an-error-415-unsupported-media-type/m-p/4702399#M1609</link>
      <description>I have tried using Accept parameter in the header still it is throwing 415&lt;BR /&gt;error. Can you please help us with the correct format to use Accept and&lt;BR /&gt;content-type in the code mentioned.&lt;BR /&gt;</description>
      <pubDate>Thu, 13 Oct 2022 05:15:38 GMT</pubDate>
      <guid>https://community.cisco.com/t5/webex-for-developers/the-remote-server-returned-an-error-415-unsupported-media-type/m-p/4702399#M1609</guid>
      <dc:creator>vbj1995</dc:creator>
      <dc:date>2022-10-13T05:15:38Z</dc:date>
    </item>
    <item>
      <title>Re: The remote server returned an error: (415) Unsupported Media Type</title>
      <link>https://community.cisco.com/t5/webex-for-developers/the-remote-server-returned-an-error-415-unsupported-media-type/m-p/4704520#M1619</link>
      <description>&lt;P&gt;&lt;a href="https://community.cisco.com/t5/user/viewprofilepage/user-id/1418827"&gt;@vbj1995&lt;/a&gt;&amp;nbsp;below is an example that you can build from; I should also mentioned that I used Postman code covert tool to generate the powershell code below;&lt;/P&gt;
&lt;P&gt;$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"&lt;BR /&gt;$headers.Add("Authorization", "Bearer YmM5xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx")&lt;/P&gt;
&lt;P&gt;$response = Invoke-RestMethod '&lt;A href="https://webexapis.com/v1/telephony/calls/history?type=missed" target="_blank"&gt;https://webexapis.com/v1/telephony/calls/history?type=missed&lt;/A&gt;' -Method 'GET' -Headers $headers&lt;BR /&gt;$response | ConvertTo-Json&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 17 Oct 2022 21:36:36 GMT</pubDate>
      <guid>https://community.cisco.com/t5/webex-for-developers/the-remote-server-returned-an-error-415-unsupported-media-type/m-p/4704520#M1619</guid>
      <dc:creator>Gasper A</dc:creator>
      <dc:date>2022-10-17T21:36:36Z</dc:date>
    </item>
    <item>
      <title>Re: The remote server returned an error: (415) Unsupported Media Type</title>
      <link>https://community.cisco.com/t5/webex-for-developers/the-remote-server-returned-an-error-415-unsupported-media-type/m-p/4704868#M1620</link>
      <description>&lt;P&gt;Tested in Powershell using the following and it did work correctly. &lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Content-Type", "application/json")
$headers.Add("Accept", "application/json")
$headers.Add("Authorization", "Bearer OTdjYjA5N2EtYWN........")

$response = Invoke-RestMethod 'https://webexapis.com/v1/telephony/calls/history?type=missed' -Method 'GET' -Headers $headers
$response | ConvertTo-Json&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 12:50:45 GMT</pubDate>
      <guid>https://community.cisco.com/t5/webex-for-developers/the-remote-server-returned-an-error-415-unsupported-media-type/m-p/4704868#M1620</guid>
      <dc:creator>Jeff Marshall</dc:creator>
      <dc:date>2022-10-18T12:50:45Z</dc:date>
    </item>
    <item>
      <title>Re: The remote server returned an error: (415) Unsupported Media Type</title>
      <link>https://community.cisco.com/t5/webex-for-developers/the-remote-server-returned-an-error-415-unsupported-media-type/m-p/4704922#M1621</link>
      <description>&lt;P&gt;Looks like the API is _requiring_ "Content-Type: application/json" - it returns 415 if it's missing - however I don't think it should do that, as this is a GET request which does not include a body.&lt;/P&gt;
&lt;P&gt;I'll see about opening a ticket on this, as IMHO it's an error.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 14:36:52 GMT</pubDate>
      <guid>https://community.cisco.com/t5/webex-for-developers/the-remote-server-returned-an-error-415-unsupported-media-type/m-p/4704922#M1621</guid>
      <dc:creator>dstaudt</dc:creator>
      <dc:date>2022-10-18T14:36:52Z</dc:date>
    </item>
    <item>
      <title>Re: The remote server returned an error: (415) Unsupported Media Type</title>
      <link>https://community.cisco.com/t5/webex-for-developers/the-remote-server-returned-an-error-415-unsupported-media-type/m-p/4704936#M1622</link>
      <description>&lt;P&gt;Ticket # is &lt;SPAN&gt;111458&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;I believe you can contact Webex developer support and request to be CC'd on the ticket to get any updates on the issue.&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 14:50:34 GMT</pubDate>
      <guid>https://community.cisco.com/t5/webex-for-developers/the-remote-server-returned-an-error-415-unsupported-media-type/m-p/4704936#M1622</guid>
      <dc:creator>dstaudt</dc:creator>
      <dc:date>2022-10-18T14:50:34Z</dc:date>
    </item>
  </channel>
</rss>

