Analytics
GET /analytics/metrics
Retrieve various analytics metrics for the specified time period
curl -X GET "https://api.example.com/v2/analytics/metrics?start_date=2024-01-01&end_date=2024-12-31&metrics=users,projects,storage" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer YOUR_API_TOKEN"
import requests
import json
url = "https://api.example.com/v2/analytics/metrics?start_date=2024-01-01&end_date=2024-12-31&metrics=users,projects,storage"
headers = {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
response = requests.get(url, headers=headers)
print(response.json())
const response = await fetch("https://api.example.com/v2/analytics/metrics?start_date=2024-01-01&end_date=2024-12-31&metrics=users,projects,storage", {
method: "GET",
headers: {
"Content-Type": "application/json",
"Authorization": "Bearer YOUR_API_TOKEN"
}
});
const data = await response.json();
console.log(data);
package main
import (
"fmt"
"net/http"
"bytes"
)
func main() {
req, err := http.NewRequest("GET", "https://api.example.com/v2/analytics/metrics?start_date=2024-01-01&end_date=2024-12-31&metrics=users,projects,storage", nil)
if err != nil {
panic(err)
}
req.Header.Set("Content-Type", "application/json")
req.Header.Set("Authorization", "Bearer YOUR_API_TOKEN")
client := &http.Client{}
resp, err := client.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
fmt.Println("Response Status:", resp.Status)
}
require 'net/http'
require 'json'
uri = URI('https://api.example.com/v2/analytics/metrics?start_date=2024-01-01&end_date=2024-12-31&metrics=users,projects,storage')
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = true
request = Net::HTTP::Get.new(uri)
request['Content-Type'] = 'application/json'
request['Authorization'] = 'Bearer YOUR_API_TOKEN'
response = http.request(request)
puts response.body
{
"period": {
"start_date": "2024-01-01",
"end_date": "2024-12-31"
},
"metrics": {
"users": {
"total": 1250,
"new_this_period": 150,
"active_this_period": 800
},
"projects": {
"total": 456,
"active": 320
},
"storage": {
"total_bytes": 1073741824,
"files_count": 2500
}
}
}
GET
/analytics/metrics
GET
Security Scheme
OAuth 2.0
OAuth 2.0 Tokenstring
RequiredOAuth 2.0 authentication flow
OAuth 2.0 authentication flow
query
start_datestring
RequiredFormat: date
query
end_datestring
RequiredFormat: date
query
metricsstring
Comma-separated list of metrics to include
Request Preview
Response
Response will appear here after sending the request
Authentication
OAuth2
header
Authorizationstring
RequiredOAuth 2.0 access token. OAuth 2.0 authentication flow
Available Flowsinfo
Supported OAuth 2.0 flows: authorizationCode
Query Parameters
metricsstring
Comma-separated list of metrics to include
Responses
periodobject
metricsobject