You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.
Forum Discussion
Umair-afzal
7 years agoHelpful | Level 5
"Dropbox-API-Arg": could not decode input as JSON
Error in call to API function "files/get_thumbnail": HTTP header "Dropbox-API-Arg": could not decode input as JSON
here is code
var folder_flag = 0;
axios({
method: 'POST',
...
Greg-DB
Dropbox Staff
[Cross-linking for reference: https://stackoverflow.com/questions/51614378/error-in-call-to-api-function-files-get-thumbnail-http-header-dropbox-api-ar ]
This error is indicating that the value you're sending in the "Dropbox-API-Arg" header isn't valid JSON. In your code, you're setting "Dropbox-API-Arg" to "response.data.entries[i].id", which isn't JSON. It's just a string with the ID for a file.
You can see an example of what this is supposed to be in the documentation for /2/files/get_thumbnail. You probably mean to do something like this:
'Dropbox-API-Arg': JSON.stringify({"path": response.data.entries[i].id})
Umair-afzal
7 years agoHelpful | Level 5
I got this response
ÿØÿàJFIFÿÛC
%# , #&')*)-0-(0%()(ÿÛC
(((((((((((((((((((((((((((((((((((((((((((((((((((ÿÀ$@"ÿÄ
ÿĵ}!1AQa"q2¡#B±ÁRÑð$3br
%&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz ¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖ×ØÙÚáâãäåæçèéêñòóôõö÷øùúÿÄ
ÿĵw!1AQaq"2B¡±Á #3RðbrÑ
$4á%ñ&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz ¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖ×ØÙÚâãäåæçèéêòóôõö÷øùúÿÚ?è¼!£ÜM¤ÝËeáKMR6*"I|Æع@»È\rsÜפéÒn4ø$Ö¼9aëGcîXÉþ÷ú×Û|DÖtëO±èò%¨/2Én¸°HÜ20«ÏïZMÛ]i6ÓÞ\Ý4³ÛFÒ0¨%zu®ªô`¥eg÷TæiI¤®CÿCÿý̯Cÿ:|?ð¸pi¹WÛÛßzUÛe·ØU§Ä/¼w'p<æ*´~-ÓgѵmZÐ5Ä:|s4ÁLk@FÇcÒ¸ã$õ0¾¶!ðÈØßØ$@!qÇo©éJ<áÿzÈmÆ~Pp?È®[VøÁ£Xh_É¥ê
mT¦FáïT:WÆ}RðÖ±®G¦ê)m`V'GÙºBvæÇñ¾ù¢å®v1øÃñÈSùã
óßxZk«H>iwVÑJ|.ü¦{î{Þ¶üñNñmÛ[Ùiú#g̾YÎÕ'Ï®ü}Ó4j]*}+U[§ò7tþ÷5q}MðóöMóAKÖÿ£Gè×ÞE}-ÜÒM/îÓs õ÷`
¡é%Ë6·?óÍkã¯
Ç¥ÿûÉü}¡áxü7¤0)±Ã×vÕ{´%ÝãNË»(|Hñ%ß|4§ìñ̤b´lWZxøÂ?¨}§J¶Mxº^¹cªÈ¾Z²q¼ã5迶ÿæ11׫×'7\{WÍEOÛYêÁûã*ã w@wvÁ¯§+Ì©ÞÖ-øêêûÃ&;H ÕeàevãO~Îè~/ßÀ:§þÌU®îæä¿ ³Ã:ݽµµÜìسÍIê@_ï)Ïozµqiý±$óEkoÌÁÿqoò0vçz$ã{Krà¤Õã±±ð_źg uè.µC#Z¨!ÞGtÎ{×'âûÕÕüuy¨[$ïQ3£8Á*dÈϽUÖü7¯éöwºz=ý¾¯%ÏÙÊD¬Øgâ°lnåû}Ü92?àB ò%Mu9ô^k}4Go±DÌØ2yÏ^Mz=ÅOZÚÃ7¶áaTDͤDü s·®Z(±5&ì®ìt¿y»uOkÞ1ÒÛOׯ{Më.Å æSÇ {×?ª,µ)lå"ªOLäñ×(®XjÛ~_¨ODÛ_ÐÁñòiÛ©òXØ¿ å¶îy®ÒÓN·ñ&c:âV^N3ÐZ(«|±3¦äs0xóR]54Ãmfö8!¡Ìu~Nr}j|5§é~ ÑÁºKÆ*¸#îç¥Vµ>%èe ÿÙ
ÿØÿàJFIFÿÛC
%# , #&')*)-0-(0%()(ÿÛC
(((((((((((((((((((((((((((((((((((((((((((((((((((ÿÀ$@"ÿÄ
ÿĵ}!1AQa"q2¡#B±ÁRÑð$3br
%&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz ¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖ×ØÙÚáâãäåæçèéêñòóôõö÷øùúÿÄ
ÿĵw!1AQaq"2B¡±Á #3RðbrÑ
$4á%ñ&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz ¢£¤¥¦§¨©ª²³´µ¶·¸¹ºÂÃÄÅÆÇÈÉÊÒÓÔÕÖ×ØÙÚâãäåæçèéêòóôõö÷øùúÿÚ?è¼!£ÜM¤ÝËeáKMR6*"I|Æع@»È\rsÜפéÒn4ø$Ö¼9aëGcîXÉþ÷ú×Û|DÖtëO±èò%¨/2Én¸°HÜ20«ÏïZMÛ]i6ÓÞ\Ý4³ÛFÒ0¨%zu®ªô`¥eg÷TæiI¤®CÿCÿý̯Cÿ:|?ð¸pi¹WÛÛßzUÛe·ØU§Ä/¼w'p<æ*´~-ÓgѵmZÐ5Ä:|s4ÁLk@FÇcÒ¸ã$õ0¾¶!ðÈØßØ$@!qÇo©éJ<áÿzÈmÆ~Pp?È®[VøÁ£Xh_É¥ê
mT¦FáïT:WÆ}RðÖ±®G¦ê)m`V'GÙºBvæÇñ¾ù¢å®v1øÃñÈSùã
óßxZk«H>iwVÑJ|.ü¦{î{Þ¶üñNñmÛ[Ùiú#g̾YÎÕ'Ï®ü}Ó4j]*}+U[§ò7tþ÷5q}MðóöMóAKÖÿ£Gè×ÞE}-ÜÒM/îÓs õ÷`
¡é%Ë6·?óÍkã¯
Ç¥ÿûÉü}¡áxü7¤0)±Ã×vÕ{´%ÝãNË»(|Hñ%ß|4§ìñ̤b´lWZxøÂ?¨}§J¶Mxº^¹cªÈ¾Z²q¼ã5迶ÿæ11׫×'7\{WÍEOÛYêÁûã*ã w@wvÁ¯§+Ì©ÞÖ-øêêûÃ&;H ÕeàevãO~Îè~/ßÀ:§þÌU®îæä¿ ³Ã:ݽµµÜìسÍIê@_ï)Ïozµqiý±$óEkoÌÁÿqoò0vçz$ã{Krà¤Õã±±ð_źg uè.µC#Z¨!ÞGtÎ{×'âûÕÕüuy¨[$ïQ3£8Á*dÈϽUÖü7¯éöwºz=ý¾¯%ÏÙÊD¬Øgâ°lnåû}Ü92?àB ò%Mu9ô^k}4Go±DÌØ2yÏ^Mz=ÅOZÚÃ7¶áaTDͤDü s·®Z(±5&ì®ìt¿y»uOkÞ1ÒÛOׯ{Më.Å æSÇ {×?ª,µ)lå"ªOLäñ×(®XjÛ~_¨ODÛ_ÐÁñòiÛ©òXØ¿ å¶îy®ÒÓN·ñ&c:âV^N3ÐZ(«|±3¦äs0xóR]54Ãmfö8!¡Ìu~Nr}j|5§é~ ÑÁºKÆ*¸#îç¥Vµ>%èe ÿÙ
- Greg-DB7 years agoDropbox StaffThat is the raw data for the thumbnail itself. Exactly what you do with that is up to you. For example, you may wish to save that somewhere, or display it to the user, etc.
- tridejur6 years agoExplorer | Level 3
JSONM stringify? .What the heck is that?. You cannot use that value in all languajes, please correct JSON decoding
- Greg-DB6 years agoDropbox Staff
tridejur JSON.stringify is a method specific to JavaScript. This thread is about proper client-side handling of this API call in JavaScript, so this code is only relevant to JavaScript. Plese refer to the documentation for whatever language you're using for information on how to parse/write JSON.
There wasn't an issue with the server-side JSON decoding discovered in this thread. If you believe you've encountered an issue with the the server-side JSON decoding, please report the details in a new thread.
- tridejur6 years agoExplorer | Level 3
It was ust a missundrstanding in your json compiler.
About Dropbox API Support & Feedback
Find help with the Dropbox API from other developers.
5,889 PostsLatest Activity: 2 hours agoIf you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.
For more info on available support options for your Dropbox plan, see this article.
If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!