<?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: Error response is coming into different different format in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-response-is-coming-into-different-different-format/m-p/200460#M9405</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I am sending the request into JSON format then response should also come into JSON format, if ID validation fails or not. If it is not coming into JSON format then I don't think its good API design.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Shashi Bala</description>
    <pubDate>Wed, 04 Jan 2017 14:20:34 GMT</pubDate>
    <dc:creator>ShashiBala</dc:creator>
    <dc:date>2017-01-04T14:20:34Z</dc:date>
    <item>
      <title>Error response is coming into different different format</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-response-is-coming-into-different-different-format/m-p/199768#M9328</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried to get account through this API&lt;EM&gt;&amp;nbsp;&lt;A href="https://api.dropboxapi.com/2/users/get_account" target="_blank"&gt;https://api.dropboxapi.com/2/users/get_account&lt;/A&gt; &lt;/EM&gt;&amp;nbsp;using SOAPUI&amp;nbsp;and passing&amp;nbsp;account_id in request body.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;"account_id":"dbid:AACCsTU3d_-j5rfgJkGLObJErDLctQmUZw0"&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If account_id is incorrect but having 40 character then error is coming in to JSON formate&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;{&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;"error_summary": "no_account/.",&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;"error": {".tag": "no_account"}&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;}&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If&amp;nbsp;I am passing the account_id less then 40&amp;nbsp;character or more then 40&amp;nbsp;character then response is not coming into JSON. It is coming into text/plain.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;lt;data contentType="text/plain; charset=utf-8" contentLength="144"&amp;gt;&amp;lt;![CDATA[Error in call to API function "users/get_account": request body: account_id: 'dbid:bbCCsLObJErDLctQmUZw0' must be at least 40 characters, got 26]]&amp;gt;&amp;lt;/data&amp;gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Shashi Bala&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:27:17 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-response-is-coming-into-different-different-format/m-p/199768#M9328</guid>
      <dc:creator>Shashi</dc:creator>
      <dc:date>2019-05-29T09:27:17Z</dc:date>
    </item>
    <item>
      <title>Re: Error response is coming into different different format</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-response-is-coming-into-different-different-format/m-p/199806#M9336</link>
      <description>&lt;P&gt;The difference in response format, of JSON versus text, is expected in these different cases.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the ID has the right format, the API will look it up, and return an error if it isn't found.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the ID doesn't have the right format, e.g., it's the wrong length, it will fail validation, and the API won't bother trying to look it up.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can check the response status code to see the different kinds of failures, and check the response Content-Type header to see what format the response body is in.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, using curl, these two calls look like: (responses trimmed for brevity)&lt;/P&gt;
&lt;PRE&gt;curl -vX POST https://api.dropboxapi.com/2/users/get_account \
    --header "Authorization: Bearer &amp;lt;ACCESS_TOKEN&amp;gt;" \
    --header "Content-Type: application/json" \
    --data "{\"account_id\": \"dbid:AACCsTU3d_-j5rfgJkGLObJErDLctQmUZw0\"}"

# &amp;lt; HTTP/1.1 409 Conflict
# ...
# &amp;lt; Content-Type: application/json
# ...
# {"error_summary": "no_account/.", "error": {".tag": "no_account"}}

curl -vX POST https://api.dropboxapi.com/2/users/get_account \
    --header "Authorization: Bearer &amp;lt;ACCESS_TOKEN&amp;gt;" \
    --header "Content-Type: application/json" \
    --data "{\"account_id\": \"dbid:notvalidformat\"}"

# &amp;lt; HTTP/1.1 400 Bad Request
# ...
# &amp;lt; Content-Type: text/plain; charset=utf-8
# ...
# Error in call to API function "users/get_account": request body: account_id: 'dbid:notvalidformat' must be at least 40 characters, got 19
&lt;/PRE&gt;
&lt;P&gt;The API itself doesn't return the data/CDATA formatting in your post, so that is presumably coming from whatever tools&amp;nbsp;you're using.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Dec 2016 16:01:16 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-response-is-coming-into-different-different-format/m-p/199806#M9336</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2016-12-29T16:01:16Z</dc:date>
    </item>
    <item>
      <title>Re: Error response is coming into different different format</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-response-is-coming-into-different-different-format/m-p/200460#M9405</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I am sending the request into JSON format then response should also come into JSON format, if ID validation fails or not. If it is not coming into JSON format then I don't think its good API design.&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Shashi Bala</description>
      <pubDate>Wed, 04 Jan 2017 14:20:34 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-response-is-coming-into-different-different-format/m-p/200460#M9405</guid>
      <dc:creator>ShashiBala</dc:creator>
      <dc:date>2017-01-04T14:20:34Z</dc:date>
    </item>
    <item>
      <title>Re: Error response is coming into different different format</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-response-is-coming-into-different-different-format/m-p/200499#M9408</link>
      <description>Thanks for the feedback! As it is designed the format of the response is not dictated by the format of the request, but rather can be determined programmatically by checking the response Content-Type. I'll send this feedback along to the team though.</description>
      <pubDate>Wed, 04 Jan 2017 18:07:07 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Error-response-is-coming-into-different-different-format/m-p/200499#M9408</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-01-04T18:07:07Z</dc:date>
    </item>
  </channel>
</rss>

