Dropbox API returning http 500 status instead of http 400 status for a non-existant user in a team - dropbox-api

Starting at around 21:00 PM GMT today , when we query for a user which doesn't exist in dropbox team, we are receiving an http 500 status with internal error message. In comparison earlier we use to receive http 400 message with message that user doesn't exist in team.
Has something regressed at dropbox end, or is this change intentional and hence we should consider http 500 internal error as equivalent to user not found?
For example RESPONSE#1 is what we expected as valid behavior , while RESPONSE#2 is what we are receiving currently
RESPONSE#1
Resource: https://api.dropbox.com/1/idm/get_profile?email=dummy#authentication.test
Operation: GET
Headers: Authorization: Bearer XXX
Content Type:
Data:
%% Time: 08/28/2014 17:06:51 GMT
Message: The remote server returned an error: (400) Bad Request. Web Response: {"error": "User not on this team"} ---> System.Net.WebException: The remote server returned an error: (400) Bad Request.
RESPONSE#2
Resource: https://api.dropbox.com/1/idm/get_profile?email=dummy#authentication.test
Operation: GET
Headers: Authorization: Bearer XXX
Content Type:
Data:
Time: 08/28/2014 22:40:29
(500) Internal Server Error. Web Response: {"error": "Internal Server Error"} ---> System.Net.WebException: The remote server returned an error: (500) Internal Server Error.
Thanks
Somesh

Related

Oracle Integration Cloud: https://outlook.office.com/api/v2.0/me/sendmail returned a response status of 403 Forbidden

