Recuperar análises da página do usuário
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 de análises
Recuperar análises da página do usuário
Recupera estatísticas de atividade do usuário, incluindo nomes, e-mails, horários da última atividade, dias ativos e créditos de prompt usados na página Teams.
POST
/
api
/
v1
/
UserPageAnalytics
Recuperar análises da página do usuário
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>"
}Visão geral
Requisição
Sua chave de serviço com a permissão “Teams Read-only”
Filtra os resultados para usuários em um grupo específico (opcional)
Data/hora de início no formato RFC 3339 (por exemplo,
2023-01-01T00:00:00Z). Afeta apenas o cálculo de activeDays. Se não for fornecido, o valor padrão será 1 ano atrás.Data/hora de término no formato RFC 3339 (por exemplo,
2023-12-31T23:59:59Z). Afeta apenas o cálculo de activeDays. Se não for fornecido, o valor padrão será o horário atual.Exemplo de requisição
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
Resposta
Lista de objetos com estatísticas de usuários
Mostrar Objeto de estatísticas do usuário
Mostrar Objeto de estatísticas do usuário
Nome de exibição do usuário
Endereço de e-mail do usuário
Timestamp da última atividade do usuário no formato RFC 3339
Versão com hash da Chave de API do usuário
Número de dias em que o usuário esteve ativo dentro do intervalo consultado (definido por
start_timestamp e end_timestamp). Um dia é considerado ativo se o usuário teve alguma aceitação de autocomplete, uso do Cascade ou uso de comandos nesse dia.Indica se o acesso ao Devin Desktop foi desativado para o usuário por um admin. Esse campo só estará presente se o acesso tiver sido explicitamente desativado e, nesse caso, sempre terá o valor true.
A função do usuário na equipe (por exemplo, admin, membro)
Timestamp de quando o usuário se cadastrou, no formato RFC 3339
O timestamp mais recente de uso da modalidade Tab/Autocomplete, no formato RFC 3339
O timestamp mais recente de uso da modalidade Cascade, no formato RFC 3339
O timestamp mais recente de uso da modalidade Command, no formato RFC 3339
O número total de créditos de prompt usados por este usuário durante o ciclo de faturamento atual, retornado em centavos (1 crédito = 100 centavos). Para obter o uso real de créditos, divida esse valor por 100. Esse valor não é afetado pelos parâmetros de requisição
start_timestamp ou end_timestamp. A janela do ciclo de faturamento é indicada pelos campos de nível superior billingCycleStart e billingCycleEnd.O status de associação do usuário à equipe. Valores possíveis:
USER_TEAM_STATUS_UNSPECIFIED, USER_TEAM_STATUS_PENDING, USER_TEAM_STATUS_APPROVED, USER_TEAM_STATUS_REJECTED. Observe que a API retorna todos os usuários independentemente do status na equipe, enquanto a UI Manage Members mostra apenas os usuários aprovados.Início do ciclo de faturamento atual no formato RFC 3339. Os valores de
promptCreditsUsed em userTableStats correspondem ao uso dentro deste ciclo de faturamento.Fim do ciclo de faturamento atual no formato RFC 3339. Os valores de
promptCreditsUsed em userTableStats correspondem ao uso dentro deste ciclo de faturamento.Exemplo de resposta
{
"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"
}
Respostas de erro
Mensagem de erro que descreve o problema
- Chave de serviço inválida ou permissões insuficientes
- Formato de timestamp inválido
- Grupo não encontrado
- Limite de requisições excedido
⌘I

