Répertorier les sites web de l’utilisateur
curl --request GET \
--url https://api.athenahq.ai/api/v1/users/{user_id}/websites \
--header 'x-api-key: <api-key>'import requests
url = "https://api.athenahq.ai/api/v1/users/{user_id}/websites"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.athenahq.ai/api/v1/users/{user_id}/websites', 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://api.athenahq.ai/api/v1/users/{user_id}/websites",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.athenahq.ai/api/v1/users/{user_id}/websites"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.athenahq.ai/api/v1/users/{user_id}/websites")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.athenahq.ai/api/v1/users/{user_id}/websites")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"websites": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"website_name": "<string>",
"website_url": "<string>",
"access_type": "organization",
"role": "<string>",
"external_id": "ws_a7f3b2c9"
}
]
}{
"error": "Unauthorized"
}{
"error": "Unauthorized"
}{
"error": "Forbidden: global API key required"
}{
"error": "User not found"
}{
"error": "Unauthorized"
}Membres
Répertorier les sites web de l’utilisateur
Renvoie les sites accessibles à l’utilisateur dans votre organisation, par appartenance globale implicite ou explicite au site. L’organisation prévaut : ses membres reçoivent tous les sites non en pause avec access_type: "organization". Sinon, seuls les sites ayant une ligne website_members sont renvoyés. 404 si user_id ne correspond à aucun utilisateur AthenaHQ. 200 avec websites vide si l’utilisateur existe sans accès dans votre organisation, sans distinguer autre organisation et absence d’accès ici. Clé globale requise. Les intégrations partenaires reçoivent aussi external_id par site (null sans association), omis pour les clients directs.
GET
/
api
/
v1
/
users
/
{user_id}
/
websites
Répertorier les sites web de l’utilisateur
curl --request GET \
--url https://api.athenahq.ai/api/v1/users/{user_id}/websites \
--header 'x-api-key: <api-key>'import requests
url = "https://api.athenahq.ai/api/v1/users/{user_id}/websites"
headers = {"x-api-key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'x-api-key': '<api-key>'}};
fetch('https://api.athenahq.ai/api/v1/users/{user_id}/websites', 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://api.athenahq.ai/api/v1/users/{user_id}/websites",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"x-api-key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.athenahq.ai/api/v1/users/{user_id}/websites"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("x-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.athenahq.ai/api/v1/users/{user_id}/websites")
.header("x-api-key", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.athenahq.ai/api/v1/users/{user_id}/websites")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["x-api-key"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"websites": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"website_name": "<string>",
"website_url": "<string>",
"access_type": "organization",
"role": "<string>",
"external_id": "ws_a7f3b2c9"
}
]
}{
"error": "Unauthorized"
}{
"error": "Unauthorized"
}{
"error": "Forbidden: global API key required"
}{
"error": "User not found"
}{
"error": "Unauthorized"
}Cette page vous a-t-elle été utile ?