<?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: Extended Latin and 400 Bad Request  in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Extended-Latin-and-400-Bad-Request/m-p/188821#M8043</link>
    <description>&lt;P&gt;I'm not too familiar with PowerShell, but it looks like you may be able to get the response body using the&amp;nbsp;-OutFile option on&amp;nbsp;&lt;A href="https://technet.microsoft.com/en-us/library/hh849971.aspx" target="_blank" rel="nofollow noreferrer"&gt;Invoke-RestMethod&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Also, for reference, based on your code, you're using API v1, which is now deprecated. We&amp;nbsp;recommend migrating to API v2 when you can. For example, the equivalent of&amp;nbsp;/1/team/members/add is&amp;nbsp;&lt;A href="https://www.dropbox.com/developers/documentation/http/teams#team-members-add" target="_blank" rel="nofollow noreferrer"&gt;/2/team/members/add&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Anyway,&amp;nbsp;"application/json" is the right Content-Type for these requests.&lt;/P&gt;</description>
    <pubDate>Tue, 04 Oct 2016 03:25:00 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2016-10-04T03:25:00Z</dc:date>
    <item>
      <title>Extended Latin and 400 Bad Request</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Extended-Latin-and-400-Bad-Request/m-p/188816#M8038</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I try to create a new member with name that contains chars of extended Latin alphabet (Ñ,&amp;nbsp;Í,&amp;nbsp;Õ etc.). I use powershell&amp;nbsp;Invoke-RestMethod command and generate a body on the fly.&lt;/P&gt;
&lt;P&gt;I receive "The remote server returned an error: (400) Bad Request" response.&lt;/P&gt;
&lt;P&gt;Do I have to somehow prepare my request before API calling or something else?&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:30:13 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Extended-Latin-and-400-Bad-Request/m-p/188816#M8038</guid>
      <dc:creator>Vasili V.</dc:creator>
      <dc:date>2019-05-29T09:30:13Z</dc:date>
    </item>
    <item>
      <title>Re: Extended Latin and 400 Bad Request</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Extended-Latin-and-400-Bad-Request/m-p/188817#M8039</link>
      <description>&lt;P&gt;Vasili, what's the content of the response body? It should contain a specific error message indicating the issue.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Sep 2016 21:34:24 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Extended-Latin-and-400-Bad-Request/m-p/188817#M8039</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2016-09-09T21:34:24Z</dc:date>
    </item>
    <item>
      <title>Re: Extended Latin and 400 Bad Request</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Extended-Latin-and-400-Bad-Request/m-p/188818#M8040</link>
      <description>&lt;P&gt;Sorry for delay.&lt;/P&gt;
&lt;P&gt;It is a part of the request's body:&lt;/P&gt;
&lt;P&gt;{... "member_surname": "Cañas", "send_welcome_email": true ... }&lt;/P&gt;
&lt;P&gt;The respponse is:&lt;BR /&gt;The remote server returned an error: (400) Bad Request&lt;/P&gt;
&lt;P&gt;The same error for:&amp;nbsp;León,&amp;nbsp;Sofía etc. In other words any character from extended Latin alphabet causes this issue.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2016 19:02:03 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Extended-Latin-and-400-Bad-Request/m-p/188818#M8040</guid>
      <dc:creator>Vasili V.</dc:creator>
      <dc:date>2016-09-30T19:02:03Z</dc:date>
    </item>
    <item>
      <title>Re: Extended Latin and 400 Bad Request</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Extended-Latin-and-400-Bad-Request/m-p/188819#M8041</link>
      <description>&lt;P&gt;Thanks for following up&amp;nbsp;Vasili. What you shared is just the status line of the response though. Can you retrieve and share the body of the response as well?&lt;/P&gt;
&lt;P&gt;Based on your description of the problem, it's likely related to&amp;nbsp;the encoding you're using for these characters. Please also share the code you're using to make the code so we can offer some help.&lt;/P&gt;
&lt;P&gt;Thanks in advance!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 01 Oct 2016 01:15:41 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Extended-Latin-and-400-Bad-Request/m-p/188819#M8041</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2016-10-01T01:15:41Z</dc:date>
    </item>
    <item>
      <title>Re: Extended Latin and 400 Bad Request</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Extended-Latin-and-400-Bad-Request/m-p/188820#M8042</link>
      <description>&lt;P&gt;Gregory,&lt;/P&gt;
