Recupera le statistiche della pagina utenti
curl --request POST \
--url https://server.codeium.com/api/v1/UserPageAnalytics \
--header 'Authorization: Bearer <token>' \
--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 = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', '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 => [
"Authorization: Bearer <token>",
"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("Authorization", "Bearer <token>")
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("Authorization", "Bearer <token>")
.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["Authorization"] = 'Bearer <token>'
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,
"role": "<string>",
"signupTime": "<string>",
"lastAutocompleteUsageTime": "<string>",
"lastChatUsageTime": "<string>",
"lastCommandUsageTime": "<string>",
"promptCreditsUsed": 123,
"teamStatus": "<string>"
}
],
"billingCycleStart": "<string>",
"billingCycleEnd": "<string>",
"error": "<string>"
}API di analisi
Recupera le statistiche della pagina utenti
Recupera le statistiche di attività degli utenti, inclusi nomi, email, orari dell’ultima attività, giorni attivi e crediti prompt utilizzati nella pagina Teams.
POST
/
api
/
v1
/
UserPageAnalytics
Recupera le statistiche della pagina utenti
curl --request POST \
--url https://server.codeium.com/api/v1/UserPageAnalytics \
--header 'Authorization: Bearer <token>' \
--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 = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', '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 => [
"Authorization: Bearer <token>",
"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("Authorization", "Bearer <token>")
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("Authorization", "Bearer <token>")
.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["Authorization"] = 'Bearer <token>'
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,
"role": "<string>",
"signupTime": "<string>",
"lastAutocompleteUsageTime": "<string>",
"lastChatUsageTime": "<string>",
"lastCommandUsageTime": "<string>",
"promptCreditsUsed": 123,
"teamStatus": "<string>"
}
],
"billingCycleStart": "<string>",
"billingCycleEnd": "<string>",
"error": "<string>"
}Panoramica
Richiesta
string
obbligatorio
La tua chiave di servizio con autorizzazioni “Teams sola lettura”
string
Filtra i risultati per gli utenti di un gruppo specifico (facoltativo)
string
Timestamp iniziale nel formato RFC 3339 (ad es.
2023-01-01T00:00:00Z). Influisce solo sul calcolo di activeDays. Se non viene fornito, il valore predefinito è 1 anno fa.string
Timestamp finale nel formato RFC 3339 (ad es.
2023-12-31T23:59:59Z). Influisce solo sul calcolo di activeDays. Se non viene fornito, il valore predefinito è l’ora corrente.Esempio di richiesta
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
Risposta
array
Array di oggetti contenenti statistiche sugli utenti
Mostra Oggetto statistiche utente
Mostra Oggetto statistiche utente
string
Nome visualizzato dell’utente
string
Indirizzo email dell’utente
string
Timestamp dell’ultima attività dell’utente in formato RFC 3339
string
Versione hash dell’API key dell’utente
number
Numero di giorni in cui l’utente è stato attivo nell’intervallo di tempo richiesto (definito da
start_timestamp e end_timestamp). Un giorno viene conteggiato come attivo se in quel giorno l’utente ha avuto accettazioni di Autocomplete, utilizzo di Cascade o utilizzo di Command.boolean
Indica se un admin ha disabilitato l’accesso a Devin Desktop per l’utente. Questo campo è presente solo se l’accesso è stato disabilitato esplicitamente e, in tal caso, sarà sempre impostato su true.
string
Il ruolo dell’utente all’interno del team (ad es. admin, membro)
string
Timestamp della registrazione dell’utente, in formato RFC 3339
string
Il timestamp più recente di utilizzo della modalità Tab/Autocomplete, in formato RFC 3339
string
Il timestamp più recente di utilizzo della modalità Cascade, in formato RFC 3339
string
Il timestamp più recente di utilizzo della modalità Command, in formato RFC 3339
number
Il numero totale di credito prompt utilizzato da questo utente durante il ciclo di fatturazione corrente, restituito in centesimi (1 credito = 100 centesimi). Per ottenere il consumo effettivo di crediti, dividi questo valore per 100. Questo valore non è influenzato dai parametri della richiesta
start_timestamp o end_timestamp. L’intervallo del ciclo di fatturazione è indicato dai campi di primo livello billingCycleStart e billingCycleEnd.string
Lo stato di appartenenza dell’utente al team. Valori possibili:
USER_TEAM_STATUS_UNSPECIFIED, USER_TEAM_STATUS_PENDING, USER_TEAM_STATUS_APPROVED, USER_TEAM_STATUS_REJECTED. Tieni presente che l’API restituisce tutti gli utenti indipendentemente dal loro stato di appartenenza al team, mentre la UI Manage Members mostra solo gli utenti approvati.string
Inizio del ciclo di fatturazione corrente in formato RFC 3339. I valori
promptCreditsUsed in userTableStats corrispondono all’utilizzo in questo ciclo di fatturazione.string
Fine del ciclo di fatturazione corrente in formato RFC 3339. I valori
promptCreditsUsed in userTableStats corrispondono all’utilizzo in questo ciclo di fatturazione.Esempio di risposta
{
"userTableStats": [
{
"name": "Alice",
"email": "alice@cognition.ai",
"lastUpdateTime": "2024-10-10T22:56:10.771591Z",
"apiKey": "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa",
"activeDays": 178,
"role": "admin",
"signupTime": "2024-01-15T08:30:00Z",
"lastAutocompleteUsageTime": "2024-10-10T22:56:10Z",
"lastChatUsageTime": "2024-10-10T20:30:00Z",
"promptCreditsUsed": 12500,
"teamStatus": "USER_TEAM_STATUS_APPROVED"
},
{
"name": "Bob",
"email": "bob@cognition.ai",
"lastUpdateTime": "2024-10-10T18:11:23.980237Z",
"apiKey": "bbbbbbbb-bbbb-bbbb-bbbb-bbbbbbbbbbbb",
"activeDays": 210,
"role": "member",
"signupTime": "2024-02-01T10:00:00Z",
"lastAutocompleteUsageTime": "2024-10-10T18:11:23Z",
"lastChatUsageTime": "2024-10-09T14:22:00Z",
"lastCommandUsageTime": "2024-10-08T09:15:00Z",
"promptCreditsUsed": 8300,
"teamStatus": "USER_TEAM_STATUS_APPROVED"
}
],
"billingCycleStart": "2024-10-01T00:00:00Z",
"billingCycleEnd": "2024-11-01T00:00:00Z"
}
Risposte di errore
string
Messaggio di errore che descrive il problema
- Chiave di servizio non valida o autorizzazioni insufficienti
- Formato del timestamp non valido
- Gruppo non trovato
- Limite di richieste superato
⌘I

