Download History

 

ON THIS PAGE      Show

 

 

 

 

Description

Returns your order history (a list of content items downloaded by you or your salesperson) in JSON or CSV format. The download information is available for the last 365 days only. The default date range is 30 days prior to the time of the request. You can use the optional min_date and max_date parameters to specify another date range that may not exceed 63 days within the last 365 days.

Request

Required Request Header

  • x-api-key. Specifies the API key to authorize the request. The x-apikey header is also currently supported.

Optional Request Header

  • Accept-Encoding. Compresses the response to the gzip format. The valid value is gzip.

Request URI

  • Method: GET
  • Request URI (must be URL-encoded):

    https://api.ap.org/media/v[{version}]/account/downloads?[&{optional_parameters}]

Base URI Parameter

  • version (optional). The API version; for example, 2.0. When this parameter value is not specified, the API version set as default for your account is returned.

Optional Parameters

  • min_date. The date and time after which the content items were downloaded, in the format YYYY-MM-DD; for example, 2018-09-20. The default is 30 days prior to the time of the request. The download information is available for the last 365 days only. The requested date range may not exceed 60 days.

  • max_date. The date and time before which the content items were downloaded, in the format YYYY-MM-DD; for example, 2018-10-04. The default is the time of the request. The requested date range may not exceed 60 days.

  • include, exclude. Parameters used to customize the fields returned in the response. For more information, see Customizing Response Fields.
  • format. The response format (json or csv). By default, JSON is returned.

Request URI Example

https://api.ap.org/media/v/account/downloads?min_date=2018-04&max_date=2018-05

Response

The Account Downloads method returns the standard HTTP status code of "200 - OK" and a list of downloaded content items for the specified API key and date parameters in the requested format (JSON or CSV).

If CSV is requested, the default file name format is usage_downloads_min_date**_max_date.csv**; for example, usage_downloads_2017-08-24_2017-09-28.csv.

For information about error codes, see API Codes.

Response Headers

  • x-mediaapi-Q-name. The API method to which the throttle/quota applies (corresponds to the "method" property returned by Account Quotas. Possible values are search, feed, account, download, ondemand, item, other.

  • x-mediaapi-Q-secondsLeft. The number of seconds remaining in the current period.

  • x-mediaapi-Q-used. Indicates the current usage and limit (the maximum number or calls allowed during the period), in the format {usage}/{limit}; for example, 1/6.

  • x-mediaapi-QDay-minutesLeft. (Optional; returned if a per-day quota is configured) The number of minutes remaining in the current period.

  • x-mediaapi-QDay-used. (Optional; returned if a per-day quota is configured) Indicates the current usage and limit (the maximum number or calls allowed during the period), in the format {usage}/{limit}; for example, 2/5000000.

Top-Level Properties

  • api_version. The API version.
  • api_mode. The API mode; for example, "live" or "preview."
  • api_build. The API build number.
  • id. The response ID.
  • method. The API method name and HTTP method.
  • org_name. Organization name.
  • params. Parameters used in the API request.
  • data. Contains the data and metadata associated with the response.

Response Descriptive Properties

  • id. The account download history URL.
  • title. The response name.
  • updated. The date and time (in UTC) when the response was generated.
  • total_items. The number of downloads returned in the response.
  • current_item_count. The number of downloads on the current page.
  • min_date. The date and time after which the content items were downloaded. The default is 30 days prior to the time of the request.
  • max_date. The date and time before which the content items were downloaded. The default is the time of the request.
  • downloads. Contains the data and metadata associated with an individual download.

Download Descriptive Properties

  • id. Order number.
  • duplicate. Indicates whether the content item is a duplicate.
  • downloaded_by. The user's first and last names.
  • download_date. The date and time of the content item download in Coordinated Universal Time (UTC).
  • charge. The charge for the content item.
  • currency. The currency of the charge.
  • item. Contains the data and metadata associated with an individual downloaded item.
    • id. The content item ID (the unique ID used by the API).
    • type. Indicates the content item media type.
    • friendlykey. The human-readable ID.
    • title. The content item title.
    • source. The content item source name.

Sample Response

{
    "api_version": "2.0",
    "api_mode": "live",
    "api_build": "2.0.2",  
    "id": "ByQJVa5j-",
    "method": "/account/downloads.GET",
    "org_name": "My Organization",
    "params": {
        "min_date": "2020-05-20", 
        "max_date": "2020-06-27"
    },
    "data": {
        "id": "https://api.ap.org/media/v/account/downloads",
        "title": "Download History",
        "updated": "2020-06-28T16:19:29.616Z",
        "total_items": 17,
        "current_item_count": 17,
        "min_date": "2020-05-20",
        "max_date": "2020-06-27",
        "downloads": [
            {
                "id": 32800283,
                "downloaded_by": "First Last",
                "download_date": "2020-06-24T22:01:54Z",
                "duplicate": false,
                "charge": 10.00,
                "currency": "USD",
                "item": {
                    "id": "https://api.ap.org/media/v/content/a342d7bd56394600b7594d5f395eb387",
                    "type": "Picture",
                    "friendlykey": "17003157050469",
                    "title": "28th Annual Palm Springs International Film Festival - Arrivals",
                    "source": "Invision"
                },
            },
            {
                "id": 36212377,
                "org_name": "My Organization",
                "downloaded_by": "First Last",
                "download_date": "2020-06-15T22:01:54Z",
                "duplicate": true,
                "charge": 0.00,
                "currency": "USD",
                "item": {
                    "id": "https://api.ap.org/media/v/content/a342d7bd56394600b7594d5f395eb387",
                    "type": "Picture",
                    "friendlykey": "17003157050469",
                    "title": "28th Annual Palm Springs International Film Festival - Arrivals",
                    "sources": "Invision"
                },
            }
        ]
    }
}