開発者コンソール
アクセスいただきありがとうございます。こちらのページは現在英語のみのご用意となっております。順次日本語化を進めてまいりますので、ご理解のほどよろしくお願いいたします。

RESTful API Account

Get account information

This API lets you get details about a customer account. For example, the type of information that can be obtained includes account availability, storage quota, storage usage, type of content stored in an account (i.e., photos, videos, documents, etc.) and other settings information.

Method Http Request Description
get GET : /account/info Retrieves information about an Amazon Drive account.
get GET : /account/endpoint Gets the customer endpoint against which REST queries will be run.
get GET : /account/quota Gets Account Quota and Storage Availability information
get GET : /account/usage Gets Account Usage information broken down by content category

Get Account Info

Provides information about the current user account like the status and the accepted Terms Of Use.

GET : /account/info

Returns

Current accepted TOU and status of account.

Sample Request:

GET /drive/v1/account/info HTTP/1.1
Host: cdws.us-east-1.amazonaws.com
Authorization: Bearer
Atza|IQEBLjAsAhQ5zx7pKp9PCgCy6T1JkQjHHOEzpwIUQM

cURL Request:

curl -v
https://cdws.us-east-1.amazonaws.com/drive/v1/account/info
--header "Authorization: Bearer
Atza|IQEBLjAsAhQ5zx7pKp9PCgCy6T1JkQjHHOEzpwIUQM"

Sample JSON Response:

HTTP 1.1/ 200
{
    "termsOfUse": "1.0.0",
    "status": "ACTIVE"
}

Response codes

Code Description
200 OK.
400 Bad input parameter. Error message should indicate which one and why.
401 The client passed in the invalid Auth token, Client should refresh the token and then try again.
403 Forbidden
500 Servers are not working as expected. The request is probably valid but needs to be requested again later.
503 Service Unavailable.

Get Endpoint

Gets the endpoints to use for the current customer for all the other REST API call. Cache getEndpoint for each customer for three to five days. There is no need to make call this daily.

GET : https://drive.amazonaws.com/drive/v1/account/endpoint

Returns

  • customerExists - true if the customer exists and have accepted TOU else false.
  • contentUrl - endpoint to talk to for uploading/downloading content.
  • metadataUrl - endpoint to talk to for retrieving metadata information.

Sample Request:

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

cURL Request:

curl -v
https://drive.amazonaws.com/drive/v1/account/endpoint
--header "Authorization: Bearer
Atza|IQEBLjAsAhQ5zx7pKp9PCgCy6T1JkQjHHOEzpwIUQM"

Sample JSON Response:

HTTP 1.1/ 200
{
    "customerExists": true,
    "contentUrl": "https://content-na.drive.amazonaws.com/cdproxy/",
    "metadataUrl": "https://cdws.us-east-1.amazonaws.com/drive/v1/"
}

Response codes

Code Description
200 OK.
400 Bad input parameter. Error message should indicate which one and why.
401 The client passed in the invalid Auth token, Client should refresh the token and then try again.
403 Forbidden
500 Servers are not working as expected. The request is probably valid but needs to be requested again later.
503 Service Unavailable.

Get Quota

Gets Account Quota and Storage Availability information. It is worth noting that because Amazon Drive now offers Prime members an Unlimited Photo Storage benefit you should use the 403 status check on a file upload as opposed to this call. For example, a Prime member with a 5 GB storage limit may have utilized all of their free storage, but will continue to be able to upload an unlimited number of photos never returning a 403 status code. All other non-photo files being uploaded to this Prime member's account would result in a 403 status code because they've reached their 5 GB storage limit.

GET : /account/quota

Returns

Returns a summary of the accounts availability, quota, and last calculated time.

Sample Request:

GET /drive/v1/account/quota HTTP/1.1
Host: cdws.us-east-1.amazonaws.com
Authorization: Bearer
Atza|IQEBLjAsAhQ5zx7pKp9PCgCy6T1JkQjHHOEzpwIUQM

cURL Request:

curl -v
https://cdws.us-east-1.amazonaws.com/drive/v1/account/quota
--header "Authorization: Bearer
Atza|IQEBLjAsAhQ5zx7pKp9PCgCy6T1JkQjHHOEzpwIUQM"

Sample JSON Response:

HTTP 1.1/ 200
{
    "quota": 5368709120,
    "lastCalculated": "2014-08-13T23:01:47.479Z",
    "available": 4069088896
}

Response codes

Code Description
200 OK.
400 Bad input parameter. Error message should indicate which one and why.
401 The client passed in the invalid Auth token, Client should refresh the token and then try again.
403 Forbidden
500 Servers are not working as expected. The request is probably valid but needs to be requested again later.
503 Service Unavailable.

Get Usage

Gets Account Usage information broken down by content category

GET : /account/usage

Returns

Returns usage values separated by content categories.

Sample Request:

GET /drive/v1/account/usage HTTP/1.1
Host: cdws.us-east-1.amazonaws.com
Authorization: Bearer
Atza|IQEBLjAsAhQ5zx7pKp9PCgCy6T1JkQjHHOEzpwIUQM

cURL Request:

curl -v
https://cdws.us-east-1.amazonaws.com/drive/v1/account/usage
--header "Authorization: Bearer
Atza|IQEBLjAsAhQ5zx7pKp9PCgCy6T1JkQjHHOEzpwIUQM"

Sample JSON Response:

HTTP 1.1/ 200
{
    "lastCalculated": "2014-08-13T23:17:41.365Z",
    "other": {
        "total": {
            "bytes": 29999771,
            "count": 871
        },
        "billable": {
            "bytes": 29999771,
            "count": 871
        }
    },
    "doc": {
        "total": {
            "bytes": 807170,
            "count": 10
        },
        "billable": {
            "bytes": 807170,
            "count": 10
        }
    },
    "photo": {
        "total": {
            "bytes": 9477988,
            "count": 25
        },
        "billable": {
            "bytes": 9477988,
            "count": 25
        }
    },
    "video": {
        "total": {
            "bytes": 23524252,
            "count": 22
        },
        "billable": {
            "bytes": 23524252,
            "count": 22
        }
    }
}

Response codes

Code Description
200 OK.
400 Bad input parameter. Error message should indicate which one and why.
401 The client passed in the invalid Auth token, Client should refresh the token and then try again.
403 Forbidden
500 Servers are not working as expected. The request is probably valid but needs to be requested again later.
503 Service Unavailable.

Support

If you have any questions, see the Developer Forum.