Retrieve Assets Traffic Statistics
https://mapi.storyblok.com/v1/orgs/me/statistics/:assets_trafficReturns assets traffic usage statistics for the organization. Filter the response by date.
Query parameters
Section titled “Query parameters”- start_date string
Start date for traffic statistics. Provide date in
YYYY-MM-DDformat. - end_date string
End date for traffic statistics. Provide date in
YYYY-MM-DDformat.
Response properties
Section titled “Response properties”- assets object[]
An array of partial asset objects with the corresponding traffic statistics.
Show child properties
- id number
The numeric ID of the asset.
- alt string
The alt text of the asset (default language).
- asset_folder_id number
The ID of the folder containing this asset.
- content_length number
The asset’s content length in bytes.
- content_type string
The MIME type of the asset.
- deleted_at string
The asset’s deletion date (format:
YYYY-mm-dd HH:MM). Returnsnullif the file hasn’t been deleted. - filename string
Full path of the asset, including the file name.
- is_private boolean
When set to
true, the asset is only visible with an access token. Default:false. - space_id number
The space ID the asset belongs to.
- total_bytes number
The total bandwidth (in bytes) transferred for this asset on the specified period.
-
Examples
Section titled “Examples”Example Request
curl "https://mapi.storyblok.com/v1/orgs/me/statistics/assets_traffic" \ -H "Authorization: YOUR_OAUTH_TOKEN"// storyblok-js-client@>=7, node@>=18import Storyblok from "storyblok-js-client";
const storyblok = new Storyblok({ oauthToken: "YOUR_PERSONAL_ACCESS_TOKEN",});
try { const response = await storyblok.get('orgs/me/statistics/assets_traffic', {}) console.log({ response })} catch (error) { console.log(error)}$client = new \Storyblok\ManagementClient('YOUR_OAUTH_TOKEN');
$client->get('orgs/me/statistics/assets_traffic')->getBody();HttpResponse<String> response = Unirest.get("https://mapi.storyblok.com/v1/orgs/me/statistics/assets_traffic") .header("Authorization", "YOUR_OAUTH_TOKEN") .asString();var client = new RestClient("https://mapi.storyblok.com/v1/orgs/me/statistics/assets_traffic");var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "YOUR_OAUTH_TOKEN");IRestResponse response = client.Execute(request);import requests
url = "https://mapi.storyblok.com/v1/orgs/me/statistics/assets_traffic"
querystring = {}
payload = ""headers = { 'Authorization': "YOUR_OAUTH_TOKEN"}
response = requests.request("GET", url, data=payload, headers=headers, params=querystring)
print(response.text)require 'storyblok'client = Storyblok::Client.new(oauth_token: 'YOUR_OAUTH_TOKEN')
client.get('orgs/me/statistics/assets_traffic')let storyblok = URLSession(storyblok: .mapi(accessToken: .oauth("YOUR_OAUTH_TOKEN")))let request = URLRequest(storyblok: storyblok, path: "orgs/me/statistics/assets_traffic")let (data, _) = try await storyblok.data(for: request)print(try JSONSerialization.jsonObject(with: data))val client = HttpClient { install(Storyblok(MAPI)) { accessToken = OAuth("YOUR_OAUTH_TOKEN") }}
val response = client.get("orgs/me/statistics/assets_traffic")
println(response.body<JsonElement>()){ "assets": [ { "id": 88042181064935, "alt": "Image alt text", "asset_folder_id": 12345, "content_length": 25600, "content_type": "image/jpeg", "deleted_at": null, "filename": "https://s3.amazonaws.com/a.storyblok.com/f/286977613018464/6ea061149c/premium-appointment.jpg", "is_private": false, "space_id": 44203, "total_bytes": 8400 } ]}Was this page helpful?
This site uses reCAPTCHA and Google's Privacy Policy (opens in a new window) . Terms of Service (opens in a new window) apply.
Get in touch with the Storyblok community