Obtenir les statistiques du tableau de bord
curl --request GET \
--url http://localhost:3091/v1/api/superadmin/dashboard \
--header 'Authorization: Bearer <token>'import requests
url = "http://localhost:3091/v1/api/superadmin/dashboard"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('http://localhost:3091/v1/api/superadmin/dashboard', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3091",
CURLOPT_URL => "http://localhost:3091/v1/api/superadmin/dashboard",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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 := "http://localhost:3091/v1/api/superadmin/dashboard"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://localhost:3091/v1/api/superadmin/dashboard")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3091/v1/api/superadmin/dashboard")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"totalUsers": 123,
"activeUsers": 123,
"bannedUsers": 123,
"newUsersThisMonth": 123,
"newUsersLastMonth": 123,
"userGrowthPercent": 123,
"pendingKyc": 123,
"approvedKyc": 123,
"rejectedKyc": 123,
"kycApprovalRate": 123,
"totalReservations": 123,
"pendingReservations": 123,
"completedReservations": 123,
"cancelledReservations": 123,
"disputedReservations": 123,
"totalAnnonces": 123,
"activeAnnonces": 123,
"expiredAnnonces": 123,
"totalRevenue": 123,
"totalCommissions": 123,
"revenueThisMonth": 123,
"revenueLastMonth": 123,
"revenueGrowthPercent": 123,
"pendingWithdrawals": 123,
"totalWithdrawnAmount": 123,
"pendingWithdrawalsCount": 123,
"monthlyUsers": [
{
"year": 123,
"month": 123,
"monthName": "<string>",
"value": 123,
"count": 123
}
],
"monthlyRevenue": [
{
"year": 123,
"month": 123,
"monthName": "<string>",
"value": 123,
"count": 123
}
],
"monthlyReservations": [
{
"year": 123,
"month": 123,
"monthName": "<string>",
"value": 123,
"count": 123
}
],
"reservationsByStatus": {},
"usersByRole": {}
}{
"status": 404,
"errorCode": "RESOURCE_NOT_FOUND",
"message": "Ressource non trouvée",
"timestamp": "2023-11-07T05:31:56Z",
"path": "/v1/api/bookings/123",
"debugInfo": "<string>",
"suggestions": [
"<string>"
],
"fieldErrors": [
{
"field": "email",
"message": "must not be blank",
"rejectedValue": {}
}
]
}{
"status": 404,
"errorCode": "RESOURCE_NOT_FOUND",
"message": "Ressource non trouvée",
"timestamp": "2023-11-07T05:31:56Z",
"path": "/v1/api/bookings/123",
"debugInfo": "<string>",
"suggestions": [
"<string>"
],
"fieldErrors": [
{
"field": "email",
"message": "must not be blank",
"rejectedValue": {}
}
]
}Configuration plateforme
Récupérer les statistiques du tableau de bord
GET
/
v1
/
api
/
superadmin
/
dashboard
Obtenir les statistiques du tableau de bord
curl --request GET \
--url http://localhost:3091/v1/api/superadmin/dashboard \
--header 'Authorization: Bearer <token>'import requests
url = "http://localhost:3091/v1/api/superadmin/dashboard"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('http://localhost:3091/v1/api/superadmin/dashboard', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "3091",
CURLOPT_URL => "http://localhost:3091/v1/api/superadmin/dashboard",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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 := "http://localhost:3091/v1/api/superadmin/dashboard"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://localhost:3091/v1/api/superadmin/dashboard")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:3091/v1/api/superadmin/dashboard")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"totalUsers": 123,
"activeUsers": 123,
"bannedUsers": 123,
"newUsersThisMonth": 123,
"newUsersLastMonth": 123,
"userGrowthPercent": 123,
"pendingKyc": 123,
"approvedKyc": 123,
"rejectedKyc": 123,
"kycApprovalRate": 123,
"totalReservations": 123,
"pendingReservations": 123,
"completedReservations": 123,
"cancelledReservations": 123,
"disputedReservations": 123,
"totalAnnonces": 123,
"activeAnnonces": 123,
"expiredAnnonces": 123,
"totalRevenue": 123,
"totalCommissions": 123,
"revenueThisMonth": 123,
"revenueLastMonth": 123,
"revenueGrowthPercent": 123,
"pendingWithdrawals": 123,
"totalWithdrawnAmount": 123,
"pendingWithdrawalsCount": 123,
"monthlyUsers": [
{
"year": 123,
"month": 123,
"monthName": "<string>",
"value": 123,
"count": 123
}
],
"monthlyRevenue": [
{
"year": 123,
"month": 123,
"monthName": "<string>",
"value": 123,
"count": 123
}
],
"monthlyReservations": [
{
"year": 123,
"month": 123,
"monthName": "<string>",
"value": 123,
"count": 123
}
],
"reservationsByStatus": {},
"usersByRole": {}
}{
"status": 404,
"errorCode": "RESOURCE_NOT_FOUND",
"message": "Ressource non trouvée",
"timestamp": "2023-11-07T05:31:56Z",
"path": "/v1/api/bookings/123",
"debugInfo": "<string>",
"suggestions": [
"<string>"
],
"fieldErrors": [
{
"field": "email",
"message": "must not be blank",
"rejectedValue": {}
}
]
}{
"status": 404,
"errorCode": "RESOURCE_NOT_FOUND",
"message": "Ressource non trouvée",
"timestamp": "2023-11-07T05:31:56Z",
"path": "/v1/api/bookings/123",
"debugInfo": "<string>",
"suggestions": [
"<string>"
],
"fieldErrors": [
{
"field": "email",
"message": "must not be blank",
"rejectedValue": {}
}
]
}Authorizations
JWT access token from POST /v1/api/auth/login
Response
Statistics retrieved
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
⌘I