Obtenir les Analytics de la page Utilisateur
curl --request POST \
--url https://server.codeium.com/api/v1/UserPageAnalytics \
--header 'Content-Type: application/json' \
--data '
{
"service_key": "<string>",
"group_name": "<string>",
"start_timestamp": "<string>",
"end_timestamp": "<string>"
}
'import requests
url = "https://server.codeium.com/api/v1/UserPageAnalytics"
payload = {
"service_key": "<string>",
"group_name": "<string>",
"start_timestamp": "<string>",
"end_timestamp": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
service_key: '<string>',
group_name: '<string>',
start_timestamp: '<string>',
end_timestamp: '<string>'
})
};
fetch('https://server.codeium.com/api/v1/UserPageAnalytics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://server.codeium.com/api/v1/UserPageAnalytics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'service_key' => '<string>',
'group_name' => '<string>',
'start_timestamp' => '<string>',
'end_timestamp' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://server.codeium.com/api/v1/UserPageAnalytics"
payload := strings.NewReader("{\n \"service_key\": \"<string>\",\n \"group_name\": \"<string>\",\n \"start_timestamp\": \"<string>\",\n \"end_timestamp\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://server.codeium.com/api/v1/UserPageAnalytics")
.header("Content-Type", "application/json")
.body("{\n \"service_key\": \"<string>\",\n \"group_name\": \"<string>\",\n \"start_timestamp\": \"<string>\",\n \"end_timestamp\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://server.codeium.com/api/v1/UserPageAnalytics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"service_key\": \"<string>\",\n \"group_name\": \"<string>\",\n \"start_timestamp\": \"<string>\",\n \"end_timestamp\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"userTableStats": [
{
"name": "<string>",
"email": "<string>",
"lastUpdateTime": "<string>",
"apiKey": "<string>",
"activeDays": 123,
"disableCodeium": true,
"lastAutocompleteUsageTime": "<string>",
"lastChatUsageTime": "<string>",
"lastCommandUsageTime": "<string>",
"teamStatus": "<string>"
}
],
"error": "<string>"
}Analytics API
Obtenir les Analytics de la page Utilisateur
Récupérer les statistiques d’activité des utilisateurs, notamment les noms, adresses e-mail, dates de dernière activité et jours d’activité, à partir de la page Teams.
POST
/
api
/
v1
/
UserPageAnalytics
Obtenir les Analytics de la page Utilisateur
curl --request POST \
--url https://server.codeium.com/api/v1/UserPageAnalytics \
--header 'Content-Type: application/json' \
--data '
{
"service_key": "<string>",
"group_name": "<string>",
"start_timestamp": "<string>",
"end_timestamp": "<string>"
}
'import requests
url = "https://server.codeium.com/api/v1/UserPageAnalytics"
payload = {
"service_key": "<string>",
"group_name": "<string>",
"start_timestamp": "<string>",
"end_timestamp": "<string>"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
service_key: '<string>',
group_name: '<string>',
start_timestamp: '<string>',
end_timestamp: '<string>'
})
};
fetch('https://server.codeium.com/api/v1/UserPageAnalytics', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://server.codeium.com/api/v1/UserPageAnalytics",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'service_key' => '<string>',
'group_name' => '<string>',
'start_timestamp' => '<string>',
'end_timestamp' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://server.codeium.com/api/v1/UserPageAnalytics"
payload := strings.NewReader("{\n \"service_key\": \"<string>\",\n \"group_name\": \"<string>\",\n \"start_timestamp\": \"<string>\",\n \"end_timestamp\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://server.codeium.com/api/v1/UserPageAnalytics")
.header("Content-Type", "application/json")
.body("{\n \"service_key\": \"<string>\",\n \"group_name\": \"<string>\",\n \"start_timestamp\": \"<string>\",\n \"end_timestamp\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://server.codeium.com/api/v1/UserPageAnalytics")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"service_key\": \"<string>\",\n \"group_name\": \"<string>\",\n \"start_timestamp\": \"<string>\",\n \"end_timestamp\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"userTableStats": [
{
"name": "<string>",
"email": "<string>",
"lastUpdateTime": "<string>",
"apiKey": "<string>",
"activeDays": 123,
"disableCodeium": true,
"lastAutocompleteUsageTime": "<string>",
"lastChatUsageTime": "<string>",
"lastCommandUsageTime": "<string>",
"teamStatus": "<string>"
}
],
"error": "<string>"
}Aperçu
Requête
Votre clé de service avec l’autorisation “Teams Read-only”
Filtrer les résultats aux utilisateurs d’un groupe spécifique (facultatif)
Heure de début au format RFC 3339 (p. ex. :
2023-01-01T00:00:00Z)Heure de fin au format RFC 3339 (p. ex. :
2023-12-31T23:59:59Z)Exemple de demande
curl -X POST --header "Content-Type: application/json" \
--data '{
"service_key": "your_service_key_here",
"group_name": "engineering_team",
"start_timestamp": "2024-01-01T00:00:00Z",
"end_timestamp": "2024-12-31T23:59:59Z"
}' \
https://server.codeium.com/api/v1/UserPageAnalytics
Réponse
Tableau d’objets de statistiques utilisateur
Afficher Objet de statistiques utilisateur
Afficher Objet de statistiques utilisateur
Nom d’affichage de l’utilisateur
Adresse e-mail de l’utilisateur
Horodatage de la dernière activité de l’utilisateur au format RFC 3339
Version hachée de la clé API de l’utilisateur
Nombre total de jours pendant lesquels l’utilisateur a été actif sur la période demandée
Indique si l’accès à Windsurf a été désactivé pour l’utilisateur par un administrateur. Ce champ n’est présent que si l’accès a été explicitement désactivé, et aura alors toujours la valeur true.
Horodatage le plus récent auquel le mode Tab/Autocomplete a été utilisé, au format RFC 3339
Horodatage le plus récent auquel le mode Cascade a été utilisé, au format RFC 3339
Horodatage le plus récent auquel le mode Command a été utilisé, au format RFC 3339
Statut d’appartenance de l’utilisateur à l’équipe. Valeurs possibles :
USER_TEAM_STATUS_UNSPECIFIED, USER_TEAM_STATUS_PENDING, USER_TEAM_STATUS_APPROVED, USER_TEAM_STATUS_REJECTED. Notez que l’API renvoie tous les utilisateurs, quel que soit leur statut d’équipe, tandis que l’interface Manage Members n’affiche que les utilisateurs approuvés.Exemple de réponse
{
"userTableStats": [
{
"name": "Alice",
"email": "alice@windsurf.com",
"lastUpdateTime": "2024-10-10T22:56:10.771591Z",
"apiKey": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa",
"activeDays": 178,
"teamStatus": "USER_TEAM_STATUS_APPROVED"
},
{
"name": "Bob",
"email": "bob@windsurf.com",
"lastUpdateTime": "2024-10-10T18:11:23.980237Z",
"apiKey": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb",
"activeDays": 462,
"teamStatus": "USER_TEAM_STATUS_APPROVED"
},
{
"name": "Charlie",
"email": "charlie@windsurf.com",
"lastUpdateTime": "2024-10-10T16:43:46.117870Z",
"apiKey": "cccccccc-cccc-cccc-cccc-cccccccccccc",
"activeDays": 237,
"teamStatus": "USER_TEAM_STATUS_PENDING"
}
]
}
Réponses d’erreur
Message d’erreur décrivant ce qui s’est produit
- Clé de service invalide ou autorisations insuffisantes
- Format d’horodatage invalide
- Groupe introuvable
- Limite de débit dépassée
⌘I