Tried configuring MS outlook adapter in Oracle Integration Cloud (OIC) Env.
The connection was successful. But when testing the complete implementation getting below error.
https://outlook.office.com/api/v2.0/me/sendmail returned a response status of 403 Forbidden
"error":{"code":"ErrorAccessDenied","message":"Access is denied. Check credentials and try again."
<genericRestFault><errorCode>403</errorCode><errorPath><![CDATA[POST https://outlook.office.com/api/v2.0/me/sendmail returned a response status of 403 Forbidden]]></errorPath><instance><![CDATA[{"error":{"code":"ErrorAccessDenied","message":"Access is denied. Check credentials and try again."}}]]></instance></genericRestFault>
:Application Error
I am successfully able to test the OIC Microsoft Outlook adapter to send email with attachment.When you configure the Adapter,please make sure that you have correctly set the followings.
Client Id:
Client Secret:
Scope: https://outlook.office.com/mail.send offline_access

amp-list component error in amp for email

I am new to AMP for Email and I am trying it out now! I am using the amp-list component in my email body to fetch the remote server json content. But I am getting the below js error when i checked in my browser console. Also in my Gmail inbox in the mail I received its blank.
Uncaught (in promise) Error: Class$obf_1013: [https://dynamicmail-pa.googleapis.com/v2/xhrs:proxy?alt=protojson] ti: Unsupported HTTP status: 400: Class$obf_1011: [object Object]
template-impl.js:241 Error proxying amp-list templates: Request viewerRenderTemplate failed: Error: Class$obf_1013: [https://dynamicmail-pa.googleapis.com/v2/xhrs:proxy?alt=protojson] ti: Unsupported HTTP status: 400: Class$obf_1011: [object Object]​​​
Here are the correct headers to send for AMP to work in gmail:
https://developers.google.com/gmail/ampemail/security-requirements?hl=ur#gmail
Access-Control-Allow-Origin: https://mail.google.com
AMP-Access-Control-Allow-Source-Origin: <your sender email address>
Access-Control-Expose-Headers: AMP-Access-Control-Allow-Source-Origin
We need to set the Content-Type & Access Control headers for CORS request like -
header("Content-type: application/json");
header("Access-Control-Allow-Credentials: true");
header('Access-Control-Allow-Origin: *');

HTTP status code for failed serialization

I have a GET /v2/developer/jhUxad8 endpoint which get developer from database and serialize it to json.
What http status code should I return when serialization fail?
https://www.codetinkerer.com/2015/12/04/choosing-an-http-status-code.html
What http status code should I return when serialization fail?
If I'm understanding you correctly, the server understands the request, and is trying to fulfill it, but because of a data problem is unable to do so.
500 Internal Server Error
The 500 (Internal Server Error) status code indicates that the server encountered an unexpected condition that prevented it from fulfilling the request.

Error in using Wget to download individual files instead of all files via manifest

I am getting an error in using Wget to download individual files instead of all files via manifest.
I want to download the files as described on this website
https://s3-us-west-2.amazonaws.com/ai2-s2-research-public/open-corpus/index.html
I used the command they gave just fine
wget -i https://s3-us-west-2.amazonaws.com/ai2-s2-research-public/open-corpus/manifest.txt
However, I just want to download just certain files, not every file in the manifest. I was looking at the manifest file and its contents looked like this
corpus-2018-05-03/s2-corpus-00.gz
corpus-2018-05-03/s2-corpus-01.gz
corpus-2018-05-03/s2-corpus-02.gz
corpus-2018-05-03/s2-corpus-03.gz
corpus-2018-05-03/s2-corpus-04.gz
corpus-2018-05-03/s2-corpus-05.gz
So I just changed the command to something like this
wget -i https://s3-us-west-2.amazonaws.com/ai2-s2-research-public/open-corpus/corpus-2018-05-03/s2-corpus-02.gz
The command runs fine at first, but after it downnloads the file I get some warning and/or error messages. And I'm not sure what they mean. Here is the output
--2018-08-11 00:03:47-- https://s3-us-west-2.amazonaws.com/ai2-s2-research-public/open-corpus/corpus-2018-05-03/s2-corpus-02.gz
Resolving s3-us-west-2.amazonaws.com (s3-us-west-2.amazonaws.com)... 52.218.128.152
Connecting to s3-us-west-2.amazonaws.com (s3-us-west-2.amazonaws.com)|52.218.128.152|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 996588773 (950M) [application/x-gzip]
Saving to: ‘s2-corpus-02.gz’
s2-corpus-02.gz 100%[===================>] 950.42M 38.5MB/s in 25s
2018-08-11 00:04:13 (37.5 MB/s) - ‘s2-corpus-02.gz’ saved [996588773/996588773]
�7�sa����=���xT���~��%����3X�M�|~�X^Z%\�?�`��Fx?�%��\���/�5/�$��P����g+�v�j: Bad port number
s2-corpus-02.gz: Invalid URL https://�*�b�:ۅF�Cg��$�Bj�H�gLM逖N�l���ZUV�[�;&mu�̸��&�y��X�%��;�˝1|)�$�d˝�: Bad port number
s2-corpus-02.gz: Invalid URL https://{Y1��&�������\�Y�Ey�Զ�:E3;ɜ Q!: Bad port number
n]��g: Invalid host name
%��)]kZ�R�e����� Ӡ�{)]��B��0��OV�%T��: Invalid host name
s2-corpus-02.gz: Invalid URL https://7�s�s����{���!ސ#: Invalid host name
s2-corpus-02.gz: Invalid URL https://���ݔ�v�G7NI:,J�����i�YKN�o�.e�N�z< R� DZ$+4;!C�B���ZJ"�>��2�#`ǼU3��x��D� bqh���: Bad port number
�5�3���݂5�LLT�]���j0)dv7:2�]�x���a���fv�#��$=!Y�ږ�9U �#H*�Ǹ: Bad port number
uc;�]*�m������:����o4Z�`c�#,U��ze"vrY;,!̝rF���aL�L��7�Ն-�zs�w;Zu\^����e��H��m��{ʪ*��l���O: Bad port number
s2-corpus-02.gz: Invalid URL https://�:�D����: Bad port number
ٶ����1�>g�y���=͛����hv���O�b�o��m���i��&��w��/���{�k| �Q(zq��ϔ���: Bad port number
���^盩Y��'DIfe*��&��ƫO�|�80��湏��~9: Invalid host name
^zs��멨�u�o\?��#`x����{�>�˝�d��CI�C��4Fg������9j?�w�(X�N���7: Bad port number
s2-corpus-02.gz: Invalid URL https://��j�q(�Ur��1�KMq�1]��#d�aԌ����:�3�pEzbaj(��B��*}kK��ΊOu;B��V: Bad port number
s2-corpus-02.gz: Invalid URL https://�����`m���<�5��!;p3���~�`�)�Q���0�:!�n��`�r���D0ǖ�&r'�*.i�!��mM����n�oڀ�Zk�l�H1���t�: Bad port number
Incomplete or invalid multibyte sequence encountered
--2018-08-11 00:04:20-- https://s3-us-west-2.amazonaws.com/ai2-s2-research-public/open-corpus/corpus-2018-05-03/%1F%8B%08
Connecting to s3-us-west-2.amazonaws.com (s3-us-west-2.amazonaws.com)|52.218.128.152|:443... connected.
HTTP request sent, awaiting response... 400 Bad Request
2018-08-11 00:04:20 ERROR 400: Bad Request.
Incomplete or invalid multibyte sequence encountered
--2018-08-11 00:04:20-- https://s3-us-west-2.amazonaws.com/ai2-s2-research-public/open-corpus/corpus-2018-05-03/%1F%8B%08
Connecting to s3-us-west-2.amazonaws.com (s3-us-west-2.amazonaws.com)|52.218.128.152|:443... connected.
HTTP request sent, awaiting response... 400 Bad Request
2018-08-11 00:04:20 ERROR 400: Bad Request.
Incomplete or invalid multibyte sequence encountered
--2018-08-11 00:04:20-- https://s3-us-west-2.amazonaws.com/ai2-s2-research-public/open-corpus/corpus-2018-05-03/%C9E%DF%C4$%0C.eL%7B%93%82%F1J%04%C3m%14%8Dl%9Ckk%AB%1B%7C%9B%B4%17%A26m
Connecting to s3-us-west-2.amazonaws.com (s3-us-west-2.amazonaws.com)|52.218.128.152|:443... connected.
HTTP request sent, awaiting response... 400 Bad Request
2018-08-11 00:04:20 ERROR 400: Bad Request.
Incomplete or invalid multibyte sequence encountered
--2018-08-11 00:04:20-- https://s3-us-west-2.amazonaws.com/ai2-s2-research-public/open-corpus/corpus-2018-05-03/%C9E%DF%C4$%0C.eL%7B%93%82%F1J%04%C3m%14%8Dl%9Ckk%AB%1B%7C%9B%B4%17%A26m
Connecting to s3-us-west-2.amazonaws.com (s3-us-west-2.amazonaws.com)|52.218.128.152|:443... connected.
HTTP request sent, awaiting response... 400 Bad Request
2018-08-11 00:04:20 ERROR 400: Bad Request.
Warning: wildcards not supported in HTTP.
Incomplete or invalid multibyte sequence encountered
--2018-08-11 00:04:20-- https://s3-us-west-2.amazonaws.com/ai2-s2-research-public/open-corpus/corpus-2018-05-03/%D4%9F%B5%F8%C3j%86%86%DEm6%CB%F5%EF%CE%CF%D7qn1n~%ED%EF%FA%99]%9D%F5%AB%DB%F3%A5]%C6%D5%B9sF4%A2%B52%A5%E8%99%16%3Ey%E3%92%16%9C%7B%CB%A2%60%C2%0B%99l%AD%9E%D0C%AFB*%CF%C5%A7%3C%10_q%B7%DDn%EE%FA%15%8D%CF??Y%D8%3C%CA%DFn1]%F7%DB%EA*v%F9%81y%F0j&j%D90%F3%E4%1F%FF%F3%C9%EE%CA%AB%B3%8B%B3%EAzio%17%FD%AC%DF_+Ykpu%7Dp%ED7go%CE%AA%9B8_b%96'%97
Connecting to s3-us-west-2.amazonaws.com (s3-us-west-2.amazonaws.com)|52.218.128.152|:443... connected.
HTTP request sent, awaiting response... 400 Bad Request
2018-08-11 00:04:20 ERROR 400: Bad Request.
Warning: wildcards not supported in HTTP.
Incomplete or invalid multibyte sequence encountered
--2018-08-11 00:04:20-- https://s3-us-west-2.amazonaws.com/ai2-s2-research-public/open-corpus/corpus-2018-05-03/%D4%9F%B5%F8%C3j%86%86%DEm6%CB%F5%EF%CE%CF%D7qn1n~%ED%EF%FA%99]%9D%F5%AB%DB%F3%A5]%C6%D5%B9sF4%A2%B52%A5%E8%99%16%3Ey%E3%92%16%9C%7B%CB%A2%60%C2%0B%99l%AD%9E%D0C%AFB*%CF%C5%A7%3C%10_q%B7%DDn%EE%FA%15%8D%CF??Y%D8%3C%CA%DFn1]%F7%DB%EA*v%F9%81y%F0j&j%D90%F3%E4%1F%FF%F3%C9%EE%CA%AB%B3%8B%B3%EAzio%17%FD%AC%DF_+Ykpu%7Dp%ED7go%CE%AA%9B8_b%96'%97
Connecting to s3-us-west-2.amazonaws.com (s3-us-west-2.amazonaws.com)|52.218.128.152|:443... connected.
HTTP request sent, awaiting response... 400 Bad Request
2018-08-11 00:04:20 ERROR 400: Bad Request.
Warning: wildcards not supported in HTTP.
Incomplete or invalid multibyte sequence encountered
--2018-08-11 00:04:20-- https://s3-us-west-2.amazonaws.com/ai2-s2-research-public/open-corpus/corpus-2018-05-03/%D6H%95/%DD%CF%F7%BBr%C7%DB%D7o.%DF%BF%ADh2%AB%D3%F2%CF%EB%97/_Vo%BB%19%A6uu_]%F6%F3%F9v%D1%F92%C5%F8%B8Hq%15%17%3E%92H%D00%5E%B8%F5fe%FD%06%0F%7B%F9y%13%17%EB%7C]%EAW%D5%FB%EB%ABo%AAnQ%D9j%DE%BBn%16+%1BN%EF%20%B6q%F1%B1[%F5%8B9%C4%B9%BA%B3%1Fc%E5b%5CT!~%8C%B3~%19C%E5%EE%AB%CD],%B7%BF~y%F3M%F5%A9_%FDHb%7B%BB%EA%B7Kt%F0.%AEc%15%F7/%B3+%7C%9C%C7%D5-]d%D7U%A4)%D9tx%F2%AA,%84j=.%83%DC%B0%0D%9A%8B%1E%CD%AA%18nc%B5%88%1Bz%C1%FA%ACz%D5%7FB
Connecting to s3-us-west-2.amazonaws.com (s3-us-west-2.amazonaws.com)|52.218.128.152|:443... connected.
HTTP request sent, awaiting response... 400 Bad Request
2018-08-11 00:04:20 ERROR 400: Bad Request.
Warning: wildcards not supported in HTTP.
Incomplete or invalid multibyte sequence encountered
--2018-08-11 00:04:20-- https://s3-us-west-2.amazonaws.com/ai2-s2-research-public/open-corpus/corpus-2018-05-03/%D6H%95/%DD%CF%F7%BBr%C7%DB%D7o.%DF%BF%ADh2%AB%D3%F2%CF%EB%97/_Vo%BB%19%A6uu_]%F6%F3%F9v%D1%F92%C5%F8%B8Hq%15%17%3E%92H%D00%5E%B8%F5fe%FD%06%0F%7B%F9y%13%17%EB%7C]%EAW%D5%FB%EB%ABo%AAnQ%D9j%DE%BBn%16+%1BN%EF%20%B6q%F1%B1[%F5%8B9%C4%B9%BA%B3%1Fc%E5b%5CT!~%8C%B3~%19C%E5%EE%AB%CD],%B7%BF~y%F3M%F5%A9_%FDHb%7B%BB%EA%B7Kt%F0.%AEc%15%F7/%B3+%7C%9C%C7%D5-]d%D7U%A4)%D9tx%F2%AA,%84j=.%83%DC%B0%0D%9A%8B%1E%CD%AA%18nc%B5%88%1Bz%C1%FA%ACz%D5%7FB
Connecting to s3-us-west-2.amazonaws.com (s3-us-west-2.amazonaws.com)|52.218.128.152|:443... connected.
HTTP request sent, awaiting response... 400 Bad Request
2018-08-11 00:04:20 ERROR 400: Bad Request.
The name is too long, 243 chars total.
Trying to shorten...
New name is R�է.�%10�����4��M?%C7%90%F9I%97%E7%D1%DF%D9E%B7%9E%9FT%DDY%3C;%A9%5E__%DC%5C%5CUO1%16+%7B%BA%EE%D0%A8%87%F7%8D%13:5%07%CF%CE%AA?F%BCj%8E%0EmrW%F2%A4%F6%D36%7BH%16%FE%FC%88f%A1%F1%D0%0C%A9C%AB%1E%AE%B3%3CAG&%7B%98%91%2F%0C%CE%FF?)%FF%DF.
Incomplete or invalid multibyte sequence encountered
--2018-08-11 00:04:20-- https://s3-us-west-2.amazonaws.com/ai2-s2-research-public/open-corpus/corpus-2018-05-03/R%BF%D5%A7.%90%10%85%B8%9C%F5%F74%B1%DBM?%C7%90%F9I%97%E7%D1%DF%D9E%B7%9E%9FT%DDY%3C;%A9%5E__%DC%5C%5CUO1%16+%7B%BA%EE%D0%A8%87%F7%8D%13:5%07%CF%CE%AA?F%BCj%8E%0EmrW%F2%A4%F6%D36%7BH%16%FE%FC%88f%A1%F1%D0%0C%A9C%AB%1E%AE%B3%3CAG&%7B%98%91/%0C%CE%FF?)%FF%DF%9B%142
Connecting to s3-us-west-2.amazonaws.com (s3-us-west-2.amazonaws.com)|52.218.128.152|:443... connected.
HTTP request sent, awaiting response... 400 Bad Request
2018-08-11 00:04:20 ERROR 400: Bad Request.
The name is too long, 243 chars total.
Trying to shorten...
New name is R�է.�%10�����4��M?%C7%90%F9I%97%E7%D1%DF%D9E%B7%9E%9FT%DDY%3C;%A9%5E__%DC%5C%5CUO1%16+%7B%BA%EE%D0%A8%87%F7%8D%13:5%07%CF%CE%AA?F%BCj%8E%0EmrW%F2%A4%F6%D36%7BH%16%FE%FC%88f%A1%F1%D0%0C%A9C%AB%1E%AE%B3%3CAG&%7B%98%91%2F%0C%CE%FF?)%FF%DF.
Incomplete or invalid multibyte sequence encountered
--2018-08-11 00:04:20-- https://s3-us-west-2.amazonaws.com/ai2-s2-research-public/open-corpus/corpus-2018-05-03/R%BF%D5%A7.%90%10%85%B8%9C%F5%F74%B1%DBM?%C7%90%F9I%97%E7%D1%DF%D9E%B7%9E%9FT%DDY%3C;%A9%5E__%DC%5C%5CUO1%16+%7B%BA%EE%D0%A8%87%F7%8D%13:5%07%CF%CE%AA?F%BCj%8E%0EmrW%F2%A4%F6%D36%7BH%16%FE%FC%88f%A1%F1%D0%0C%A9C%AB%1E%AE%B3%3CAG&%7B%98%91/%0C%CE%FF?)%FF%DF%9B%142
Connecting to s3-us-west-2.amazonaws.com (s3-us-west-2.amazonaws.com)|52.218.128.152|:443... connected.
HTTP request sent, awaiting response... 400 Bad Request
2018-08-11 00:04:20 ERROR 400: Bad Request.
This is just a small part of the output. It continues and doesn't seem to finish running until I manually stop the execution.
This is just a bad mistake with wget. From the manual page,
-i file, --input-file=file (Read URLs from a local or external file.)
So the command used, tries to parse URLs from the binary content of https://s3-us-west-2.amazonaws.com/ai2-s2-research-public/open-corpus/corpus-2018-05-03/s2-corpus-02.gz and "wget" those urls. The invalid URLs (from binary content) just lead to more errors.
The proper and simple solution is to modify the contents of manifest.txt, before using it with wget -i.

Trying to do a SiteTraversal with Yodlee

I am following the quick start guide and I am able to get both the Cobrand and User token's, however when I try to make a POST request to https://rest.developer.yodlee.com/services/srest/restserver/v1.0/jsonsdk/SiteTraversal/searchSite, I receive a 404 doc not found. I am able to use wget to download the file for /authenticate/login as shown below, but wget receives a 404.
zachallett# ~/code/yodlee/sampleapp
$ wget https://rest.developer.yodlee.com/services/srest/restserver/v1.0/jsonsdk/SiteTraversal/searchSite
--2013-12-09 14:48:02-- https://rest.developer.yodlee.com/services/srest/restserver/v1.0/jsonsdk/SiteTraversal/searchSite
Resolving rest.developer.yodlee.com... 216.35.6.163
Connecting to rest.developer.yodlee.com|216.35.6.163|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2013-12-09 14:48:03 ERROR 404: Not Found.
zachallett# ~/code/yodlee/sampleapp
$ wget https://rest.developer.yodlee.com/services/srest/restserver/v1.0/authenticate/login
--2013-12-09 14:48:16-- https://rest.developer.yodlee.com/services/srest/restserver/v1.0/authenticate/login
Resolving rest.developer.yodlee.com... 216.35.6.163
Connecting to rest.developer.yodlee.com|216.35.6.163|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [application/json]
Saving to: ‘login’
[ <=> ] 16 --.-K/s in 0s
2013-12-09 14:48:16 (1.53 MB/s) - ‘login’ saved [16]
I have tried using this from an external REST client and it works.
Here is the request
POST /services/srest/restserver/v1.0/jsonsdk/SiteTraversal/searchSite HTTP/1.1
Host: rest.developer.yodlee.com
Cache-Control: no-cache
Content-Type: application/x-www-form-urlencoded
cobSessionToken=xxxxxxxxxxxxxxxxxxxxxxxx&userSessionToken=xxxxxxxxxxxxxxxxxxxxxxx&siteSearchString=dag