question

antmit avatar image
antmit asked

400 Response code creating folder, NodeJS REST API

I'm using Node.JS to make calls to the cloud drive REST API and am getting a response code of 400 with no real useful error message that I can find. Can someone help me figure out what's wrong? My authorization token was obtained with &scope=clouddrive%3Aread_image%20clouddrive%3Aread_video%20clouddrive%3Aread_document%20clouddrive%3Awrite and I was able to use this token to list cloud drive contents. The body of my request is name=TestFolder&kind=FOLDER href: ' https://cdws.us-east-1.amazonaws.com/drive/v1/nodes', _header: 'POST /drive/v1/nodes HTTP/1.1\r\nAuthorization: Bearer **REDACTED**\r\nContent-Length: 27\r\nContent-Type: application/x-www-form-urlencoded\r\nUser-Agent: **REDACTED**\r\nhost: cdws.us-east-1.amazonaws.com\r\nConnection: keep-alive\r\n\r\n', This is the response I'm getting back { server: 'Server', date: 'Tue, 04 Aug 2015 13:37:34 GMT', 'content-type': 'application/json', 'content-length': '2', connection: 'keep-alive', 'x-amzn-requestid': 'f648afa4-3aad-11e5-84a0-a52c1d96ce4a', 'x-amzn-errortype': 'SerializationException: http://internal.amazon.com/coral/com.amazon.coral.service/', 'cache-control': 'no-store', pragma: 'no-cache', vary: 'User-Agent' },
amazon drive
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

antmit avatar image
antmit answered
Nevermind.. figured it out I changed it to send JSON and it started working, didn't realize urlencoded forms was not right.
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Jamie Grossman avatar image
Jamie Grossman answered
Hi there, Thanks for posting the solution to the initial issue that you had! Thanks, Jamie
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.