&lt;P&gt;The code:&lt;/P&gt;
&lt;P&gt;$body = '{"member_email":"' + $member_email + '", "member_given_name": "' + $member_given_name +&lt;BR /&gt; '", "member_surname": "' + $member_surname + '", "member_external_id" : "' + $member_external_id +&lt;BR /&gt; '", "send_welcome_email": true }'&lt;/P&gt;
&lt;P&gt;$newUser = Invoke-RestMethod -Uri &lt;A href="https://api.dropbox.com/1/team/members/add" rel="nofollow noreferrer"&gt;https://api.dropbox.com/1/team/members/add&lt;/A&gt; -Body $body -ContentType application/json `&lt;BR /&gt; -Headers @{ Authorization = $token } -Method Post&lt;/P&gt;
&lt;P&gt;It's powershell script. So I guess charset is set up by default.&lt;/P&gt;
&lt;P&gt;What I am going to change is to create $body as JSON object, then use ConvertTo/From-Json and then add charset=utf-8 to -ContentType.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;p.s. I was not able to catch secured traffic using Fiddler, so I don't have body as an example.&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2016 15:44:45 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Extended-Latin-and-400-Bad-Request/m-p/188820#M8042</guid>
      <dc:creator>Vasili V.</dc:creator>
      <dc:date>2016-10-03T15:44:45Z</dc:date>
    </item>
    <item>
      <title>Re: Extended Latin and 400 Bad Request</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Extended-Latin-and-400-Bad-Request/m-p/188821#M8043</link>
      <description>&lt;P&gt;I'm not too familiar with PowerShell, but it looks like you may be able to get the response body using the&amp;nbsp;-OutFile option on&amp;nbsp;&lt;A href="https://technet.microsoft.com/en-us/library/hh849971.aspx" target="_blank" rel="nofollow noreferrer"&gt;Invoke-RestMethod&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Also, for reference, based on your code, you're using API v1, which is now deprecated. We&amp;nbsp;recommend migrating to API v2 when you can. For example, the equivalent of&amp;nbsp;/1/team/members/add is&amp;nbsp;&lt;A href="https://www.dropbox.com/developers/documentation/http/teams#team-members-add" target="_blank" rel="nofollow noreferrer"&gt;/2/team/members/add&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;Anyway,&amp;nbsp;"application/json" is the right Content-Type for these requests.&lt;/P&gt;</description>
      <pubDate>Tue, 04 Oct 2016 03:25:00 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Extended-Latin-and-400-Bad-Request/m-p/188821#M8043</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2016-10-04T03:25:00Z</dc:date>
    </item>
    <item>
      <title>Re: Extended Latin and 400 Bad Request</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Extended-Latin-and-400-Bad-Request/m-p/263891#M15433</link>
      <description>&lt;P&gt;So, we have&amp;nbsp;migrated to api v2.0 and still have the same problem.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;$&lt;/SPAN&gt;&lt;SPAN&gt;new_members&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;@(&lt;/SPAN&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;@{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;member_email &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;$&lt;/SPAN&gt;&lt;SPAN&gt;mail&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;member_given_name &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;$&lt;/SPAN&gt;&lt;SPAN&gt;groupMember&lt;/SPAN&gt;&lt;SPAN&gt;.givenName&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;member_surname &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;$&lt;/SPAN&gt;&lt;SPAN&gt;groupMember&lt;/SPAN&gt;&lt;SPAN&gt;.surname&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;member_external_id &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;$&lt;/SPAN&gt;&lt;SPAN&gt;keyFromAD&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;send_welcome_email &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;$true&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;}&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;$&lt;/SPAN&gt;&lt;SPAN&gt;body&lt;/SPAN&gt; &lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt; @{&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;new_members &lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt; &lt;SPAN&gt;$&lt;/SPAN&gt;&lt;SPAN&gt;new_members&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;} &lt;/SPAN&gt;&lt;SPAN&gt;|&lt;/SPAN&gt; &lt;SPAN&gt;ConvertTo-Json&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;...&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;The endpoint is&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;A href="https://api.dropboxapi.com/2/team/members/add" target="_blank"&gt;https://api.dropboxapi.com/2/team/members/add&lt;/A&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;As a result&amp;nbsp;$body refers to json-like string presentation of members to be created. If the one contains any char from extended alphabet it causes the 400 Bad Request response.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Feb 2018 13:58:43 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Extended-Latin-and-400-Bad-Request/m-p/263891#M15433</guid>
      <dc:creator>Vasili V.</dc:creator>
      <dc:date>2018-02-07T13:58:43Z</dc:date>
    </item>
    <item>
      <title>Re: Extended Latin and 400 Bad Request</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Extended-Latin-and-400-Bad-Request/m-p/263925#M15439</link>
      <description>For API v2, the first step for debugging failures like this is also to check the content of the response body. It should contain a more useful error message. Can you share the response body? Also, since this is likely related to how the request body is formatted, please share a sample of that as well. Thanks in advance!</description>
      <pubDate>Wed, 07 Feb 2018 16:22:34 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Extended-Latin-and-400-Bad-Request/m-p/263925#M15439</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-02-07T16:22:34Z</dc:date>
    </item>
    <item>
      <title>Re: Extended Latin and 400 Bad Request</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Extended-Latin-and-400-Bad-Request/m-p/267783#M15751</link>
      <description>&lt;P&gt;I captured a request and a response. I hide some sensitive info.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;POST &lt;A href="https://api.dropboxapi.com/2/team/members/add" target="_blank"&gt;https://api.dropboxapi.com/2/team/members/add&lt;/A&gt; HTTP/1.1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;{&lt;BR /&gt; "new_members": [&lt;BR /&gt; {&lt;BR /&gt; "member_email": "Baptiste.Bjaud@***",&lt;BR /&gt; "member_external_id": "ADSYNC ****",&lt;BR /&gt; "send_welcome_email": true,&lt;BR /&gt; "member_given_name": "Baptiste",&lt;BR /&gt; "member_surname": "B jaud"&lt;BR /&gt; }&lt;BR /&gt; ]&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;HTTP/1.1 400 Bad Request&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;Error in call to API function "team/members/add": request body: could not decode input as JSON&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The name is&amp;nbsp;Béjaud.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Mar 2018 15:03:02 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Extended-Latin-and-400-Bad-Request/m-p/267783#M15751</guid>
      <dc:creator>Vasili V.</dc:creator>
      <dc:date>2018-03-07T15:03:02Z</dc:date>
    </item>
    <item>
      <title>Re: Extended Latin and 400 Bad Request</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Extended-Latin-and-400-Bad-Request/m-p/267816#M15760</link>
      <description>&lt;P&gt;Thanks! That's the error from the API, and it does indicate that the issue is that the contents of the request body couldn't be successfully decoded as JSON.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It sounds like the issue is with encoding these characters. That's generally done automatically, but that doesn't seem to be the case with PowerShell/Invoke-RestMethod.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm not a PowerShell expert, and it also looks like copying it onto the forum didn't work right here, but I believe you need to additionally encode the body like this:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;$enc = [System.Text.Encoding]::UTF8
$body = $enc.GetBytes($body)&lt;/PRE&gt;</description>
      <pubDate>Wed, 07 Mar 2018 18:03:44 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Extended-Latin-and-400-Bad-Request/m-p/267816#M15760</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-03-07T18:03:44Z</dc:date>
    </item>
    <item>
      <title>Re: Extended Latin and 400 Bad Request</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Extended-Latin-and-400-Bad-Request/m-p/268279#M15795</link>
      <description>&lt;P&gt;It helped.&lt;/P&gt;
&lt;P&gt;Thank you!&lt;/P&gt;</description>
      <pubDate>Mon, 12 Mar 2018 11:52:38 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Extended-Latin-and-400-Bad-Request/m-p/268279#M15795</guid>
      <dc:creator>Vasili V.</dc:creator>
      <dc:date>2018-03-12T11:52:38Z</dc:date>
    </item>
  </channel>
</rss>

