question

balasundar avatar image
balasundar asked

How to download files from cloud drive

I'm trying to download the files through rest api and was not able to succeed after authentication. I'm getting below response on sending rest api request to https://drive.amazonaws.com/drive/v1/account/endpoint. I'm sending authorization header and content type to the endpoint as mentioned in the documentation. Is it anything else I'm missing out, I'm happy to provide more details on http headers. {"Output":{"__type":"com.amazon.coral.service#UnknownOperationException","message":null},"Version":"1.0"}
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.

balasundar avatar image
balasundar answered
I haven't got any response back and not able to find right documentation provided for the issue. Below is the additional stack trace for support. Error says 403 forbidden for not providing signature, which is not provided in Amazon documentation. Please update the documentation. ************************************************************************************************************************* curl-7.46.0\AMD64>curl -v https://drive.amazonaws.com/drive/v1/account/endpoint --header "Authorization: BearerAtza|IQEBLjAsAhRXor0ErOZudclR69-IyCYBwYbrEAIUa0ARjhuGiyRgQjWmNzXfnSFpSvOUwikva2EOXqVuzt91Agu3sgaboi9Dq5qUrbEKRV-aRHMIo2bYO-F39q7T_4-4pqyu8F4xORMxBNybkF8aNWXUnY6Sx5i6Xequ4bLbS89zRpl-z98IgBVV87-XBDNysQVvbCw0p1-BsyTq-v7inxYhkL5IpqFfp77q-Hs3Xs1lZ1gwtxJSi7S-WrC7p_-i_ab0u2YSei8hBrPuUt0mK4YyNJEU3824I7GIeB7XzbBOXhvkbtpLtj1PR4A-8zRleT0zOsQqpe0bT0U5L8ejdmlkKkTZs1fTkoZAYwnhom8o96NtJkhWgZ6X6F6HQ-Qy_YG8G3FHas0Za_Gz5c_vg9_xP3XKWcHWR4L06QrDN4rjTQA" * Trying 205.251.243.243... * Connected to drive.amazonaws.com (205.251.243.243) port 443 (#0) * schannel: SSL/TLS connection with drive.amazonaws.com port 443 (step 1/3) * schannel: checking server certificate revocation * schannel: sending initial handshake data: sending 196 bytes... * schannel: sent initial handshake data: sent 196 bytes * schannel: SSL/TLS connection with drive.amazonaws.com port 443 (step 2/3) * schannel: failed to receive handshake, need more data * schannel: SSL/TLS connection with drive.amazonaws.com port 443 (step 2/3) * schannel: encrypted data buffer: offset 1460 length 4096 * schannel: encrypted data length: 1362 * schannel: encrypted data buffer: offset 1362 length 4096 * schannel: received incomplete message, need more data * schannel: SSL/TLS connection with drive.amazonaws.com port 443 (step 2/3) * schannel: encrypted data buffer: offset 4096 length 4096 * schannel: encrypted data length: 1412 * schannel: encrypted data buffer: offset 1412 length 4096 * schannel: received incomplete message, need more data * schannel: SSL/TLS connection with drive.amazonaws.com port 443 (step 2/3) * schannel: encrypted data buffer: offset 1969 length 4096 * schannel: sending next handshake data: sending 126 bytes... * schannel: SSL/TLS connection with drive.amazonaws.com port 443 (step 2/3) * schannel: encrypted data buffer: offset 51 length 4096 * schannel: SSL/TLS handshake complete * schannel: SSL/TLS connection with drive.amazonaws.com port 443 (step 3/3) * schannel: incremented credential handle refcount = 1 * schannel: stored credential handle in session cache > GET /drive/v1/account/endpoint HTTP/1.1 > Host: drive.amazonaws.com > User-Agent: curl/7.46.0 > Accept: */* > Authorization: BearerAtza|IQEBLjAsAhRXor0ErOZudclR69-IyCYBwYbrEAIUa0ARjhuGiyRgQjWmNzXfnSFpSvOUwikva2EOXqVuzt91Agu3sgaboi9Dq5qUrbEKRV-aRHMIo2bYO-F39q7T_4-4pqyu8F4xORMxBNybkF8aNWXUnY6Sx5i6Xequ4bLbS89zRpl-z98IgBVV87-XBDNysQVvbCw0p1-BsyTq-v7inxYhkL5IpqFfp77q-Hs3Xs1lZ1gwtxJSi7S-WrC7p_-i_ab0u2YSei8hBrPuUt0mK4YyNJEU3824I7GIeB7XzbBOXhvkbtpLtj1PR4A-8zRleT0zOsQqpe0bT0U5L8ejdmlkKkTZs1fTkoZAYwnhom8o96NtJkhWgZ6X6F6HQ-Qy_YG8G3FHas0Za_Gz5c_vg9_xP3XKWcHWR4L06QrDN4rjTQA > * schannel: client wants to read 16384 bytes * schannel: encdata_buffer resized 17408 * schannel: encrypted data buffer: offset 0 length 17408 * schannel: encrypted data got 1101 * schannel: encrypted data buffer: offset 1101 length 17408 * schannel: decrypted data length: 1072 * schannel: decrypted data added: 1072 * schannel: decrypted data cached: offset 1072 length 16384 * schannel: encrypted data buffer: offset 0 length 17408 * schannel: decrypted data buffer: offset 1072 length 16384 * schannel: schannel_recv cleanup * schannel: decrypted data returned 1072 * schannel: decrypted data buffer: offset 0 length 16384 < HTTP/1.1 403 Forbidden < Server: Server < Date: Tue, 02 Feb 2016 04:01:34 GMT < Content-Type: application/json < Content-Length: 719 < Connection: keep-alive < x-amzn-RequestId: a651fe59-c961-11e5-8b00-a54522a9bfc1 < x-amzn-ErrorType: IncompleteSignatureException: http://internal.amazon.com/coral/com.amazon.coral.service/ < Vary: Accept-Encoding,User-Agent < {"message":"Authorization header requires 'Credential' parameter. Authorization header requires 'Signature' parameter. Authorization header requires 'SignedHeaders' parameter. Authorization header requires existence of either a 'X-Amz-Date' or a 'Date' header. Authorization=BearerAtza|IQEBLjAsAhRXor0ErOZudclR69-IyCYBwYbrEAIUa0ARjhuGiyRgQjWmNzXfnSFpSvOUwikva2EOXqVuzt91Agu3sgaboi9Dq5qUrbEKRV-aRHMIo2bYO-F39q7T_4-4pqyu8F4xORMxBNybkF8aNWXUnY6Sx5i6Xequ4bLbS89zRpl-z98IgBVV87-XBDNysQVvbCw0p1-BsyTq-v7inxYhkL5IpqFfp77q-Hs3Xs1lZ1gwtxJSi7S-WrC7p_-i_ab0u2YSei8hBrPuUt0mK4YyNJEU3824I7GIeB7XzbBOXhvkbtpLtj1PR4A-8zRleT0zOsQqpe0bT0U5L8ejdmlkKkTZs1fTkoZAYwnhom8o96NtJkhWgZ6X6F6HQ-Qy_YG8G3FHas0Za_Gz5c_vg9_xP3XKWcHWR4L06QrDN4rjTQA"}* Connection #0 to host drive.amazonaws.com left intact
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! At the end of this page: https://developer.amazon.com/public/apis/experience/cloud-drive/content/restful-api-getting-started - there are instructions on how to get the correct endpoints for a given customer. Those endpoints are used for all of the upload and download calls, documented here: https://developer.amazon.com/public/apis/experience/cloud-drive/content/nodes From what I understand, you're unable to download after auth; however, the url you're providing is the url that you talk to to fetch endpoints. Not to actually upload or download. So, are you failing to get the endpoints, which prevents you from even forming a download request? Or are you trying to make a download request to the url used for returning endpoints? It may be easier if you provide the full request/response that you used. Hope this helps, 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.

balasundar avatar image
balasundar answered
Thank you for the response. Yes, right Jamie. I'm trying to fetch endpoint, and failing to get endpoints which prevents to get the download url of the video present in the cloud.
10 |5000

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

balasundar avatar image
balasundar answered
Curl Request and response are provided in the second post.
10 |5000

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

David sumler avatar image
David sumler answered
I am seeing the same problem. Has this issue been fixed? The documentation here and here says to send

GET /drive/v1/account/endpoint HTTP/1.1 Host: drive.amazonaws.com Authorization: Bearer Atza|IQEBLjAsAhQ5zx7pKp9PCgCy6T1JkQjHHOEzpwIUQM

However, I am seeing the same 403 response as balasundar Message was edited by: David sumler
10 |5000

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

rambalac avatar image
rambalac answered
There should be space between Bearer and token
10 |5000

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