/buyer/list-purchases API endpoint response size reduction
Since we introduced our new API gateway in January 2017, we’ve had a huge increase in the amount of requests we receive. It’s great to see so many people creating awesome API clients! With a large number of requests, comes a large amount of response traffic. Most of this traffic is in response to requests to the /buyer/list-purchases
endpoint.
Talking with some of our theme and plugin creators, we established that most of the response we currently send is discarded as soon as it’s received. We don’t like waste! To address this, we’re making a change on Tuesday, 28 November 2017 that will see the fields that you’re not using dropped before we send them! The additional fields that we have been sending will be available to API clients who provide a “include_all_item_details” request parameter with the value of “true”. For more details, please refer to our API documentation.
We decided to adjust the default behaviour rather than releasing a new version in order to deliver this improvement to older clients who may never upgrade. There are many WordPress themes and plugins who are communicating with this older endpoint and may never upgrade to the newer endpoint. We wanted these older clients to receive these speed improvements, and changing the functionality of the existing endpoint allows us to do this.
We believe this change will provide a better user experience for both app creators and for your customers (increased speed, decreased bandwidth) and we’ll continue to monitor and improve the API experience.
Affected version: V3
Changes:
Default behaviour is altered, the API response now only returns a subset of item attributes, that is:
{
id (integer): // Item ID,
name (string): // Item name,
number_of_sales (integer): // Number of sales,
author_username (string): // Author username,
author_url (string): // Author profile URL (e.g. https://themeforest.net/user/authorusername),
author_image (string): // Author avatar image URL,
url (string): // Item URL (e.g. https://themeforest.net/item/item-name/12345),
rating (number): // Average rating,
updated_at (string): // Date of last item update approval on Market,
attributes (array[]): // Item attributes,
previews (array[]): // Preview images and links,
wordpress_theme_metadata (optional): // Wordpress theme metadata,
wordpress_plugin_metadata (optional): // Wordpress plugin metadata
}
The full original attributes can be queried against by providing include_all_item_details=true
request parameter. For example the URL to query against would be: /buyer/list-purchases?include_all_item_details=true
Notes:
There would be no impact on applications that use attributes that are listed in the new subset item attributes, you would not have to change anything. If your applications do use attributes that are removed from default item attributes, please add include_all_item_details=true
to your API request parameter to get all item attributes.
More details:
More details can be found in the API documentation here: https://build.envato.com/api/