Salt la conținutul principal
POST
/
api
/
v1
/
UserPageAnalytics
Obținere Analytics pentru pagina utilizatorului
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>"
}

Prezentare generală

Obțineți statistici despre activitatea utilizatorilor care apar pe pagina Teams, inclusiv nume, emails, orele ultimei activități și zilele active.

Solicitare

service_key
string
obligatoriu
Cheia ta de serviciu cu permisiuni „Teams Read-only”
group_name
string
Filtrează rezultatele la utilizatorii dintr-un anumit grup (opțional)
start_timestamp
string
Ora de început în format RFC 3339 (de ex., 2023-01-01T00:00:00Z)
end_timestamp
string
Ora de sfârșit în format RFC 3339 (de ex., 2023-12-31T23:59:59Z)

Exemplu de solicitare

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ăspuns

userTableStats
array
Tablou de obiecte cu statistici despre utilizatori

Exemplu de răspuns

{
  "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ăspunsuri de eroare

error
string
Mesaj de eroare care descrie problema apărută
Situații de eroare frecvente:
  • Cheie de serviciu invalidă sau permisiuni insuficiente
  • Format invalid pentru marcajul temporal
  • Grupul nu a fost găsit
  • Limita de rată a fost depășită