Skip to content

🐸 Rybbit - open-source and privacy-friendly alternative to Google Analytics that is 10x more intuitive.

Enhance API documentation by adding support for additional programming languages

Bill Yange58b93ef413f
diff --git a/docs/content/docs/api/stats/errors.mdx b/docs/content/docs/api/stats/errors.mdx
index 721cebff5..aced99ab4 100644
--- a/docs/content/docs/api/stats/errors.mdx
+++ b/docs/content/docs/api/stats/errors.mdx
@@ -111,7 +111,7 @@ Accepts all [Common Parameters](/docs/api/stats/reference#common-parameters) plu
</div>
<div className="flex flex-col gap-4">
-<Tabs items={['cURL', 'JavaScript', 'Python']}>
+<Tabs items={['cURL', 'JavaScript', 'Python', 'PHP', 'Ruby', 'Go', 'Rust', 'Java', '.NET']}>
<Tab value="cURL">
```bash title="Request"
curl -X GET "https://api.rybbit.io/api/error-names/123?start_date=2024-01-01&end_date=2024-01-31" \
@@ -148,6 +148,80 @@ response = requests.get(
)
data = response.json()
+```
+ </Tab>
+ <Tab value="PHP">
+```php title="Request"
+$ch = curl_init();
+curl_setopt($ch, CURLOPT_URL, 'https://api.rybbit.io/api/error-names/123?start_date=2024-01-01&end_date=2024-01-31');
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+curl_setopt($ch, CURLOPT_HTTPHEADER, [
+ 'Authorization: Bearer your_api_key_here'
+]);
+
+$response = curl_exec($ch);
+curl_close($ch);
+
+$data = json_decode($response, true);
+```
+ </Tab>
+ <Tab value="Ruby">
+```ruby title="Request"
+require 'net/http'
+require 'json'
+
+uri = URI('https://api.rybbit.io/api/error-names/123?start_date=2024-01-01&end_date=2024-01-31')
+req = Net::HTTP::Get.new(uri)
+req['Authorization'] = 'Bearer your_api_key_here'
+
+res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
+data = JSON.parse(res.body)
+```
+ </Tab>
+ <Tab value="Go">
+```go title="Request"
+req, _ := http.NewRequest("GET", "https://api.rybbit.io/api/error-names/123?start_date=2024-01-01&end_date=2024-01-31", nil)
+req.Header.Set("Authorization", "Bearer your_api_key_here")
+
+client := &http.Client{}
+resp, _ := client.Do(req)
+defer resp.Body.Close()
+
+var data map[string]interface{}
+json.NewDecoder(resp.Body).Decode(&data)
+```
+ </Tab>
+ <Tab value="Rust">
+```rust title="Request"
+let client = reqwest::Client::new();
+let res = client
+ .get("https://api.rybbit.io/api/error-names/123?start_date=2024-01-01&end_date=2024-01-31")
+ .header("Authorization", "Bearer your_api_key_here")
+ .send()
+ .await?;
+
+let data: serde_json::Value = res.json().await?;
+```
+ </Tab>
+ <Tab value="Java">
+```java title="Request"
+HttpClient client = HttpClient.newHttpClient();
+HttpRequest request = HttpRequest.newBuilder()
+ .uri(URI.create("https://api.rybbit.io/api/error-names/123?start_date=2024-01-01&end_date=2024-01-31"))
+ .header("Authorization", "Bearer your_api_key_here")
+ .GET()
+ .build();
+
+HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
+```
+ </Tab>
+ <Tab value=".NET">
+```csharp title="Request"
+using var client = new HttpClient();
+client.DefaultRequestHeaders.Add("Authorization", "Bearer your_api_key_here");
+
+var response = await client.GetAsync("https://api.rybbit.io/api/error-names/123?start_date=2024-01-01&end_date=2024-01-31");
+var data = await response.Content.ReadAsStringAsync();
```
</Tab>
</Tabs>
@@ -314,7 +388,7 @@ Accepts all [Common Parameters](/docs/api/stats/reference#common-parameters) plu
</div>
<div className="flex flex-col gap-4">
-<Tabs items={['cURL', 'JavaScript', 'Python']}>
+<Tabs items={['cURL', 'JavaScript', 'Python', 'PHP', 'Ruby', 'Go', 'Rust', 'Java', '.NET']}>
<Tab value="cURL">
```bash title="Request"
curl -X GET "https://api.rybbit.io/api/error-events/123?errorMessage=Cannot%20read%20property%20%27map%27%20of%20undefined&limit=10" \
@@ -351,6 +425,80 @@ response = requests.get(
)
data = response.json()
+```
+ </Tab>
+ <Tab value="PHP">
+```php title="Request"
+$ch = curl_init();
+curl_setopt($ch, CURLOPT_URL, 'https://api.rybbit.io/api/error-events/123?errorMessage=Cannot%20read%20property%20%27map%27%20of%20undefined&limit=10');
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+curl_setopt($ch, CURLOPT_HTTPHEADER, [
+ 'Authorization: Bearer your_api_key_here'
+]);
+
+$response = curl_exec($ch);
+curl_close($ch);
+
+$data = json_decode($response, true);
+```
+ </Tab>
+ <Tab value="Ruby">
+```ruby title="Request"
+require 'net/http'
+require 'json'
+
+uri = URI('https://api.rybbit.io/api/error-events/123?errorMessage=Cannot%20read%20property%20%27map%27%20of%20undefined&limit=10')
+req = Net::HTTP::Get.new(uri)
+req['Authorization'] = 'Bearer your_api_key_here'
+
+res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
+data = JSON.parse(res.body)
+```
+ </Tab>
+ <Tab value="Go">
+```go title="Request"
+req, _ := http.NewRequest("GET", "https://api.rybbit.io/api/error-events/123?errorMessage=Cannot%20read%20property%20%27map%27%20of%20undefined&limit=10", nil)
+req.Header.Set("Authorization", "Bearer your_api_key_here")
+
+client := &http.Client{}
+resp, _ := client.Do(req)
+defer resp.Body.Close()
+
+var data map[string]interface{}
+json.NewDecoder(resp.Body).Decode(&data)
+```
+ </Tab>
+ <Tab value="Rust">
+```rust title="Request"
+let client = reqwest::Client::new();
+let res = client
+ .get("https://api.rybbit.io/api/error-events/123?errorMessage=Cannot%20read%20property%20%27map%27%20of%20undefined&limit=10")
+ .header("Authorization", "Bearer your_api_key_here")
+ .send()
+ .await?;
+
+let data: serde_json::Value = res.json().await?;
+```
+ </Tab>
+ <Tab value="Java">
+```java title="Request"
+HttpClient client = HttpClient.newHttpClient();
+HttpRequest request = HttpRequest.newBuilder()
+ .uri(URI.create("https://api.rybbit.io/api/error-events/123?errorMessage=Cannot%20read%20property%20%27map%27%20of%20undefined&limit=10"))
+ .header("Authorization", "Bearer your_api_key_here")
+ .GET()
+ .build();
+
+HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
+```
+ </Tab>
+ <Tab value=".NET">
+```csharp title="Request"
+using var client = new HttpClient();
+client.DefaultRequestHeaders.Add("Authorization", "Bearer your_api_key_here");
+
+var response = await client.GetAsync("https://api.rybbit.io/api/error-events/123?errorMessage=Cannot%20read%20property%20%27map%27%20of%20undefined&limit=10");
+var data = await response.Content.ReadAsStringAsync();
```
</Tab>
</Tabs>
@@ -461,7 +609,7 @@ Accepts all [Common Parameters](/docs/api/stats/reference#common-parameters) plu
</div>
<div className="flex flex-col gap-4">
-<Tabs items={['cURL', 'JavaScript', 'Python']}>
+<Tabs items={['cURL', 'JavaScript', 'Python', 'PHP', 'Ruby', 'Go', 'Rust', 'Java', '.NET']}>
<Tab value="cURL">
```bash title="Request"
curl -X GET "https://api.rybbit.io/api/error-bucketed/123?errorMessage=Cannot%20read%20property%20%27map%27%20of%20undefined&bucket=hour&start_date=2024-01-30&end_date=2024-01-31&time_zone=UTC" \
@@ -501,6 +649,80 @@ response = requests.get(
)
data = response.json()
+```
+ </Tab>
+ <Tab value="PHP">
+```php title="Request"
+$ch = curl_init();
+curl_setopt($ch, CURLOPT_URL, 'https://api.rybbit.io/api/error-bucketed/123?errorMessage=Cannot%20read%20property%20%27map%27%20of%20undefined&bucket=hour&start_date=2024-01-30&end_date=2024-01-31&time_zone=UTC');
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+curl_setopt($ch, CURLOPT_HTTPHEADER, [
+ 'Authorization: Bearer your_api_key_here'
+]);
+
+$response = curl_exec($ch);
+curl_close($ch);
+
+$data = json_decode($response, true);
+```
+ </Tab>
+ <Tab value="Ruby">
+```ruby title="Request"
+require 'net/http'
+require 'json'
+
+uri = URI('https://api.rybbit.io/api/error-bucketed/123?errorMessage=Cannot%20read%20property%20%27map%27%20of%20undefined&bucket=hour&start_date=2024-01-30&end_date=2024-01-31&time_zone=UTC')
+req = Net::HTTP::Get.new(uri)
+req['Authorization'] = 'Bearer your_api_key_here'
+
+res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
+data = JSON.parse(res.body)
+```
+ </Tab>
+ <Tab value="Go">
+```go title="Request"
+req, _ := http.NewRequest("GET", "https://api.rybbit.io/api/error-bucketed/123?errorMessage=Cannot%20read%20property%20%27map%27%20of%20undefined&bucket=hour&start_date=2024-01-30&end_date=2024-01-31&time_zone=UTC", nil)
+req.Header.Set("Authorization", "Bearer your_api_key_here")
+
+client := &http.Client{}
+resp, _ := client.Do(req)
+defer resp.Body.Close()
+
+var data map[string]interface{}
+json.NewDecoder(resp.Body).Decode(&data)
+```
+ </Tab>
+ <Tab value="Rust">
+```rust title="Request"
+let client = reqwest::Client::new();
+let res = client
+ .get("https://api.rybbit.io/api/error-bucketed/123?errorMessage=Cannot%20read%20property%20%27map%27%20of%20undefined&bucket=hour&start_date=2024-01-30&end_date=2024-01-31&time_zone=UTC")
+ .header("Authorization", "Bearer your_api_key_here")
+ .send()
+ .await?;
+
+let data: serde_json::Value = res.json().await?;
+```
+ </Tab>
+ <Tab value="Java">
+```java title="Request"
+HttpClient client = HttpClient.newHttpClient();
+HttpRequest request = HttpRequest.newBuilder()
+ .uri(URI.create("https://api.rybbit.io/api/error-bucketed/123?errorMessage=Cannot%20read%20property%20%27map%27%20of%20undefined&bucket=hour&start_date=2024-01-30&end_date=2024-01-31&time_zone=UTC"))
+ .header("Authorization", "Bearer your_api_key_here")
+ .GET()
+ .build();
+
+HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
+```
+ </Tab>
+ <Tab value=".NET">
+```csharp title="Request"
+using var client = new HttpClient();
+client.DefaultRequestHeaders.Add("Authorization", "Bearer your_api_key_here");
+
+var response = await client.GetAsync("https://api.rybbit.io/api/error-bucketed/123?errorMessage=Cannot%20read%20property%20%27map%27%20of%20undefined&bucket=hour&start_date=2024-01-30&end_date=2024-01-31&time_zone=UTC");
+var data = await response.Content.ReadAsStringAsync();
```
</Tab>
</Tabs>
diff --git a/docs/content/docs/api/stats/events.mdx b/docs/content/docs/api/stats/events.mdx
index 917de57a9..7ab8db5fd 100644
--- a/docs/content/docs/api/stats/events.mdx
+++ b/docs/content/docs/api/stats/events.mdx
@@ -153,7 +153,7 @@ Accepts all [Common Parameters](/docs/api/stats/reference#common-parameters) plu
</div>
<div className="flex flex-col gap-4">
-<Tabs items={['cURL', 'JavaScript', 'Python']}>
+<Tabs items={['cURL', 'JavaScript', 'Python', 'PHP', 'Ruby', 'Go', 'Rust', 'Java', '.NET']}>
<Tab value="cURL">
```bash title="Request"
curl -X GET "https://api.rybbit.io/api/events/123?page=1&page_size=20&start_date=2024-01-01&end_date=2024-01-31" \
@@ -192,6 +192,80 @@ response = requests.get(
)
data = response.json()
+```
+ </Tab>
+ <Tab value="PHP">
+```php title="Request"
+$ch = curl_init();
+curl_setopt($ch, CURLOPT_URL, 'https://api.rybbit.io/api/events/123?page=1&page_size=20&start_date=2024-01-01&end_date=2024-01-31');
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+curl_setopt($ch, CURLOPT_HTTPHEADER, [
+ 'Authorization: Bearer your_api_key_here'
+]);
+
+$response = curl_exec($ch);
+curl_close($ch);
+
+$data = json_decode($response, true);
+```
+ </Tab>
+ <Tab value="Ruby">
+```ruby title="Request"
+require 'net/http'
+require 'json'
+
+uri = URI('https://api.rybbit.io/api/events/123?page=1&page_size=20&start_date=2024-01-01&end_date=2024-01-31')
+req = Net::HTTP::Get.new(uri)
+req['Authorization'] = 'Bearer your_api_key_here'
+
+res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
+data = JSON.parse(res.body)
+```
+ </Tab>
+ <Tab value="Go">
+```go title="Request"
+req, _ := http.NewRequest("GET", "https://api.rybbit.io/api/events/123?page=1&page_size=20&start_date=2024-01-01&end_date=2024-01-31", nil)
+req.Header.Set("Authorization", "Bearer your_api_key_here")
+
+client := &http.Client{}
+resp, _ := client.Do(req)
+defer resp.Body.Close()
+
+var data map[string]interface{}
+json.NewDecoder(resp.Body).Decode(&data)
+```
+ </Tab>
+ <Tab value="Rust">
+```rust title="Request"
+let client = reqwest::Client::new();
+let res = client
+ .get("https://api.rybbit.io/api/events/123?page=1&page_size=20&start_date=2024-01-01&end_date=2024-01-31")
+ .header("Authorization", "Bearer your_api_key_here")
+ .send()
+ .await?;
+
+let data: serde_json::Value = res.json().await?;
+```
+ </Tab>
+ <Tab value="Java">
+```java title="Request"
+HttpClient client = HttpClient.newHttpClient();
+HttpRequest request = HttpRequest.newBuilder()
+ .uri(URI.create("https://api.rybbit.io/api/events/123?page=1&page_size=20&start_date=2024-01-01&end_date=2024-01-31"))
+ .header("Authorization", "Bearer your_api_key_here")
+ .GET()
+ .build();
+
+HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
+```
+ </Tab>
+ <Tab value=".NET">
+```csharp title="Request"
+using var client = new HttpClient();
+client.DefaultRequestHeaders.Add("Authorization", "Bearer your_api_key_here");
+
+var response = await client.GetAsync("https://api.rybbit.io/api/events/123?page=1&page_size=20&start_date=2024-01-01&end_date=2024-01-31");
+var data = await response.Content.ReadAsStringAsync();
```
</Tab>
</Tabs>
@@ -298,7 +372,7 @@ Accepts all [Common Parameters](/docs/api/stats/reference#common-parameters) (ti
</div>
<div className="flex flex-col gap-4">
-<Tabs items={['cURL', 'JavaScript', 'Python']}>
+<Tabs items={['cURL', 'JavaScript', 'Python', 'PHP', 'Ruby', 'Go', 'Rust', 'Java', '.NET']}>
<Tab value="cURL">
```bash title="Request"
curl -X GET "https://api.rybbit.io/api/events/names/123?start_date=2024-01-01&end_date=2024-01-31" \
@@ -335,6 +409,80 @@ response = requests.get(
)
data = response.json()
+```
+ </Tab>
+ <Tab value="PHP">
+```php title="Request"
+$ch = curl_init();
+curl_setopt($ch, CURLOPT_URL, 'https://api.rybbit.io/api/events/names/123?start_date=2024-01-01&end_date=2024-01-31');
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+curl_setopt($ch, CURLOPT_HTTPHEADER, [
+ 'Authorization: Bearer your_api_key_here'
+]);
+
+$response = curl_exec($ch);
+curl_close($ch);
+
+$data = json_decode($response, true);
+```
+ </Tab>
+ <Tab value="Ruby">
+```ruby title="Request"
+require 'net/http'
+require 'json'
+
+uri = URI('https://api.rybbit.io/api/events/names/123?start_date=2024-01-01&end_date=2024-01-31')
+req = Net::HTTP::Get.new(uri)
+req['Authorization'] = 'Bearer your_api_key_here'
+
+res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
+data = JSON.parse(res.body)
+```
+ </Tab>
+ <Tab value="Go">
+```go title="Request"
+req, _ := http.NewRequest("GET", "https://api.rybbit.io/api/events/names/123?start_date=2024-01-01&end_date=2024-01-31", nil)
+req.Header.Set("Authorization", "Bearer your_api_key_here")
+
+client := &http.Client{}
+resp, _ := client.Do(req)
+defer resp.Body.Close()
+
+var data map[string]interface{}
+json.NewDecoder(resp.Body).Decode(&data)
+```
+ </Tab>
+ <Tab value="Rust">
+```rust title="Request"
+let client = reqwest::Client::new();
+let res = client
+ .get("https://api.rybbit.io/api/events/names/123?start_date=2024-01-01&end_date=2024-01-31")
+ .header("Authorization", "Bearer your_api_key_here")
+ .send()
+ .await?;
+
+let data: serde_json::Value = res.json().await?;
+```
+ </Tab>
+ <Tab value="Java">
+```java title="Request"
+HttpClient client = HttpClient.newHttpClient();
+HttpRequest request = HttpRequest.newBuilder()
+ .uri(URI.create("https://api.rybbit.io/api/events/names/123?start_date=2024-01-01&end_date=2024-01-31"))
+ .header("Authorization", "Bearer your_api_key_here")
+ .GET()
+ .build();
+
+HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
+```
+ </Tab>
+ <Tab value=".NET">
+```csharp title="Request"
+using var client = new HttpClient();
+client.DefaultRequestHeaders.Add("Authorization", "Bearer your_api_key_here");
+
+var response = await client.GetAsync("https://api.rybbit.io/api/events/names/123?start_date=2024-01-01&end_date=2024-01-31");
+var data = await response.Content.ReadAsStringAsync();
```
</Tab>
</Tabs>
@@ -437,7 +585,7 @@ Accepts all [Common Parameters](/docs/api/stats/reference#common-parameters) plu
</div>
<div className="flex flex-col gap-4">
-<Tabs items={['cURL', 'JavaScript', 'Python']}>
+<Tabs items={['cURL', 'JavaScript', 'Python', 'PHP', 'Ruby', 'Go', 'Rust', 'Java', '.NET']}>
<Tab value="cURL">
```bash title="Request"
curl -X GET "https://api.rybbit.io/api/events/properties/123?event_name=signup&start_date=2024-01-01&end_date=2024-01-31" \
@@ -475,6 +623,80 @@ response = requests.get(
)
data = response.json()
+```
+ </Tab>
+ <Tab value="PHP">
+```php title="Request"
+$ch = curl_init();
+curl_setopt($ch, CURLOPT_URL, 'https://api.rybbit.io/api/events/properties/123?event_name=signup&start_date=2024-01-01&end_date=2024-01-31');
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+curl_setopt($ch, CURLOPT_HTTPHEADER, [
+ 'Authorization: Bearer your_api_key_here'
+]);
+
+$response = curl_exec($ch);
+curl_close($ch);
+
+$data = json_decode($response, true);
+```
+ </Tab>
+ <Tab value="Ruby">
+```ruby title="Request"
+require 'net/http'
+require 'json'
+
+uri = URI('https://api.rybbit.io/api/events/properties/123?event_name=signup&start_date=2024-01-01&end_date=2024-01-31')
+req = Net::HTTP::Get.new(uri)
+req['Authorization'] = 'Bearer your_api_key_here'
+
+res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
+data = JSON.parse(res.body)
+```
+ </Tab>
+ <Tab value="Go">
+```go title="Request"
+req, _ := http.NewRequest("GET", "https://api.rybbit.io/api/events/properties/123?event_name=signup&start_date=2024-01-01&end_date=2024-01-31", nil)
+req.Header.Set("Authorization", "Bearer your_api_key_here")
+
+client := &http.Client{}
+resp, _ := client.Do(req)
+defer resp.Body.Close()
+
+var data map[string]interface{}
+json.NewDecoder(resp.Body).Decode(&data)
+```
+ </Tab>
+ <Tab value="Rust">
+```rust title="Request"
+let client = reqwest::Client::new();
+let res = client
+ .get("https://api.rybbit.io/api/events/properties/123?event_name=signup&start_date=2024-01-01&end_date=2024-01-31")
+ .header("Authorization", "Bearer your_api_key_here")
+ .send()
+ .await?;
+
+let data: serde_json::Value = res.json().await?;
+```
+ </Tab>
+ <Tab value="Java">
+```java title="Request"
+HttpClient client = HttpClient.newHttpClient();
+HttpRequest request = HttpRequest.newBuilder()
+ .uri(URI.create("https://api.rybbit.io/api/events/properties/123?event_name=signup&start_date=2024-01-01&end_date=2024-01-31"))
+ .header("Authorization", "Bearer your_api_key_here")
+ .GET()
+ .build();
+
+HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
+```
+ </Tab>
+ <Tab value=".NET">
+```csharp title="Request"
+using var client = new HttpClient();
+client.DefaultRequestHeaders.Add("Authorization", "Bearer your_api_key_here");
+
+var response = await client.GetAsync("https://api.rybbit.io/api/events/properties/123?event_name=signup&start_date=2024-01-01&end_date=2024-01-31");
+var data = await response.Content.ReadAsStringAsync();
```
</Tab>
</Tabs>
@@ -577,7 +799,7 @@ Accepts all [Common Parameters](/docs/api/stats/reference#common-parameters) (ti
</div>
<div className="flex flex-col gap-4">
-<Tabs items={['cURL', 'JavaScript', 'Python']}>
+<Tabs items={['cURL', 'JavaScript', 'Python', 'PHP', 'Ruby', 'Go', 'Rust', 'Java', '.NET']}>
<Tab value="cURL">
```bash title="Request"
curl -X GET "https://api.rybbit.io/api/events/outbound/123?start_date=2024-01-01&end_date=2024-01-31" \
@@ -614,6 +836,80 @@ response = requests.get(
)
data = response.json()
+```
+ </Tab>
+ <Tab value="PHP">
+```php title="Request"
+$ch = curl_init();
+curl_setopt($ch, CURLOPT_URL, 'https://api.rybbit.io/api/events/outbound/123?start_date=2024-01-01&end_date=2024-01-31');
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+curl_setopt($ch, CURLOPT_HTTPHEADER, [
+ 'Authorization: Bearer your_api_key_here'
+]);
+
+$response = curl_exec($ch);
+curl_close($ch);
+
+$data = json_decode($response, true);
+```
+ </Tab>
+ <Tab value="Ruby">
+```ruby title="Request"
+require 'net/http'
+require 'json'
+
+uri = URI('https://api.rybbit.io/api/events/outbound/123?start_date=2024-01-01&end_date=2024-01-31')
+req = Net::HTTP::Get.new(uri)
+req['Authorization'] = 'Bearer your_api_key_here'
+
+res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
+data = JSON.parse(res.body)
+```
+ </Tab>
+ <Tab value="Go">
+```go title="Request"
+req, _ := http.NewRequest("GET", "https://api.rybbit.io/api/events/outbound/123?start_date=2024-01-01&end_date=2024-01-31", nil)
+req.Header.Set("Authorization", "Bearer your_api_key_here")
+
+client := &http.Client{}
+resp, _ := client.Do(req)
+defer resp.Body.Close()
+
+var data map[string]interface{}
+json.NewDecoder(resp.Body).Decode(&data)
+```
+ </Tab>
+ <Tab value="Rust">
+```rust title="Request"
+let client = reqwest::Client::new();
+let res = client
+ .get("https://api.rybbit.io/api/events/outbound/123?start_date=2024-01-01&end_date=2024-01-31")
+ .header("Authorization", "Bearer your_api_key_here")
+ .send()
+ .await?;
+
+let data: serde_json::Value = res.json().await?;
+```
+ </Tab>
+ <Tab value="Java">
+```java title="Request"
+HttpClient client = HttpClient.newHttpClient();
+HttpRequest request = HttpRequest.newBuilder()
+ .uri(URI.create("https://api.rybbit.io/api/events/outbound/123?start_date=2024-01-01&end_date=2024-01-31"))
+ .header("Authorization", "Bearer your_api_key_here")
+ .GET()
+ .build();
+
+HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
+```
+ </Tab>
+ <Tab value=".NET">
+```csharp title="Request"
+using var client = new HttpClient();
+client.DefaultRequestHeaders.Add("Authorization", "Bearer your_api_key_here");
+
+var response = await client.GetAsync("https://api.rybbit.io/api/events/outbound/123?start_date=2024-01-01&end_date=2024-01-31");
+var data = await response.Content.ReadAsStringAsync();
```
</Tab>
</Tabs>
diff --git a/docs/content/docs/api/stats/funnels.mdx b/docs/content/docs/api/stats/funnels.mdx
index a77702b3d..25b47a1d4 100644
--- a/docs/content/docs/api/stats/funnels.mdx
+++ b/docs/content/docs/api/stats/funnels.mdx
@@ -102,7 +102,7 @@ Returns all saved funnels for a site.
</div>
<div className="flex flex-col gap-4">
-<Tabs items={['cURL', 'JavaScript', 'Python']}>
+<Tabs items={['cURL', 'JavaScript', 'Python', 'PHP', 'Ruby', 'Go', 'Rust', 'Java', '.NET']}>
<Tab value="cURL">
```bash title="Request"
curl -X GET "https://api.rybbit.io/api/funnels/123" \
@@ -135,6 +135,113 @@ response = requests.get(
)
data = response.json()
+```
+ </Tab>
+ <Tab value="PHP">
+```php title="Request"
+$ch = curl_init();
+curl_setopt($ch, CURLOPT_URL, 'https://api.rybbit.io/api/funnels/123');
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+curl_setopt($ch, CURLOPT_HTTPHEADER, [
+ 'Authorization: Bearer your_api_key_here'
+]);
+
+$response = curl_exec($ch);
+curl_close($ch);
+
+$data = json_decode($response, true);
+```
+ </Tab>
+ <Tab value="Ruby">
+```ruby title="Request"
+require 'net/http'
+require 'json'
+
+uri = URI('https://api.rybbit.io/api/funnels/123')
+request = Net::HTTP::Get.new(uri)
+request['Authorization'] = 'Bearer your_api_key_here'
+
+response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
+ http.request(request)
+end
+
+data = JSON.parse(response.body)
+```
+ </Tab>
+ <Tab value="Go">
+```go title="Request"
+package main
+
+import (
+ "encoding/json"
+ "io"
+ "net/http"
+)
+
+func main() {
+ client := &http.Client{}
+ req, _ := http.NewRequest("GET", "https://api.rybbit.io/api/funnels/123", nil)
+ req.Header.Set("Authorization", "Bearer your_api_key_here")
+
+ resp, _ := client.Do(req)
+ defer resp.Body.Close()
+
+ body, _ := io.ReadAll(resp.Body)
+ var data map[string]interface{}
+ json.Unmarshal(body, &data)
+}
+```
+ </Tab>
+ <Tab value="Rust">
+```rust title="Request"
+use reqwest;
+use serde_json::Value;
+
+#[tokio::main]
+async fn main() -> Result<(), Box<dyn std::error::Error>> {
+ let client = reqwest::Client::new();
+ let response = client
+ .get("https://api.rybbit.io/api/funnels/123")
+ .header("Authorization", "Bearer your_api_key_here")
+ .send()
+ .await?;
+
+ let data: Value = response.json().await?;
+ Ok(())
+}
+```
+ </Tab>
+ <Tab value="Java">
+```java title="Request"
+import java.net.URI;
+import java.net.http.HttpClient;
+import java.net.http.HttpRequest;
+import java.net.http.HttpResponse;
+
+HttpClient client = HttpClient.newHttpClient();
+HttpRequest request = HttpRequest.newBuilder()
+ .uri(URI.create("https://api.rybbit.io/api/funnels/123"))
+ .header("Authorization", "Bearer your_api_key_here")
+ .GET()
+ .build();
+
+HttpResponse<String> response = client.send(request,
+ HttpResponse.BodyHandlers.ofString());
+String data = response.body();
+```
+ </Tab>
+ <Tab value=".NET">
+```csharp title="Request"
+using System.Net.Http;
+using System.Net.Http.Headers;
+
+var client = new HttpClient();
+client.DefaultRequestHeaders.Authorization =
+ new AuthenticationHeaderValue("Bearer", "your_api_key_here");
+
+var response = await client.GetAsync(
+ "https://api.rybbit.io/api/funnels/123");
+var data = await response.Content.ReadAsStringAsync();
```
</Tab>
</Tabs>
@@ -283,7 +390,7 @@ Accepts all [Common Parameters](/docs/api/stats/reference#common-parameters) (ti
</div>
<div className="flex flex-col gap-4">
-<Tabs items={['cURL', 'JavaScript', 'Python']}>
+<Tabs items={['cURL', 'JavaScript', 'Python', 'PHP', 'Ruby', 'Go', 'Rust', 'Java', '.NET']}>
<Tab value="cURL">
```bash title="Request"
curl -X POST "https://api.rybbit.io/api/funnels/analyze/123?start_date=2024-01-01&end_date=2024-01-31" \
@@ -347,6 +454,188 @@ response = requests.post(
)
data = response.json()
+```
+ </Tab>
+ <Tab value="PHP">
+```php title="Request"
+$body = [
+ 'steps' => [
+ ['type' => 'page', 'value' => '/', 'name' => 'Homepage'],
+ ['type' => 'page', 'value' => '/pricing', 'name' => 'Pricing'],
+ ['type' => 'page', 'value' => '/signup', 'name' => 'Signup'],
+ ['type' => 'event', 'value' => 'signup_complete', 'name' => 'Complete']
+ ]
+];
+
+$ch = curl_init();
+curl_setopt($ch, CURLOPT_URL, 'https://api.rybbit.io/api/funnels/analyze/123?start_date=2024-01-01&end_date=2024-01-31');
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+curl_setopt($ch, CURLOPT_POST, true);
+curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($body));
+curl_setopt($ch, CURLOPT_HTTPHEADER, [
+ 'Authorization: Bearer your_api_key_here',
+ 'Content-Type: application/json'
+]);
+
+$response = curl_exec($ch);
+curl_close($ch);
+
+$data = json_decode($response, true);
+```
+ </Tab>
+ <Tab value="Ruby">
+```ruby title="Request"
+require 'net/http'
+require 'json'
+
+uri = URI('https://api.rybbit.io/api/funnels/analyze/123?start_date=2024-01-01&end_date=2024-01-31')
+request = Net::HTTP::Post.new(uri)
+request['Authorization'] = 'Bearer your_api_key_here'
+request['Content-Type'] = 'application/json'
+request.body = {
+ steps: [
+ { type: 'page', value: '/', name: 'Homepage' },
+ { type: 'page', value: '/pricing', name: 'Pricing' },
+ { type: 'page', value: '/signup', name: 'Signup' },
+ { type: 'event', value: 'signup_complete', name: 'Complete' }
+ ]
+}.to_json
+
+response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
+ http.request(request)
+end
+
+data = JSON.parse(response.body)
+```
+ </Tab>
+ <Tab value="Go">
+```go title="Request"
+package main
+
+import (
+ "bytes"
+ "encoding/json"
+ "io"
+ "net/http"
+)
+
+func main() {
+ body := map[string]interface{}{
+ "steps": []map[string]string{
+ {"type": "page", "value": "/", "name": "Homepage"},
+ {"type": "page", "value": "/pricing", "name": "Pricing"},
+ {"type": "page", "value": "/signup", "name": "Signup"},
+ {"type": "event", "value": "signup_complete", "name": "Complete"},
+ },
+ }
+ jsonBody, _ := json.Marshal(body)
+
+ client := &http.Client{}
+ req, _ := http.NewRequest("POST", "https://api.rybbit.io/api/funnels/analyze/123?start_date=2024-01-01&end_date=2024-01-31", bytes.NewBuffer(jsonBody))
+ req.Header.Set("Authorization", "Bearer your_api_key_here")
+ req.Header.Set("Content-Type", "application/json")
+
+ resp, _ := client.Do(req)
+ defer resp.Body.Close()
+
+ respBody, _ := io.ReadAll(resp.Body)
+ var data map[string]interface{}
+ json.Unmarshal(respBody, &data)
+}
+```
+ </Tab>
+ <Tab value="Rust">
+```rust title="Request"
+use reqwest;
+use serde_json::{json, Value};
+
+#[tokio::main]
+async fn main() -> Result<(), Box<dyn std::error::Error>> {
+ let body = json!({
+ "steps": [
+ {"type": "page", "value": "/", "name": "Homepage"},
+ {"type": "page", "value": "/pricing", "name": "Pricing"},
+ {"type": "page", "value": "/signup", "name": "Signup"},
+ {"type": "event", "value": "signup_complete", "name": "Complete"}
+ ]
+ });
+
+ let client = reqwest::Client::new();
+ let response = client
+ .post("https://api.rybbit.io/api/funnels/analyze/123?start_date=2024-01-01&end_date=2024-01-31")
+ .header("Authorization", "Bearer your_api_key_here")
+ .header("Content-Type", "application/json")
+ .json(&body)
+ .send()
+ .await?;
+
+ let data: Value = response.json().await?;
+ Ok(())
+}
+```
+ </Tab>
+ <Tab value="Java">
+```java title="Request"
+import java.net.URI;
+import java.net.http.HttpClient;
+import java.net.http.HttpRequest;
+import java.net.http.HttpResponse;
+
+String json = """
+{
+ "steps": [
+ {"type": "page", "value": "/", "name": "Homepage"},
+ {"type": "page", "value": "/pricing", "name": "Pricing"},
+ {"type": "page", "value": "/signup", "name": "Signup"},
+ {"type": "event", "value": "signup_complete", "name": "Complete"}
+ ]
+}
+""";
+
+HttpClient client = HttpClient.newHttpClient();
+HttpRequest request = HttpRequest.newBuilder()
+ .uri(URI.create("https://api.rybbit.io/api/funnels/analyze/123?start_date=2024-01-01&end_date=2024-01-31"))
+ .header("Authorization", "Bearer your_api_key_here")
+ .header("Content-Type", "application/json")
+ .POST(HttpRequest.BodyPublishers.ofString(json))
+ .build();
+
+HttpResponse<String> response = client.send(request,
+ HttpResponse.BodyHandlers.ofString());
+String data = response.body();
+```
+ </Tab>
+ <Tab value=".NET">
+```csharp title="Request"
+using System.Net.Http;
+using System.Net.Http.Headers;
+using System.Text;
+using System.Text.Json;
+
+var body = new
+{
+ steps = new[]
+ {
+ new { type = "page", value = "/", name = "Homepage" },
+ new { type = "page", value = "/pricing", name = "Pricing" },
+ new { type = "page", value = "/signup", name = "Signup" },
+ new { type = "event", value = "signup_complete", name = "Complete" }
+ }
+};
+
+var client = new HttpClient();
+client.DefaultRequestHeaders.Authorization =
+ new AuthenticationHeaderValue("Bearer", "your_api_key_here");
+
+var content = new StringContent(
+ JsonSerializer.Serialize(body),
+ Encoding.UTF8,
+ "application/json");
+
+var response = await client.PostAsync(
+ "https://api.rybbit.io/api/funnels/analyze/123?start_date=2024-01-01&end_date=2024-01-31",
+ content);
+var data = await response.Content.ReadAsStringAsync();
```
</Tab>
</Tabs>
@@ -470,7 +759,7 @@ Accepts all [Common Parameters](/docs/api/stats/reference#common-parameters) plu
</div>
<div className="flex flex-col gap-4">
-<Tabs items={['cURL', 'JavaScript', 'Python']}>
+<Tabs items={['cURL', 'JavaScript', 'Python', 'PHP', 'Ruby', 'Go', 'Rust', 'Java', '.NET']}>
<Tab value="cURL">
```bash title="Get sessions that dropped off at step 2"
curl -X POST "https://api.rybbit.io/api/funnels/2/sessions/123?mode=dropped&page=1" \
@@ -531,6 +820,149 @@ response = requests.post(
)
data = response.json()
+```
+ </Tab>
+ <Tab value="PHP">
+```php title="Request"
+$body = [
+ 'steps' => [
+ ['type' => 'page', 'value' => '/', 'name' => 'Homepage'],
+ ['type' => 'page', 'value' => '/pricing', 'name' => 'Pricing'],
+ ['type' => 'page', 'value' => '/signup', 'name' => 'Signup']
+ ]
+];
+
+$ch = curl_init();
+curl_setopt($ch, CURLOPT_URL, 'https://api.rybbit.io/api/funnels/2/sessions/123?mode=dropped&page=1');
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+curl_setopt($ch, CURLOPT_POST, true);
+curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($body));
+curl_setopt($ch, CURLOPT_HTTPHEADER, [
+ 'Authorization: Bearer your_api_key_here',
+ 'Content-Type: application/json'
+]);
+
+$response = curl_exec($ch);
+curl_close($ch);
+
+$data = json_decode($response, true);
+```
+ </Tab>
+ <Tab value="Ruby">
+```ruby title="Request"
+require 'net/http'
+require 'json'
+
+uri = URI('https://api.rybbit.io/api/funnels/2/sessions/123?mode=dropped&page=1')
+request = Net::HTTP::Post.new(uri)
+request['Authorization'] = 'Bearer your_api_key_here'
+request['Content-Type'] = 'application/json'
+request.body = {
+ steps: [
+ { type: 'page', value: '/', name: 'Homepage' },
+ { type: 'page', value: '/pricing', name: 'Pricing' },
+ { type: 'page', value: '/signup', name: 'Signup' }
+ ]
+}.to_json
+
+response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
+ http.request(request)
+end
+
+data = JSON.parse(response.body)
+```
+ </Tab>
+ <Tab value="Go">
+```go title="Request"
+body := map[string]interface{}{
+ "steps": []map[string]string{
+ {"type": "page", "value": "/", "name": "Homepage"},
+ {"type": "page", "value": "/pricing", "name": "Pricing"},
+ {"type": "page", "value": "/signup", "name": "Signup"},
+ },
+}
+jsonBody, _ := json.Marshal(body)
+
+req, _ := http.NewRequest("POST", "https://api.rybbit.io/api/funnels/2/sessions/123?mode=dropped&page=1", bytes.NewBuffer(jsonBody))
+req.Header.Set("Authorization", "Bearer your_api_key_here")
+req.Header.Set("Content-Type", "application/json")
+
+client := &http.Client{}
+resp, _ := client.Do(req)
+defer resp.Body.Close()
+
+var data map[string]interface{}
+json.NewDecoder(resp.Body).Decode(&data)
+```
+ </Tab>
+ <Tab value="Rust">
+```rust title="Request"
+let body = serde_json::json!({
+ "steps": [
+ {"type": "page", "value": "/", "name": "Homepage"},
+ {"type": "page", "value": "/pricing", "name": "Pricing"},
+ {"type": "page", "value": "/signup", "name": "Signup"}
+ ]
+});
+
+let client = reqwest::Client::new();
+let res = client
+ .post("https://api.rybbit.io/api/funnels/2/sessions/123?mode=dropped&page=1")
+ .header("Authorization", "Bearer your_api_key_here")
+ .json(&body)
+ .send()
+ .await?;
+
+let data: serde_json::Value = res.json().await?;
+```
+ </Tab>
+ <Tab value="Java">
+```java title="Request"
+String json = """
+{
+ "steps": [
+ {"type": "page", "value": "/", "name": "Homepage"},
+ {"type": "page", "value": "/pricing", "name": "Pricing"},
+ {"type": "page", "value": "/signup", "name": "Signup"}
+ ]
+}
+""";
+
+HttpClient client = HttpClient.newHttpClient();
+HttpRequest request = HttpRequest.newBuilder()
+ .uri(URI.create("https://api.rybbit.io/api/funnels/2/sessions/123?mode=dropped&page=1"))
+ .header("Authorization", "Bearer your_api_key_here")
+ .header("Content-Type", "application/json")
+ .POST(HttpRequest.BodyPublishers.ofString(json))
+ .build();
+
+HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
+```
+ </Tab>
+ <Tab value=".NET">
+```csharp title="Request"
+var body = new
+{
+ steps = new[]
+ {
+ new { type = "page", value = "/", name = "Homepage" },
+ new { type = "page", value = "/pricing", name = "Pricing" },
+ new { type = "page", value = "/signup", name = "Signup" }
+ }
+};
+
+using var client = new HttpClient();
+client.DefaultRequestHeaders.Add("Authorization", "Bearer your_api_key_here");
+
+var content = new StringContent(
+ JsonSerializer.Serialize(body),
+ Encoding.UTF8,
+ "application/json");
+
+var response = await client.PostAsync(
+ "https://api.rybbit.io/api/funnels/2/sessions/123?mode=dropped&page=1",
+ content);
+var data = await response.Content.ReadAsStringAsync();
```
</Tab>
</Tabs>
@@ -626,7 +1058,7 @@ Creates or updates a saved funnel. If `reportId` is provided, updates the existi
</div>
<div className="flex flex-col gap-4">
-<Tabs items={['cURL', 'JavaScript', 'Python']}>
+<Tabs items={['cURL', 'JavaScript', 'Python', 'PHP', 'Ruby', 'Go', 'Rust', 'Java', '.NET']}>
<Tab value="cURL">
```bash title="Create New Funnel"
curl -X POST "https://api.rybbit.io/api/funnels/123" \
@@ -690,6 +1122,159 @@ response = requests.post(
)
data = response.json()
+```
+ </Tab>
+ <Tab value="PHP">
+```php title="Request"
+$body = [
+ 'name' => 'Checkout Funnel',
+ 'steps' => [
+ ['type' => 'page', 'value' => '/products/*', 'name' => 'Product Page'],
+ ['type' => 'page', 'value' => '/cart', 'name' => 'Cart'],
+ ['type' => 'page', 'value' => '/checkout', 'name' => 'Checkout'],
+ ['type' => 'event', 'value' => 'purchase', 'name' => 'Purchase']
+ ]
+];
+
+$ch = curl_init();
+curl_setopt($ch, CURLOPT_URL, 'https://api.rybbit.io/api/funnels/123');
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+curl_setopt($ch, CURLOPT_POST, true);
+curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($body));
+curl_setopt($ch, CURLOPT_HTTPHEADER, [
+ 'Authorization: Bearer your_api_key_here',
+ 'Content-Type: application/json'
+]);
+
+$response = curl_exec($ch);
+curl_close($ch);
+
+$data = json_decode($response, true);
+```
+ </Tab>
+ <Tab value="Ruby">
+```ruby title="Request"
+require 'net/http'
+require 'json'
+
+uri = URI('https://api.rybbit.io/api/funnels/123')
+request = Net::HTTP::Post.new(uri)
+request['Authorization'] = 'Bearer your_api_key_here'
+request['Content-Type'] = 'application/json'
+request.body = {
+ name: 'Checkout Funnel',
+ steps: [
+ { type: 'page', value: '/products/*', name: 'Product Page' },
+ { type: 'page', value: '/cart', name: 'Cart' },
+ { type: 'page', value: '/checkout', name: 'Checkout' },
+ { type: 'event', value: 'purchase', name: 'Purchase' }
+ ]
+}.to_json
+
+response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
+ http.request(request)
+end
+
+data = JSON.parse(response.body)
+```
+ </Tab>
+ <Tab value="Go">
+```go title="Request"
+body := map[string]interface{}{
+ "name": "Checkout Funnel",
+ "steps": []map[string]string{
+ {"type": "page", "value": "/products/*", "name": "Product Page"},
+ {"type": "page", "value": "/cart", "name": "Cart"},
+ {"type": "page", "value": "/checkout", "name": "Checkout"},
+ {"type": "event", "value": "purchase", "name": "Purchase"},
+ },
+}
+jsonBody, _ := json.Marshal(body)
+
+req, _ := http.NewRequest("POST", "https://api.rybbit.io/api/funnels/123", bytes.NewBuffer(jsonBody))
+req.Header.Set("Authorization", "Bearer your_api_key_here")
+req.Header.Set("Content-Type", "application/json")
+
+client := &http.Client{}
+resp, _ := client.Do(req)
+defer resp.Body.Close()
+
+var data map[string]interface{}
+json.NewDecoder(resp.Body).Decode(&data)
+```
+ </Tab>
+ <Tab value="Rust">
+```rust title="Request"
+let body = serde_json::json!({
+ "name": "Checkout Funnel",
+ "steps": [
+ {"type": "page", "value": "/products/*", "name": "Product Page"},
+ {"type": "page", "value": "/cart", "name": "Cart"},
+ {"type": "page", "value": "/checkout", "name": "Checkout"},
+ {"type": "event", "value": "purchase", "name": "Purchase"}
+ ]
+});
+
+let client = reqwest::Client::new();
+let res = client
+ .post("https://api.rybbit.io/api/funnels/123")
+ .header("Authorization", "Bearer your_api_key_here")
+ .json(&body)
+ .send()
+ .await?;
+
+let data: serde_json::Value = res.json().await?;
+```
+ </Tab>
+ <Tab value="Java">
+```java title="Request"
+String json = """
+{
+ "name": "Checkout Funnel",
+ "steps": [
+ {"type": "page", "value": "/products/*", "name": "Product Page"},
+ {"type": "page", "value": "/cart", "name": "Cart"},
+ {"type": "page", "value": "/checkout", "name": "Checkout"},
+ {"type": "event", "value": "purchase", "name": "Purchase"}
+ ]
+}
+""";
+
+HttpClient client = HttpClient.newHttpClient();
+HttpRequest request = HttpRequest.newBuilder()
+ .uri(URI.create("https://api.rybbit.io/api/funnels/123"))
+ .header("Authorization", "Bearer your_api_key_here")
+ .header("Content-Type", "application/json")
+ .POST(HttpRequest.BodyPublishers.ofString(json))
+ .build();
+
+HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
+```
+ </Tab>
+ <Tab value=".NET">
+```csharp title="Request"
+var body = new
+{
+ name = "Checkout Funnel",
+ steps = new[]
+ {
+ new { type = "page", value = "/products/*", name = "Product Page" },
+ new { type = "page", value = "/cart", name = "Cart" },
+ new { type = "page", value = "/checkout", name = "Checkout" },
+ new { type = "event", value = "purchase", name = "Purchase" }
+ }
+};
+
+using var client = new HttpClient();
+client.DefaultRequestHeaders.Add("Authorization", "Bearer your_api_key_here");
+
+var content = new StringContent(
+ JsonSerializer.Serialize(body),
+ Encoding.UTF8,
+ "application/json");
+
+var response = await client.PostAsync("https://api.rybbit.io/api/funnels/123", content);
+var data = await response.Content.ReadAsStringAsync();
```
</Tab>
</Tabs>
@@ -748,7 +1333,7 @@ Deletes a saved funnel. This action cannot be undone.
</div>
<div className="flex flex-col gap-4">
-<Tabs items={['cURL', 'JavaScript', 'Python']}>
+<Tabs items={['cURL', 'JavaScript', 'Python', 'PHP', 'Ruby', 'Go', 'Rust', 'Java', '.NET']}>
<Tab value="cURL">
```bash title="Request"
curl -X DELETE "https://api.rybbit.io/api/funnels/1/123" \
@@ -782,6 +1367,84 @@ response = requests.delete(
)
data = response.json()
+```
+ </Tab>
+ <Tab value="PHP">
+```php title="Request"
+$ch = curl_init();
+curl_setopt($ch, CURLOPT_URL, 'https://api.rybbit.io/api/funnels/1/123');
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
+curl_setopt($ch, CURLOPT_HTTPHEADER, [
+ 'Authorization: Bearer your_api_key_here'
+]);
+
+$response = curl_exec($ch);
+curl_close($ch);
+
+$data = json_decode($response, true);
+```
+ </Tab>
+ <Tab value="Ruby">
+```ruby title="Request"
+require 'net/http'
+require 'json'
+
+uri = URI('https://api.rybbit.io/api/funnels/1/123')
+request = Net::HTTP::Delete.new(uri)
+request['Authorization'] = 'Bearer your_api_key_here'
+
+response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
+ http.request(request)
+end
+
+data = JSON.parse(response.body)
+```
+ </Tab>
+ <Tab value="Go">
+```go title="Request"
+req, _ := http.NewRequest("DELETE", "https://api.rybbit.io/api/funnels/1/123", nil)
+req.Header.Set("Authorization", "Bearer your_api_key_here")
+
+client := &http.Client{}
+resp, _ := client.Do(req)
+defer resp.Body.Close()
+
+var data map[string]interface{}
+json.NewDecoder(resp.Body).Decode(&data)
+```
+ </Tab>
+ <Tab value="Rust">
+```rust title="Request"
+let client = reqwest::Client::new();
+let res = client
+ .delete("https://api.rybbit.io/api/funnels/1/123")
+ .header("Authorization", "Bearer your_api_key_here")
+ .send()
+ .await?;
+
+let data: serde_json::Value = res.json().await?;
+```
+ </Tab>
+ <Tab value="Java">
+```java title="Request"
+HttpClient client = HttpClient.newHttpClient();
+HttpRequest request = HttpRequest.newBuilder()
+ .uri(URI.create("https://api.rybbit.io/api/funnels/1/123"))
+ .header("Authorization", "Bearer your_api_key_here")
+ .DELETE()
+ .build();
+
+HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
+```
+ </Tab>
+ <Tab value=".NET">
+```csharp title="Request"
+using var client = new HttpClient();
+client.DefaultRequestHeaders.Add("Authorization", "Bearer your_api_key_here");
+
+var response = await client.DeleteAsync("https://api.rybbit.io/api/funnels/1/123");
+var data = await response.Content.ReadAsStringAsync();
```
</Tab>
</Tabs>
diff --git a/docs/content/docs/api/stats/goals.mdx b/docs/content/docs/api/stats/goals.mdx
index 64c50243c..0c159b989 100644
--- a/docs/content/docs/api/stats/goals.mdx
+++ b/docs/content/docs/api/stats/goals.mdx
@@ -176,7 +176,7 @@ Accepts all [Common Parameters](/docs/api/stats/reference#common-parameters) plu
</div>
<div className="flex flex-col gap-4">
-<Tabs items={['cURL', 'JavaScript', 'Python']}>
+<Tabs items={['cURL', 'JavaScript', 'Python', 'PHP', 'Ruby', 'Go', 'Rust', 'Java', '.NET']}>
<Tab value="cURL">
```bash title="Request"
curl -X GET "https://api.rybbit.io/api/goals/123?start_date=2024-01-01&end_date=2024-01-31" \
@@ -213,6 +213,136 @@ response = requests.get(
)
data = response.json()
+```
+ </Tab>
+ <Tab value="PHP">
+```php title="Request"
+<?php
+$ch = curl_init();
+
+curl_setopt($ch, CURLOPT_URL, 'https://api.rybbit.io/api/goals/123?start_date=2024-01-01&end_date=2024-01-31');
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+curl_setopt($ch, CURLOPT_HTTPHEADER, [
+ 'Authorization: Bearer your_api_key_here'
+]);
+
+$response = curl_exec($ch);
+curl_close($ch);
+
+$data = json_decode($response, true);
+?>
+```
+ </Tab>
+ <Tab value="Ruby">
+```ruby title="Request"
+require 'net/http'
+require 'json'
+require 'uri'
+
+uri = URI('https://api.rybbit.io/api/goals/123?start_date=2024-01-01&end_date=2024-01-31')
+req = Net::HTTP::Get.new(uri)
+req['Authorization'] = 'Bearer your_api_key_here'
+
+res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
+ http.request(req)
+end
+
+data = JSON.parse(res.body)
+```
+ </Tab>
+ <Tab value="Go">
+```go title="Request"
+package main
+
+import (
+ "encoding/json"
+ "io"
+ "net/http"
+)
+
+func main() {
+ url := "https://api.rybbit.io/api/goals/123?start_date=2024-01-01&end_date=2024-01-31"
+
+ req, _ := http.NewRequest("GET", url, nil)
+ req.Header.Add("Authorization", "Bearer your_api_key_here")
+
+ client := &http.Client{}
+ resp, _ := client.Do(req)
+ defer resp.Body.Close()
+
+ body, _ := io.ReadAll(resp.Body)
+
+ var data map[string]interface{}
+ json.Unmarshal(body, &data)
+}
+```
+ </Tab>
+ <Tab value="Rust">
+```rust title="Request"
+use reqwest;
+use serde_json::Value;
+
+#[tokio::main]
+async fn main() -> Result<(), Box<dyn std::error::Error>> {
+ let client = reqwest::Client::new();
+
+ let response = client
+ .get("https://api.rybbit.io/api/goals/123?start_date=2024-01-01&end_date=2024-01-31")
+ .header("Authorization", "Bearer your_api_key_here")
+ .send()
+ .await?;
+
+ let data: Value = response.json().await?;
+
+ Ok(())
+}
+```
+ </Tab>
+ <Tab value="Java">
+```java title="Request"
+import java.net.URI;
+import java.net.http.HttpClient;
+import java.net.http.HttpRequest;
+import java.net.http.HttpResponse;
+
+public class Main {
+ public static void main(String[] args) throws Exception {
+ HttpClient client = HttpClient.newHttpClient();
+
+ HttpRequest request = HttpRequest.newBuilder()
+ .uri(URI.create("https://api.rybbit.io/api/goals/123?start_date=2024-01-01&end_date=2024-01-31"))
+ .header("Authorization", "Bearer your_api_key_here")
+ .GET()
+ .build();
+
+ HttpResponse<String> response = client.send(request,
+ HttpResponse.BodyHandlers.ofString());
+
+ String data = response.body();
+ }
+}
+```
+ </Tab>
+ <Tab value=".NET">
+```csharp title="Request"
+using System;
+using System.Net.Http;
+using System.Threading.Tasks;
+
+class Program
+{
+ static async Task Main(string[] args)
+ {
+ using var client = new HttpClient();
+
+ client.DefaultRequestHeaders.Add("Authorization", "Bearer your_api_key_here");
+
+ var response = await client.GetAsync(
+ "https://api.rybbit.io/api/goals/123?start_date=2024-01-01&end_date=2024-01-31");
+
+ var data = await response.Content.ReadAsStringAsync();
+ }
+}
```
</Tab>
</Tabs>
@@ -379,7 +509,7 @@ Accepts all [Common Parameters](/docs/api/stats/reference#common-parameters) plu
</div>
<div className="flex flex-col gap-4">
-<Tabs items={['cURL', 'JavaScript', 'Python']}>
+<Tabs items={['cURL', 'JavaScript', 'Python', 'PHP', 'Ruby', 'Go', 'Rust', 'Java', '.NET']}>
<Tab value="cURL">
```bash title="Request"
curl -X GET "https://api.rybbit.io/api/goals/1/sessions/123?page=1&limit=10" \
@@ -416,6 +546,136 @@ response = requests.get(
)
data = response.json()
+```
+ </Tab>
+ <Tab value="PHP">
+```php title="Request"
+<?php
+$ch = curl_init();
+
+curl_setopt($ch, CURLOPT_URL, 'https://api.rybbit.io/api/goals/1/sessions/123?page=1&limit=10');
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+curl_setopt($ch, CURLOPT_HTTPHEADER, [
+ 'Authorization: Bearer your_api_key_here'
+]);
+
+$response = curl_exec($ch);
+curl_close($ch);
+
+$data = json_decode($response, true);
+?>
+```
+ </Tab>
+ <Tab value="Ruby">
+```ruby title="Request"
+require 'net/http'
+require 'json'
+require 'uri'
+
+uri = URI('https://api.rybbit.io/api/goals/1/sessions/123?page=1&limit=10')
+req = Net::HTTP::Get.new(uri)
+req['Authorization'] = 'Bearer your_api_key_here'
+
+res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
+ http.request(req)
+end
+
+data = JSON.parse(res.body)
+```
+ </Tab>
+ <Tab value="Go">
+```go title="Request"
+package main
+
+import (
+ "encoding/json"
+ "io"
+ "net/http"
+)
+
+func main() {
+ url := "https://api.rybbit.io/api/goals/1/sessions/123?page=1&limit=10"
+
+ req, _ := http.NewRequest("GET", url, nil)
+ req.Header.Add("Authorization", "Bearer your_api_key_here")
+
+ client := &http.Client{}
+ resp, _ := client.Do(req)
+ defer resp.Body.Close()
+
+ body, _ := io.ReadAll(resp.Body)
+
+ var data map[string]interface{}
+ json.Unmarshal(body, &data)
+}
+```
+ </Tab>
+ <Tab value="Rust">
+```rust title="Request"
+use reqwest;
+use serde_json::Value;
+
+#[tokio::main]
+async fn main() -> Result<(), Box<dyn std::error::Error>> {
+ let client = reqwest::Client::new();
+
+ let response = client
+ .get("https://api.rybbit.io/api/goals/1/sessions/123?page=1&limit=10")
+ .header("Authorization", "Bearer your_api_key_here")
+ .send()
+ .await?;
+
+ let data: Value = response.json().await?;
+
+ Ok(())
+}
+```
+ </Tab>
+ <Tab value="Java">
+```java title="Request"
+import java.net.URI;
+import java.net.http.HttpClient;
+import java.net.http.HttpRequest;
+import java.net.http.HttpResponse;
+
+public class Main {
+ public static void main(String[] args) throws Exception {
+ HttpClient client = HttpClient.newHttpClient();
+
+ HttpRequest request = HttpRequest.newBuilder()
+ .uri(URI.create("https://api.rybbit.io/api/goals/1/sessions/123?page=1&limit=10"))
+ .header("Authorization", "Bearer your_api_key_here")
+ .GET()
+ .build();
+
+ HttpResponse<String> response = client.send(request,
+ HttpResponse.BodyHandlers.ofString());
+
+ String data = response.body();
+ }
+}
+```
+ </Tab>
+ <Tab value=".NET">
+```csharp title="Request"
+using System;
+using System.Net.Http;
+using System.Threading.Tasks;
+
+class Program
+{
+ static async Task Main(string[] args)
+ {
+ using var client = new HttpClient();
+
+ client.DefaultRequestHeaders.Add("Authorization", "Bearer your_api_key_here");
+
+ var response = await client.GetAsync(
+ "https://api.rybbit.io/api/goals/1/sessions/123?page=1&limit=10");
+
+ var data = await response.Content.ReadAsStringAsync();
+ }
+}
```
</Tab>
</Tabs>
@@ -547,7 +807,7 @@ Creates a new goal for tracking conversions.
</div>
<div className="flex flex-col gap-4">
-<Tabs items={['cURL', 'JavaScript', 'Python']}>
+<Tabs items={['cURL', 'JavaScript', 'Python', 'PHP', 'Ruby', 'Go', 'Rust', 'Java', '.NET']}>
<Tab value="cURL">
```bash title="Path Goal"
curl -X POST "https://api.rybbit.io/api/goals/123" \
@@ -606,6 +866,142 @@ response = requests.post(
)
data = response.json()
+```
+ </Tab>
+ <Tab value="PHP">
+```php title="Request"
+$body = [
+ 'name' => 'Checkout Complete',
+ 'goalType' => 'path',
+ 'config' => [
+ 'pathPattern' => '/checkout/success'
+ ]
+];
+
+$ch = curl_init();
+curl_setopt($ch, CURLOPT_URL, 'https://api.rybbit.io/api/goals/123');
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+curl_setopt($ch, CURLOPT_POST, true);
+curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($body));
+curl_setopt($ch, CURLOPT_HTTPHEADER, [
+ 'Authorization: Bearer your_api_key_here',
+ 'Content-Type: application/json'
+]);
+
+$response = curl_exec($ch);
+curl_close($ch);
+
+$data = json_decode($response, true);
+```
+ </Tab>
+ <Tab value="Ruby">
+```ruby title="Request"
+require 'net/http'
+require 'json'
+
+uri = URI('https://api.rybbit.io/api/goals/123')
+request = Net::HTTP::Post.new(uri)
+request['Authorization'] = 'Bearer your_api_key_here'
+request['Content-Type'] = 'application/json'
+request.body = {
+ name: 'Checkout Complete',
+ goalType: 'path',
+ config: { pathPattern: '/checkout/success' }
+}.to_json
+
+response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
+ http.request(request)
+end
+
+data = JSON.parse(response.body)
+```
+ </Tab>
+ <Tab value="Go">
+```go title="Request"
+body := map[string]interface{}{
+ "name": "Checkout Complete",
+ "goalType": "path",
+ "config": map[string]string{
+ "pathPattern": "/checkout/success",
+ },
+}
+jsonBody, _ := json.Marshal(body)
+
+req, _ := http.NewRequest("POST", "https://api.rybbit.io/api/goals/123", bytes.NewBuffer(jsonBody))
+req.Header.Set("Authorization", "Bearer your_api_key_here")
+req.Header.Set("Content-Type", "application/json")
+
+client := &http.Client{}
+resp, _ := client.Do(req)
+defer resp.Body.Close()
+
+var data map[string]interface{}
+json.NewDecoder(resp.Body).Decode(&data)
+```
+ </Tab>
+ <Tab value="Rust">
+```rust title="Request"
+let body = serde_json::json!({
+ "name": "Checkout Complete",
+ "goalType": "path",
+ "config": {
+ "pathPattern": "/checkout/success"
+ }
+});
+
+let client = reqwest::Client::new();
+let res = client
+ .post("https://api.rybbit.io/api/goals/123")
+ .header("Authorization", "Bearer your_api_key_here")
+ .json(&body)
+ .send()
+ .await?;
+
+let data: serde_json::Value = res.json().await?;
+```
+ </Tab>
+ <Tab value="Java">
+```java title="Request"
+String json = """
+{
+ "name": "Checkout Complete",
+ "goalType": "path",
+ "config": {
+ "pathPattern": "/checkout/success"
+ }
+}
+""";
+
+HttpClient client = HttpClient.newHttpClient();
+HttpRequest request = HttpRequest.newBuilder()
+ .uri(URI.create("https://api.rybbit.io/api/goals/123"))
+ .header("Authorization", "Bearer your_api_key_here")
+ .header("Content-Type", "application/json")
+ .POST(HttpRequest.BodyPublishers.ofString(json))
+ .build();
+
+HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
+```
+ </Tab>
+ <Tab value=".NET">
+```csharp title="Request"
+var body = new
+{
+ name = "Checkout Complete",
+ goalType = "path",
+ config = new { pathPattern = "/checkout/success" }
+};
+
+using var client = new HttpClient();
+client.DefaultRequestHeaders.Add("Authorization", "Bearer your_api_key_here");
+
+var content = new StringContent(
+ JsonSerializer.Serialize(body),
+ Encoding.UTF8,
+ "application/json");
+
+var response = await client.PostAsync("https://api.rybbit.io/api/goals/123", content);
+var data = await response.Content.ReadAsStringAsync();
```
</Tab>
</Tabs>
@@ -691,7 +1087,7 @@ Updates an existing goal.
</div>
<div className="flex flex-col gap-4">
-<Tabs items={['cURL', 'JavaScript', 'Python']}>
+<Tabs items={['cURL', 'JavaScript', 'Python', 'PHP', 'Ruby', 'Go', 'Rust', 'Java', '.NET']}>
<Tab value="cURL">
```bash title="Request"
curl -X PUT "https://api.rybbit.io/api/goals/1/123" \
@@ -748,6 +1144,142 @@ response = requests.put(
)
data = response.json()
+```
+ </Tab>
+ <Tab value="PHP">
+```php title="Request"
+$body = [
+ 'name' => 'Signup Completed (Updated)',
+ 'goalType' => 'path',
+ 'config' => [
+ 'pathPattern' => '/signup/complete/*'
+ ]
+];
+
+$ch = curl_init();
+curl_setopt($ch, CURLOPT_URL, 'https://api.rybbit.io/api/goals/1/123');
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
+curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($body));
+curl_setopt($ch, CURLOPT_HTTPHEADER, [
+ 'Authorization: Bearer your_api_key_here',
+ 'Content-Type: application/json'
+]);
+
+$response = curl_exec($ch);
+curl_close($ch);
+
+$data = json_decode($response, true);
+```
+ </Tab>
+ <Tab value="Ruby">
+```ruby title="Request"
+require 'net/http'
+require 'json'
+
+uri = URI('https://api.rybbit.io/api/goals/1/123')
+request = Net::HTTP::Put.new(uri)
+request['Authorization'] = 'Bearer your_api_key_here'
+request['Content-Type'] = 'application/json'
+request.body = {
+ name: 'Signup Completed (Updated)',
+ goalType: 'path',
+ config: { pathPattern: '/signup/complete/*' }
+}.to_json
+
+response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
+ http.request(request)
+end
+
+data = JSON.parse(response.body)
+```
+ </Tab>
+ <Tab value="Go">
+```go title="Request"
+body := map[string]interface{}{
+ "name": "Signup Completed (Updated)",
+ "goalType": "path",
+ "config": map[string]string{
+ "pathPattern": "/signup/complete/*",
+ },
+}
+jsonBody, _ := json.Marshal(body)
+
+req, _ := http.NewRequest("PUT", "https://api.rybbit.io/api/goals/1/123", bytes.NewBuffer(jsonBody))
+req.Header.Set("Authorization", "Bearer your_api_key_here")
+req.Header.Set("Content-Type", "application/json")
+
+client := &http.Client{}
+resp, _ := client.Do(req)
+defer resp.Body.Close()
+
+var data map[string]interface{}
+json.NewDecoder(resp.Body).Decode(&data)
+```
+ </Tab>
+ <Tab value="Rust">
+```rust title="Request"
+let body = serde_json::json!({
+ "name": "Signup Completed (Updated)",
+ "goalType": "path",
+ "config": {
+ "pathPattern": "/signup/complete/*"
+ }
+});
+
+let client = reqwest::Client::new();
+let res = client
+ .put("https://api.rybbit.io/api/goals/1/123")
+ .header("Authorization", "Bearer your_api_key_here")
+ .json(&body)
+ .send()
+ .await?;
+
+let data: serde_json::Value = res.json().await?;
+```
+ </Tab>
+ <Tab value="Java">
+```java title="Request"
+String json = """
+{
+ "name": "Signup Completed (Updated)",
+ "goalType": "path",
+ "config": {
+ "pathPattern": "/signup/complete/*"
+ }
+}
+""";
+
+HttpClient client = HttpClient.newHttpClient();
+HttpRequest request = HttpRequest.newBuilder()
+ .uri(URI.create("https://api.rybbit.io/api/goals/1/123"))
+ .header("Authorization", "Bearer your_api_key_here")
+ .header("Content-Type", "application/json")
+ .PUT(HttpRequest.BodyPublishers.ofString(json))
+ .build();
+
+HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
+```
+ </Tab>
+ <Tab value=".NET">
+```csharp title="Request"
+var body = new
+{
+ name = "Signup Completed (Updated)",
+ goalType = "path",
+ config = new { pathPattern = "/signup/complete/*" }
+};
+
+using var client = new HttpClient();
+client.DefaultRequestHeaders.Add("Authorization", "Bearer your_api_key_here");
+
+var content = new StringContent(
+ JsonSerializer.Serialize(body),
+ Encoding.UTF8,
+ "application/json");
+
+var response = await client.PutAsync("https://api.rybbit.io/api/goals/1/123", content);
+var data = await response.Content.ReadAsStringAsync();
```
</Tab>
</Tabs>
@@ -806,7 +1338,7 @@ Deletes a goal. This action cannot be undone.
</div>
<div className="flex flex-col gap-4">
-<Tabs items={['cURL', 'JavaScript', 'Python']}>
+<Tabs items={['cURL', 'JavaScript', 'Python', 'PHP', 'Ruby', 'Go', 'Rust', 'Java', '.NET']}>
<Tab value="cURL">
```bash title="Request"
curl -X DELETE "https://api.rybbit.io/api/goals/1/123" \
@@ -840,6 +1372,84 @@ response = requests.delete(
)
data = response.json()
+```
+ </Tab>
+ <Tab value="PHP">
+```php title="Request"
+$ch = curl_init();
+curl_setopt($ch, CURLOPT_URL, 'https://api.rybbit.io/api/goals/1/123');
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
+curl_setopt($ch, CURLOPT_HTTPHEADER, [
+ 'Authorization: Bearer your_api_key_here'
+]);
+
+$response = curl_exec($ch);
+curl_close($ch);
+
+$data = json_decode($response, true);
+```
+ </Tab>
+ <Tab value="Ruby">
+```ruby title="Request"
+require 'net/http'
+require 'json'
+
+uri = URI('https://api.rybbit.io/api/goals/1/123')
+request = Net::HTTP::Delete.new(uri)
+request['Authorization'] = 'Bearer your_api_key_here'
+
+response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) do |http|
+ http.request(request)
+end
+
+data = JSON.parse(response.body)
+```
+ </Tab>
+ <Tab value="Go">
+```go title="Request"
+req, _ := http.NewRequest("DELETE", "https://api.rybbit.io/api/goals/1/123", nil)
+req.Header.Set("Authorization", "Bearer your_api_key_here")
+
+client := &http.Client{}
+resp, _ := client.Do(req)
+defer resp.Body.Close()
+
+var data map[string]interface{}
+json.NewDecoder(resp.Body).Decode(&data)
+```
+ </Tab>
+ <Tab value="Rust">
+```rust title="Request"
+let client = reqwest::Client::new();
+let res = client
+ .delete("https://api.rybbit.io/api/goals/1/123")
+ .header("Authorization", "Bearer your_api_key_here")
+ .send()
+ .await?;
+
+let data: serde_json::Value = res.json().await?;
+```
+ </Tab>
+ <Tab value="Java">
+```java title="Request"
+HttpClient client = HttpClient.newHttpClient();
+HttpRequest request = HttpRequest.newBuilder()
+ .uri(URI.create("https://api.rybbit.io/api/goals/1/123"))
+ .header("Authorization", "Bearer your_api_key_here")
+ .DELETE()
+ .build();
+
+HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
+```
+ </Tab>
+ <Tab value=".NET">
+```csharp title="Request"
+using var client = new HttpClient();
+client.DefaultRequestHeaders.Add("Authorization", "Bearer your_api_key_here");
+
+var response = await client.DeleteAsync("https://api.rybbit.io/api/goals/1/123");
+var data = await response.Content.ReadAsStringAsync();
```
</Tab>
</Tabs>
diff --git a/docs/content/docs/api/stats/misc.mdx b/docs/content/docs/api/stats/misc.mdx
index 7dbf5ef89..88f49efcd 100644
--- a/docs/content/docs/api/stats/misc.mdx
+++ b/docs/content/docs/api/stats/misc.mdx
@@ -119,7 +119,7 @@ Returns cohort-based retention analysis data. Users are grouped into cohorts bas
</div>
<div className="flex flex-col gap-4">
-<Tabs items={['cURL', 'JavaScript', 'Python']}>
+<Tabs items={['cURL', 'JavaScript', 'Python', 'PHP', 'Ruby', 'Go', 'Rust', 'Java', '.NET']}>
<Tab value="cURL">
```bash title="Request"
curl -X GET "https://api.rybbit.io/api/retention/123?mode=week&range=90" \
@@ -156,6 +156,80 @@ response = requests.get(
)
data = response.json()
+```
+ </Tab>
+ <Tab value="PHP">
+```php title="Request"
+$ch = curl_init();
+curl_setopt($ch, CURLOPT_URL, 'https://api.rybbit.io/api/retention/123?mode=week&range=90');
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+curl_setopt($ch, CURLOPT_HTTPHEADER, [
+ 'Authorization: Bearer your_api_key_here'
+]);
+
+$response = curl_exec($ch);
+curl_close($ch);
+
+$data = json_decode($response, true);
+```
+ </Tab>
+ <Tab value="Ruby">
+```ruby title="Request"
+require 'net/http'
+require 'json'
+
+uri = URI('https://api.rybbit.io/api/retention/123?mode=week&range=90')
+req = Net::HTTP::Get.new(uri)
+req['Authorization'] = 'Bearer your_api_key_here'
+
+res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
+data = JSON.parse(res.body)
+```
+ </Tab>
+ <Tab value="Go">
+```go title="Request"
+req, _ := http.NewRequest("GET", "https://api.rybbit.io/api/retention/123?mode=week&range=90", nil)
+req.Header.Set("Authorization", "Bearer your_api_key_here")
+
+client := &http.Client{}
+resp, _ := client.Do(req)
+defer resp.Body.Close()
+
+var data map[string]interface{}
+json.NewDecoder(resp.Body).Decode(&data)
+```
+ </Tab>
+ <Tab value="Rust">
+```rust title="Request"
+let client = reqwest::Client::new();
+let res = client
+ .get("https://api.rybbit.io/api/retention/123?mode=week&range=90")
+ .header("Authorization", "Bearer your_api_key_here")
+ .send()
+ .await?;
+
+let data: serde_json::Value = res.json().await?;
+```
+ </Tab>
+ <Tab value="Java">
+```java title="Request"
+HttpClient client = HttpClient.newHttpClient();
+HttpRequest request = HttpRequest.newBuilder()
+ .uri(URI.create("https://api.rybbit.io/api/retention/123?mode=week&range=90"))
+ .header("Authorization", "Bearer your_api_key_here")
+ .GET()
+ .build();
+
+HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
+```
+ </Tab>
+ <Tab value=".NET">
+```csharp title="Request"
+using var client = new HttpClient();
+client.DefaultRequestHeaders.Add("Authorization", "Bearer your_api_key_here");
+
+var response = await client.GetAsync("https://api.rybbit.io/api/retention/123?mode=week&range=90");
+var data = await response.Content.ReadAsStringAsync();
```
</Tab>
</Tabs>
@@ -310,7 +384,7 @@ Accepts all [Common Parameters](/docs/api/stats/reference#common-parameters) plu
</div>
<div className="flex flex-col gap-4">
-<Tabs items={['cURL', 'JavaScript', 'Python']}>
+<Tabs items={['cURL', 'JavaScript', 'Python', 'PHP', 'Ruby', 'Go', 'Rust', 'Java', '.NET']}>
<Tab value="cURL">
```bash title="Request"
curl -X GET "https://api.rybbit.io/api/journeys/123?steps=4&limit=20&start_date=2024-01-01&end_date=2024-01-31" \
@@ -349,6 +423,80 @@ response = requests.get(
)
data = response.json()
+```
+ </Tab>
+ <Tab value="PHP">
+```php title="Request"
+$ch = curl_init();
+curl_setopt($ch, CURLOPT_URL, 'https://api.rybbit.io/api/journeys/123?steps=4&limit=20&start_date=2024-01-01&end_date=2024-01-31');
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+curl_setopt($ch, CURLOPT_HTTPHEADER, [
+ 'Authorization: Bearer your_api_key_here'
+]);
+
+$response = curl_exec($ch);
+curl_close($ch);
+
+$data = json_decode($response, true);
+```
+ </Tab>
+ <Tab value="Ruby">
+```ruby title="Request"
+require 'net/http'
+require 'json'
+
+uri = URI('https://api.rybbit.io/api/journeys/123?steps=4&limit=20&start_date=2024-01-01&end_date=2024-01-31')
+req = Net::HTTP::Get.new(uri)
+req['Authorization'] = 'Bearer your_api_key_here'
+
+res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
+data = JSON.parse(res.body)
+```
+ </Tab>
+ <Tab value="Go">
+```go title="Request"
+req, _ := http.NewRequest("GET", "https://api.rybbit.io/api/journeys/123?steps=4&limit=20&start_date=2024-01-01&end_date=2024-01-31", nil)
+req.Header.Set("Authorization", "Bearer your_api_key_here")
+
+client := &http.Client{}
+resp, _ := client.Do(req)
+defer resp.Body.Close()
+
+var data map[string]interface{}
+json.NewDecoder(resp.Body).Decode(&data)
+```
+ </Tab>
+ <Tab value="Rust">
+```rust title="Request"
+let client = reqwest::Client::new();
+let res = client
+ .get("https://api.rybbit.io/api/journeys/123?steps=4&limit=20&start_date=2024-01-01&end_date=2024-01-31")
+ .header("Authorization", "Bearer your_api_key_here")
+ .send()
+ .await?;
+
+let data: serde_json::Value = res.json().await?;
+```
+ </Tab>
+ <Tab value="Java">
+```java title="Request"
+HttpClient client = HttpClient.newHttpClient();
+HttpRequest request = HttpRequest.newBuilder()
+ .uri(URI.create("https://api.rybbit.io/api/journeys/123?steps=4&limit=20&start_date=2024-01-01&end_date=2024-01-31"))
+ .header("Authorization", "Bearer your_api_key_here")
+ .GET()
+ .build();
+
+HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
+```
+ </Tab>
+ <Tab value=".NET">
+```csharp title="Request"
+using var client = new HttpClient();
+client.DefaultRequestHeaders.Add("Authorization", "Bearer your_api_key_here");
+
+var response = await client.GetAsync("https://api.rybbit.io/api/journeys/123?steps=4&limit=20&start_date=2024-01-01&end_date=2024-01-31");
+var data = await response.Content.ReadAsStringAsync();
```
</Tab>
</Tabs>
@@ -389,7 +537,7 @@ data = response.json()
You can filter journeys that include specific pages at specific steps:
-<Tabs items={['cURL', 'JavaScript']}>
+<Tabs items={['cURL', 'JavaScript', 'Python', 'PHP', 'Ruby', 'Go', 'Rust', 'Java', '.NET']}>
<Tab value="cURL">
```bash title="Filter journeys starting from homepage"
curl -X GET "https://api.rybbit.io/api/journeys/123?steps=3&stepFilters=%7B%220%22%3A%22%2F%22%7D" \
@@ -408,6 +556,94 @@ const response = await fetch(
}
}
);
+```
+ </Tab>
+ <Tab value="Python">
+```python title="Request"
+import requests
+
+response = requests.get(
+ 'https://api.rybbit.io/api/journeys/123?steps=3&stepFilters=%7B%220%22%3A%22%2F%22%7D',
+ headers={
+ 'Authorization': 'Bearer your_api_key_here'
+ }
+)
+
+data = response.json()
+```
+ </Tab>
+ <Tab value="PHP">
+```php title="Request"
+$ch = curl_init();
+curl_setopt($ch, CURLOPT_URL, 'https://api.rybbit.io/api/journeys/123?steps=3&stepFilters=%7B%220%22%3A%22%2F%22%7D');
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+curl_setopt($ch, CURLOPT_HTTPHEADER, [
+ 'Authorization: Bearer your_api_key_here'
+]);
+
+$response = curl_exec($ch);
+curl_close($ch);
+
+$data = json_decode($response, true);
+```
+ </Tab>
+ <Tab value="Ruby">
+```ruby title="Request"
+require 'net/http'
+require 'json'
+
+uri = URI('https://api.rybbit.io/api/journeys/123?steps=3&stepFilters=%7B%220%22%3A%22%2F%22%7D')
+req = Net::HTTP::Get.new(uri)
+req['Authorization'] = 'Bearer your_api_key_here'
+
+res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
+data = JSON.parse(res.body)
+```
+ </Tab>
+ <Tab value="Go">
+```go title="Request"
+req, _ := http.NewRequest("GET", "https://api.rybbit.io/api/journeys/123?steps=3&stepFilters=%7B%220%22%3A%22%2F%22%7D", nil)
+req.Header.Set("Authorization", "Bearer your_api_key_here")
+
+client := &http.Client{}
+resp, _ := client.Do(req)
+defer resp.Body.Close()
+
+var data map[string]interface{}
+json.NewDecoder(resp.Body).Decode(&data)
+```
+ </Tab>
+ <Tab value="Rust">
+```rust title="Request"
+let client = reqwest::Client::new();
+let res = client
+ .get("https://api.rybbit.io/api/journeys/123?steps=3&stepFilters=%7B%220%22%3A%22%2F%22%7D")
+ .header("Authorization", "Bearer your_api_key_here")
+ .send()
+ .await?;
+
+let data: serde_json::Value = res.json().await?;
+```
+ </Tab>
+ <Tab value="Java">
+```java title="Request"
+HttpClient client = HttpClient.newHttpClient();
+HttpRequest request = HttpRequest.newBuilder()
+ .uri(URI.create("https://api.rybbit.io/api/journeys/123?steps=3&stepFilters=%7B%220%22%3A%22%2F%22%7D"))
+ .header("Authorization", "Bearer your_api_key_here")
+ .GET()
+ .build();
+
+HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
+```
+ </Tab>
+ <Tab value=".NET">
+```csharp title="Request"
+using var client = new HttpClient();
+client.DefaultRequestHeaders.Add("Authorization", "Bearer your_api_key_here");
+
+var response = await client.GetAsync("https://api.rybbit.io/api/journeys/123?steps=3&stepFilters=%7B%220%22%3A%22%2F%22%7D");
+var data = await response.Content.ReadAsStringAsync();
```
</Tab>
</Tabs>
diff --git a/docs/content/docs/api/stats/overview.mdx b/docs/content/docs/api/stats/overview.mdx
index 87b029799..271b2a104 100644
--- a/docs/content/docs/api/stats/overview.mdx
+++ b/docs/content/docs/api/stats/overview.mdx
@@ -94,7 +94,7 @@ Accepts all [Common Parameters](/docs/api/stats/reference#common-parameters) (ti
</div>
<div className="flex flex-col gap-4">
-<Tabs items={['cURL', 'JavaScript', 'Python']}>
+<Tabs items={['cURL', 'JavaScript', 'Python', 'PHP', 'Ruby', 'Go', 'Rust', 'Java', '.NET']}>
<Tab value="cURL">
```bash title="Request"
curl -X GET "https://api.rybbit.io/api/overview/123?start_date=2024-01-01&end_date=2024-01-31&time_zone=America/New_York" \
@@ -132,6 +132,80 @@ response = requests.get(
)
data = response.json()
+```
+ </Tab>
+ <Tab value="PHP">
+```php title="Request"
+$ch = curl_init();
+curl_setopt($ch, CURLOPT_URL, 'https://api.rybbit.io/api/overview/123?start_date=2024-01-01&end_date=2024-01-31&time_zone=America/New_York');
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+curl_setopt($ch, CURLOPT_HTTPHEADER, [
+ 'Authorization: Bearer your_api_key_here'
+]);
+
+$response = curl_exec($ch);
+curl_close($ch);
+
+$data = json_decode($response, true);
+```
+ </Tab>
+ <Tab value="Ruby">
+```ruby title="Request"
+require 'net/http'
+require 'json'
+
+uri = URI('https://api.rybbit.io/api/overview/123?start_date=2024-01-01&end_date=2024-01-31&time_zone=America/New_York')
+req = Net::HTTP::Get.new(uri)
+req['Authorization'] = 'Bearer your_api_key_here'
+
+res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
+data = JSON.parse(res.body)
+```
+ </Tab>
+ <Tab value="Go">
+```go title="Request"
+req, _ := http.NewRequest("GET", "https://api.rybbit.io/api/overview/123?start_date=2024-01-01&end_date=2024-01-31&time_zone=America/New_York", nil)
+req.Header.Set("Authorization", "Bearer your_api_key_here")
+
+client := &http.Client{}
+resp, _ := client.Do(req)
+defer resp.Body.Close()
+
+var data map[string]interface{}
+json.NewDecoder(resp.Body).Decode(&data)
+```
+ </Tab>
+ <Tab value="Rust">
+```rust title="Request"
+let client = reqwest::Client::new();
+let res = client
+ .get("https://api.rybbit.io/api/overview/123?start_date=2024-01-01&end_date=2024-01-31&time_zone=America/New_York")
+ .header("Authorization", "Bearer your_api_key_here")
+ .send()
+ .await?;
+
+let data: serde_json::Value = res.json().await?;
+```
+ </Tab>
+ <Tab value="Java">
+```java title="Request"
+HttpClient client = HttpClient.newHttpClient();
+HttpRequest request = HttpRequest.newBuilder()
+ .uri(URI.create("https://api.rybbit.io/api/overview/123?start_date=2024-01-01&end_date=2024-01-31&time_zone=America/New_York"))
+ .header("Authorization", "Bearer your_api_key_here")
+ .GET()
+ .build();
+
+HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
+```
+ </Tab>
+ <Tab value=".NET">
+```csharp title="Request"
+using var client = new HttpClient();
+client.DefaultRequestHeaders.Add("Authorization", "Bearer your_api_key_here");
+
+var response = await client.GetAsync("https://api.rybbit.io/api/overview/123?start_date=2024-01-01&end_date=2024-01-31&time_zone=America/New_York");
+var data = await response.Content.ReadAsStringAsync();
```
</Tab>
</Tabs>
@@ -243,7 +317,7 @@ Accepts all [Common Parameters](/docs/api/stats/reference#common-parameters) plu
</div>
<div className="flex flex-col gap-4">
-<Tabs items={['cURL', 'JavaScript', 'Python']}>
+<Tabs items={['cURL', 'JavaScript', 'Python', 'PHP', 'Ruby', 'Go', 'Rust', 'Java', '.NET']}>
<Tab value="cURL">
```bash title="Request"
curl -X GET "https://api.rybbit.io/api/overview-bucketed/123?bucket=day&start_date=2024-01-01&end_date=2024-01-07&time_zone=America/New_York" \
@@ -282,6 +356,80 @@ response = requests.get(
)
data = response.json()
+```
+ </Tab>
+ <Tab value="PHP">
+```php title="Request"
+$ch = curl_init();
+curl_setopt($ch, CURLOPT_URL, 'https://api.rybbit.io/api/overview-bucketed/123?bucket=day&start_date=2024-01-01&end_date=2024-01-07&time_zone=America/New_York');
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+curl_setopt($ch, CURLOPT_HTTPHEADER, [
+ 'Authorization: Bearer your_api_key_here'
+]);
+
+$response = curl_exec($ch);
+curl_close($ch);
+
+$data = json_decode($response, true);
+```
+ </Tab>
+ <Tab value="Ruby">
+```ruby title="Request"
+require 'net/http'
+require 'json'
+
+uri = URI('https://api.rybbit.io/api/overview-bucketed/123?bucket=day&start_date=2024-01-01&end_date=2024-01-07&time_zone=America/New_York')
+req = Net::HTTP::Get.new(uri)
+req['Authorization'] = 'Bearer your_api_key_here'
+
+res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
+data = JSON.parse(res.body)
+```
+ </Tab>
+ <Tab value="Go">
+```go title="Request"
+req, _ := http.NewRequest("GET", "https://api.rybbit.io/api/overview-bucketed/123?bucket=day&start_date=2024-01-01&end_date=2024-01-07&time_zone=America/New_York", nil)
+req.Header.Set("Authorization", "Bearer your_api_key_here")
+
+client := &http.Client{}
+resp, _ := client.Do(req)
+defer resp.Body.Close()
+
+var data map[string]interface{}
+json.NewDecoder(resp.Body).Decode(&data)
+```
+ </Tab>
+ <Tab value="Rust">
+```rust title="Request"
+let client = reqwest::Client::new();
+let res = client
+ .get("https://api.rybbit.io/api/overview-bucketed/123?bucket=day&start_date=2024-01-01&end_date=2024-01-07&time_zone=America/New_York")
+ .header("Authorization", "Bearer your_api_key_here")
+ .send()
+ .await?;
+
+let data: serde_json::Value = res.json().await?;
+```
+ </Tab>
+ <Tab value="Java">
+```java title="Request"
+HttpClient client = HttpClient.newHttpClient();
+HttpRequest request = HttpRequest.newBuilder()
+ .uri(URI.create("https://api.rybbit.io/api/overview-bucketed/123?bucket=day&start_date=2024-01-01&end_date=2024-01-07&time_zone=America/New_York"))
+ .header("Authorization", "Bearer your_api_key_here")
+ .GET()
+ .build();
+
+HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
+```
+ </Tab>
+ <Tab value=".NET">
+```csharp title="Request"
+using var client = new HttpClient();
+client.DefaultRequestHeaders.Add("Authorization", "Bearer your_api_key_here");
+
+var response = await client.GetAsync("https://api.rybbit.io/api/overview-bucketed/123?bucket=day&start_date=2024-01-01&end_date=2024-01-07&time_zone=America/New_York");
+var data = await response.Content.ReadAsStringAsync();
```
</Tab>
</Tabs>
@@ -424,7 +572,7 @@ Accepts all [Common Parameters](/docs/api/stats/reference#common-parameters) plu
</div>
<div className="flex flex-col gap-4">
-<Tabs items={['cURL', 'JavaScript', 'Python']}>
+<Tabs items={['cURL', 'JavaScript', 'Python', 'PHP', 'Ruby', 'Go', 'Rust', 'Java', '.NET']}>
<Tab value="cURL">
```bash title="Request"
curl -X GET "https://api.rybbit.io/api/metric/123?parameter=country&start_date=2024-01-01&end_date=2024-01-31&time_zone=America/New_York&limit=10" \
@@ -464,6 +612,80 @@ response = requests.get(
)
data = response.json()
+```
+ </Tab>
+ <Tab value="PHP">
+```php title="Request"
+$ch = curl_init();
+curl_setopt($ch, CURLOPT_URL, 'https://api.rybbit.io/api/metric/123?parameter=country&start_date=2024-01-01&end_date=2024-01-31&time_zone=America/New_York&limit=10');
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+curl_setopt($ch, CURLOPT_HTTPHEADER, [
+ 'Authorization: Bearer your_api_key_here'
+]);
+
+$response = curl_exec($ch);
+curl_close($ch);
+
+$data = json_decode($response, true);
+```
+ </Tab>
+ <Tab value="Ruby">
+```ruby title="Request"
+require 'net/http'
+require 'json'
+
+uri = URI('https://api.rybbit.io/api/metric/123?parameter=country&start_date=2024-01-01&end_date=2024-01-31&time_zone=America/New_York&limit=10')
+req = Net::HTTP::Get.new(uri)
+req['Authorization'] = 'Bearer your_api_key_here'
+
+res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
+data = JSON.parse(res.body)
+```
+ </Tab>
+ <Tab value="Go">
+```go title="Request"
+req, _ := http.NewRequest("GET", "https://api.rybbit.io/api/metric/123?parameter=country&start_date=2024-01-01&end_date=2024-01-31&time_zone=America/New_York&limit=10", nil)
+req.Header.Set("Authorization", "Bearer your_api_key_here")
+
+client := &http.Client{}
+resp, _ := client.Do(req)
+defer resp.Body.Close()
+
+var data map[string]interface{}
+json.NewDecoder(resp.Body).Decode(&data)
+```
+ </Tab>
+ <Tab value="Rust">
+```rust title="Request"
+let client = reqwest::Client::new();
+let res = client
+ .get("https://api.rybbit.io/api/metric/123?parameter=country&start_date=2024-01-01&end_date=2024-01-31&time_zone=America/New_York&limit=10")
+ .header("Authorization", "Bearer your_api_key_here")
+ .send()
+ .await?;
+
+let data: serde_json::Value = res.json().await?;
+```
+ </Tab>
+ <Tab value="Java">
+```java title="Request"
+HttpClient client = HttpClient.newHttpClient();
+HttpRequest request = HttpRequest.newBuilder()
+ .uri(URI.create("https://api.rybbit.io/api/metric/123?parameter=country&start_date=2024-01-01&end_date=2024-01-31&time_zone=America/New_York&limit=10"))
+ .header("Authorization", "Bearer your_api_key_here")
+ .GET()
+ .build();
+
+HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
+```
+ </Tab>
+ <Tab value=".NET">
+```csharp title="Request"
+using var client = new HttpClient();
+client.DefaultRequestHeaders.Add("Authorization", "Bearer your_api_key_here");
+
+var response = await client.GetAsync("https://api.rybbit.io/api/metric/123?parameter=country&start_date=2024-01-01&end_date=2024-01-31&time_zone=America/New_York&limit=10");
+var data = await response.Content.ReadAsStringAsync();
```
</Tab>
</Tabs>
@@ -558,7 +780,7 @@ Returns the count of unique active sessions within the specified time window. Us
</div>
<div className="flex flex-col gap-4">
-<Tabs items={['cURL', 'JavaScript', 'Python']}>
+<Tabs items={['cURL', 'JavaScript', 'Python', 'PHP', 'Ruby', 'Go', 'Rust', 'Java', '.NET']}>
<Tab value="cURL">
```bash title="Request"
curl -X GET "https://api.rybbit.io/api/live-user-count/123?minutes=5" \
@@ -594,6 +816,84 @@ response = requests.get(
data = response.json()
print(f"Live visitors: {data['count']}")
+```
+ </Tab>
+ <Tab value="PHP">
+```php title="Request"
+$ch = curl_init();
+curl_setopt($ch, CURLOPT_URL, 'https://api.rybbit.io/api/live-user-count/123?minutes=5');
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+curl_setopt($ch, CURLOPT_HTTPHEADER, [
+ 'Authorization: Bearer your_api_key_here'
+]);
+
+$response = curl_exec($ch);
+curl_close($ch);
+
+$data = json_decode($response, true);
+echo "Live visitors: " . $data['count'];
+```
+ </Tab>
+ <Tab value="Ruby">
+```ruby title="Request"
+require 'net/http'
+require 'json'
+
+uri = URI('https://api.rybbit.io/api/live-user-count/123?minutes=5')
+req = Net::HTTP::Get.new(uri)
+req['Authorization'] = 'Bearer your_api_key_here'
+
+res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
+data = JSON.parse(res.body)
+puts "Live visitors: #{data['count']}"
+```
+ </Tab>
+ <Tab value="Go">
+```go title="Request"
+req, _ := http.NewRequest("GET", "https://api.rybbit.io/api/live-user-count/123?minutes=5", nil)
+req.Header.Set("Authorization", "Bearer your_api_key_here")
+
+client := &http.Client{}
+resp, _ := client.Do(req)
+defer resp.Body.Close()
+
+var data map[string]interface{}
+json.NewDecoder(resp.Body).Decode(&data)
+fmt.Printf("Live visitors: %v\n", data["count"])
+```
+ </Tab>
+ <Tab value="Rust">
+```rust title="Request"
+let client = reqwest::Client::new();
+let res = client
+ .get("https://api.rybbit.io/api/live-user-count/123?minutes=5")
+ .header("Authorization", "Bearer your_api_key_here")
+ .send()
+ .await?;
+
+let data: serde_json::Value = res.json().await?;
+println!("Live visitors: {}", data["count"]);
+```
+ </Tab>
+ <Tab value="Java">
+```java title="Request"
+HttpClient client = HttpClient.newHttpClient();
+HttpRequest request = HttpRequest.newBuilder()
+ .uri(URI.create("https://api.rybbit.io/api/live-user-count/123?minutes=5"))
+ .header("Authorization", "Bearer your_api_key_here")
+ .GET()
+ .build();
+
+HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
+```
+ </Tab>
+ <Tab value=".NET">
+```csharp title="Request"
+using var client = new HttpClient();
+client.DefaultRequestHeaders.Add("Authorization", "Bearer your_api_key_here");
+
+var response = await client.GetAsync("https://api.rybbit.io/api/live-user-count/123?minutes=5");
+var data = await response.Content.ReadAsStringAsync();
```
</Tab>
</Tabs>
diff --git a/docs/content/docs/api/stats/performance.mdx b/docs/content/docs/api/stats/performance.mdx
index c97b2c1f4..065edcb7c 100644
--- a/docs/content/docs/api/stats/performance.mdx
+++ b/docs/content/docs/api/stats/performance.mdx
@@ -114,7 +114,7 @@ Each metric (lcp, cls, inp, fcp, ttfb) includes the following percentiles:
</div>
<div className="flex flex-col gap-4">
-<Tabs items={['cURL', 'JavaScript', 'Python']}>
+<Tabs items={['cURL', 'JavaScript', 'Python', 'PHP', 'Ruby', 'Go', 'Rust', 'Java', '.NET']}>
<Tab value="cURL">
```bash title="Request"
curl -X GET "https://api.rybbit.io/api/performance/overview/123?start_date=2024-01-01&end_date=2024-01-31" \
@@ -151,6 +151,80 @@ response = requests.get(
)
data = response.json()
+```
+ </Tab>
+ <Tab value="PHP">
+```php title="Request"
+$ch = curl_init();
+curl_setopt($ch, CURLOPT_URL, 'https://api.rybbit.io/api/performance/overview/123?start_date=2024-01-01&end_date=2024-01-31');
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+curl_setopt($ch, CURLOPT_HTTPHEADER, [
+ 'Authorization: Bearer your_api_key_here'
+]);
+
+$response = curl_exec($ch);
+curl_close($ch);
+
+$data = json_decode($response, true);
+```
+ </Tab>
+ <Tab value="Ruby">
+```ruby title="Request"
+require 'net/http'
+require 'json'
+
+uri = URI('https://api.rybbit.io/api/performance/overview/123?start_date=2024-01-01&end_date=2024-01-31')
+req = Net::HTTP::Get.new(uri)
+req['Authorization'] = 'Bearer your_api_key_here'
+
+res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
+data = JSON.parse(res.body)
+```
+ </Tab>
+ <Tab value="Go">
+```go title="Request"
+req, _ := http.NewRequest("GET", "https://api.rybbit.io/api/performance/overview/123?start_date=2024-01-01&end_date=2024-01-31", nil)
+req.Header.Set("Authorization", "Bearer your_api_key_here")
+
+client := &http.Client{}
+resp, _ := client.Do(req)
+defer resp.Body.Close()
+
+var data map[string]interface{}
+json.NewDecoder(resp.Body).Decode(&data)
+```
+ </Tab>
+ <Tab value="Rust">
+```rust title="Request"
+let client = reqwest::Client::new();
+let res = client
+ .get("https://api.rybbit.io/api/performance/overview/123?start_date=2024-01-01&end_date=2024-01-31")
+ .header("Authorization", "Bearer your_api_key_here")
+ .send()
+ .await?;
+
+let data: serde_json::Value = res.json().await?;
+```
+ </Tab>
+ <Tab value="Java">
+```java title="Request"
+HttpClient client = HttpClient.newHttpClient();
+HttpRequest request = HttpRequest.newBuilder()
+ .uri(URI.create("https://api.rybbit.io/api/performance/overview/123?start_date=2024-01-01&end_date=2024-01-31"))
+ .header("Authorization", "Bearer your_api_key_here")
+ .GET()
+ .build();
+
+HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
+```
+ </Tab>
+ <Tab value=".NET">
+```csharp title="Request"
+using var client = new HttpClient();
+client.DefaultRequestHeaders.Add("Authorization", "Bearer your_api_key_here");
+
+var response = await client.GetAsync("https://api.rybbit.io/api/performance/overview/123?start_date=2024-01-01&end_date=2024-01-31");
+var data = await response.Content.ReadAsStringAsync();
```
</Tab>
</Tabs>
@@ -258,7 +332,7 @@ Each point includes all percentiles for each metric plus:
</div>
<div className="flex flex-col gap-4">
-<Tabs items={['cURL', 'JavaScript', 'Python']}>
+<Tabs items={['cURL', 'JavaScript', 'Python', 'PHP', 'Ruby', 'Go', 'Rust', 'Java', '.NET']}>
<Tab value="cURL">
```bash title="Request"
curl -X GET "https://api.rybbit.io/api/performance/time-series/123?bucket=day&start_date=2024-01-01&end_date=2024-01-07&time_zone=UTC" \
@@ -297,6 +371,80 @@ response = requests.get(
)
data = response.json()
+```
+ </Tab>
+ <Tab value="PHP">
+```php title="Request"
+$ch = curl_init();
+curl_setopt($ch, CURLOPT_URL, 'https://api.rybbit.io/api/performance/time-series/123?bucket=day&start_date=2024-01-01&end_date=2024-01-07&time_zone=UTC');
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+curl_setopt($ch, CURLOPT_HTTPHEADER, [
+ 'Authorization: Bearer your_api_key_here'
+]);
+
+$response = curl_exec($ch);
+curl_close($ch);
+
+$data = json_decode($response, true);
+```
+ </Tab>
+ <Tab value="Ruby">
+```ruby title="Request"
+require 'net/http'
+require 'json'
+
+uri = URI('https://api.rybbit.io/api/performance/time-series/123?bucket=day&start_date=2024-01-01&end_date=2024-01-07&time_zone=UTC')
+req = Net::HTTP::Get.new(uri)
+req['Authorization'] = 'Bearer your_api_key_here'
+
+res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
+data = JSON.parse(res.body)
+```
+ </Tab>
+ <Tab value="Go">
+```go title="Request"
+req, _ := http.NewRequest("GET", "https://api.rybbit.io/api/performance/time-series/123?bucket=day&start_date=2024-01-01&end_date=2024-01-07&time_zone=UTC", nil)
+req.Header.Set("Authorization", "Bearer your_api_key_here")
+
+client := &http.Client{}
+resp, _ := client.Do(req)
+defer resp.Body.Close()
+
+var data map[string]interface{}
+json.NewDecoder(resp.Body).Decode(&data)
+```
+ </Tab>
+ <Tab value="Rust">
+```rust title="Request"
+let client = reqwest::Client::new();
+let res = client
+ .get("https://api.rybbit.io/api/performance/time-series/123?bucket=day&start_date=2024-01-01&end_date=2024-01-07&time_zone=UTC")
+ .header("Authorization", "Bearer your_api_key_here")
+ .send()
+ .await?;
+
+let data: serde_json::Value = res.json().await?;
+```
+ </Tab>
+ <Tab value="Java">
+```java title="Request"
+HttpClient client = HttpClient.newHttpClient();
+HttpRequest request = HttpRequest.newBuilder()
+ .uri(URI.create("https://api.rybbit.io/api/performance/time-series/123?bucket=day&start_date=2024-01-01&end_date=2024-01-07&time_zone=UTC"))
+ .header("Authorization", "Bearer your_api_key_here")
+ .GET()
+ .build();
+
+HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
+```
+ </Tab>
+ <Tab value=".NET">
+```csharp title="Request"
+using var client = new HttpClient();
+client.DefaultRequestHeaders.Add("Authorization", "Bearer your_api_key_here");
+
+var response = await client.GetAsync("https://api.rybbit.io/api/performance/time-series/123?bucket=day&start_date=2024-01-01&end_date=2024-01-07&time_zone=UTC");
+var data = await response.Content.ReadAsStringAsync();
```
</Tab>
</Tabs>
@@ -455,7 +603,7 @@ Each object includes the dimension value plus all percentiles:
</div>
<div className="flex flex-col gap-4">
-<Tabs items={['cURL', 'JavaScript', 'Python']}>
+<Tabs items={['cURL', 'JavaScript', 'Python', 'PHP', 'Ruby', 'Go', 'Rust', 'Java', '.NET']}>
<Tab value="cURL">
```bash title="Request"
curl -X GET "https://api.rybbit.io/api/performance/by-dimension/123?dimension=pathname&sort_by=lcp_p75&sort_order=desc&limit=10" \
@@ -494,6 +642,80 @@ response = requests.get(
)
data = response.json()
+```
+ </Tab>
+ <Tab value="PHP">
+```php title="Request"
+$ch = curl_init();
+curl_setopt($ch, CURLOPT_URL, 'https://api.rybbit.io/api/performance/by-dimension/123?dimension=pathname&sort_by=lcp_p75&sort_order=desc&limit=10');
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+curl_setopt($ch, CURLOPT_HTTPHEADER, [
+ 'Authorization: Bearer your_api_key_here'
+]);
+
+$response = curl_exec($ch);
+curl_close($ch);
+
+$data = json_decode($response, true);
+```
+ </Tab>
+ <Tab value="Ruby">
+```ruby title="Request"
+require 'net/http'
+require 'json'
+
+uri = URI('https://api.rybbit.io/api/performance/by-dimension/123?dimension=pathname&sort_by=lcp_p75&sort_order=desc&limit=10')
+req = Net::HTTP::Get.new(uri)
+req['Authorization'] = 'Bearer your_api_key_here'
+
+res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
+data = JSON.parse(res.body)
+```
+ </Tab>
+ <Tab value="Go">
+```go title="Request"
+req, _ := http.NewRequest("GET", "https://api.rybbit.io/api/performance/by-dimension/123?dimension=pathname&sort_by=lcp_p75&sort_order=desc&limit=10", nil)
+req.Header.Set("Authorization", "Bearer your_api_key_here")
+
+client := &http.Client{}
+resp, _ := client.Do(req)
+defer resp.Body.Close()
+
+var data map[string]interface{}
+json.NewDecoder(resp.Body).Decode(&data)
+```
+ </Tab>
+ <Tab value="Rust">
+```rust title="Request"
+let client = reqwest::Client::new();
+let res = client
+ .get("https://api.rybbit.io/api/performance/by-dimension/123?dimension=pathname&sort_by=lcp_p75&sort_order=desc&limit=10")
+ .header("Authorization", "Bearer your_api_key_here")
+ .send()
+ .await?;
+
+let data: serde_json::Value = res.json().await?;
+```
+ </Tab>
+ <Tab value="Java">
+```java title="Request"
+HttpClient client = HttpClient.newHttpClient();
+HttpRequest request = HttpRequest.newBuilder()
+ .uri(URI.create("https://api.rybbit.io/api/performance/by-dimension/123?dimension=pathname&sort_by=lcp_p75&sort_order=desc&limit=10"))
+ .header("Authorization", "Bearer your_api_key_here")
+ .GET()
+ .build();
+
+HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
+```
+ </Tab>
+ <Tab value=".NET">
+```csharp title="Request"
+using var client = new HttpClient();
+client.DefaultRequestHeaders.Add("Authorization", "Bearer your_api_key_here");
+
+var response = await client.GetAsync("https://api.rybbit.io/api/performance/by-dimension/123?dimension=pathname&sort_by=lcp_p75&sort_order=desc&limit=10");
+var data = await response.Content.ReadAsStringAsync();
```
</Tab>
</Tabs>
diff --git a/docs/content/docs/api/stats/sessions.mdx b/docs/content/docs/api/stats/sessions.mdx
index 43c139a5e..71db7e96a 100644
--- a/docs/content/docs/api/stats/sessions.mdx
+++ b/docs/content/docs/api/stats/sessions.mdx
@@ -192,7 +192,7 @@ Accepts all [Common Parameters](/docs/api/stats/reference#common-parameters) plu
</div>
<div className="flex flex-col gap-4">
-<Tabs items={['cURL', 'JavaScript', 'Python']}>
+<Tabs items={['cURL', 'JavaScript', 'Python', 'PHP', 'Ruby', 'Go', 'Rust', 'Java', '.NET']}>
<Tab value="cURL">
```bash title="Request"
curl -X GET "https://api.rybbit.io/api/sessions/123?page=1&limit=20&start_date=2024-01-01&end_date=2024-01-31" \
@@ -231,6 +231,80 @@ response = requests.get(
)
data = response.json()
+```
+ </Tab>
+ <Tab value="PHP">
+```php title="Request"
+$ch = curl_init();
+curl_setopt($ch, CURLOPT_URL, 'https://api.rybbit.io/api/sessions/123?page=1&limit=20&start_date=2024-01-01&end_date=2024-01-31');
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+curl_setopt($ch, CURLOPT_HTTPHEADER, [
+ 'Authorization: Bearer your_api_key_here'
+]);
+
+$response = curl_exec($ch);
+curl_close($ch);
+
+$data = json_decode($response, true);
+```
+ </Tab>
+ <Tab value="Ruby">
+```ruby title="Request"
+require 'net/http'
+require 'json'
+
+uri = URI('https://api.rybbit.io/api/sessions/123?page=1&limit=20&start_date=2024-01-01&end_date=2024-01-31')
+req = Net::HTTP::Get.new(uri)
+req['Authorization'] = 'Bearer your_api_key_here'
+
+res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
+data = JSON.parse(res.body)
+```
+ </Tab>
+ <Tab value="Go">
+```go title="Request"
+req, _ := http.NewRequest("GET", "https://api.rybbit.io/api/sessions/123?page=1&limit=20&start_date=2024-01-01&end_date=2024-01-31", nil)
+req.Header.Set("Authorization", "Bearer your_api_key_here")
+
+client := &http.Client{}
+resp, _ := client.Do(req)
+defer resp.Body.Close()
+
+var data map[string]interface{}
+json.NewDecoder(resp.Body).Decode(&data)
+```
+ </Tab>
+ <Tab value="Rust">
+```rust title="Request"
+let client = reqwest::Client::new();
+let res = client
+ .get("https://api.rybbit.io/api/sessions/123?page=1&limit=20&start_date=2024-01-01&end_date=2024-01-31")
+ .header("Authorization", "Bearer your_api_key_here")
+ .send()
+ .await?;
+
+let data: serde_json::Value = res.json().await?;
+```
+ </Tab>
+ <Tab value="Java">
+```java title="Request"
+HttpClient client = HttpClient.newHttpClient();
+HttpRequest request = HttpRequest.newBuilder()
+ .uri(URI.create("https://api.rybbit.io/api/sessions/123?page=1&limit=20&start_date=2024-01-01&end_date=2024-01-31"))
+ .header("Authorization", "Bearer your_api_key_here")
+ .GET()
+ .build();
+
+HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
+```
+ </Tab>
+ <Tab value=".NET">
+```csharp title="Request"
+using var client = new HttpClient();
+client.DefaultRequestHeaders.Add("Authorization", "Bearer your_api_key_here");
+
+var response = await client.GetAsync("https://api.rybbit.io/api/sessions/123?page=1&limit=20&start_date=2024-01-01&end_date=2024-01-31");
+var data = await response.Content.ReadAsStringAsync();
```
</Tab>
</Tabs>
@@ -391,7 +465,7 @@ Returns detailed information about a specific session including all events and p
</div>
<div className="flex flex-col gap-4">
-<Tabs items={['cURL', 'JavaScript', 'Python']}>
+<Tabs items={['cURL', 'JavaScript', 'Python', 'PHP', 'Ruby', 'Go', 'Rust', 'Java', '.NET']}>
<Tab value="cURL">
```bash title="Request"
curl -X GET "https://api.rybbit.io/api/sessions/sess_abc123/123?limit=50" \
@@ -425,6 +499,80 @@ response = requests.get(
)
data = response.json()
+```
+ </Tab>
+ <Tab value="PHP">
+```php title="Request"
+$ch = curl_init();
+curl_setopt($ch, CURLOPT_URL, 'https://api.rybbit.io/api/sessions/sess_abc123/123?limit=50');
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+curl_setopt($ch, CURLOPT_HTTPHEADER, [
+ 'Authorization: Bearer your_api_key_here'
+]);
+
+$response = curl_exec($ch);
+curl_close($ch);
+
+$data = json_decode($response, true);
+```
+ </Tab>
+ <Tab value="Ruby">
+```ruby title="Request"
+require 'net/http'
+require 'json'
+
+uri = URI('https://api.rybbit.io/api/sessions/sess_abc123/123?limit=50')
+req = Net::HTTP::Get.new(uri)
+req['Authorization'] = 'Bearer your_api_key_here'
+
+res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
+data = JSON.parse(res.body)
+```
+ </Tab>
+ <Tab value="Go">
+```go title="Request"
+req, _ := http.NewRequest("GET", "https://api.rybbit.io/api/sessions/sess_abc123/123?limit=50", nil)
+req.Header.Set("Authorization", "Bearer your_api_key_here")
+
+client := &http.Client{}
+resp, _ := client.Do(req)
+defer resp.Body.Close()
+
+var data map[string]interface{}
+json.NewDecoder(resp.Body).Decode(&data)
+```
+ </Tab>
+ <Tab value="Rust">
+```rust title="Request"
+let client = reqwest::Client::new();
+let res = client
+ .get("https://api.rybbit.io/api/sessions/sess_abc123/123?limit=50")
+ .header("Authorization", "Bearer your_api_key_here")
+ .send()
+ .await?;
+
+let data: serde_json::Value = res.json().await?;
+```
+ </Tab>
+ <Tab value="Java">
+```java title="Request"
+HttpClient client = HttpClient.newHttpClient();
+HttpRequest request = HttpRequest.newBuilder()
+ .uri(URI.create("https://api.rybbit.io/api/sessions/sess_abc123/123?limit=50"))
+ .header("Authorization", "Bearer your_api_key_here")
+ .GET()
+ .build();
+
+HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
+```
+ </Tab>
+ <Tab value=".NET">
+```csharp title="Request"
+using var client = new HttpClient();
+client.DefaultRequestHeaders.Add("Authorization", "Bearer your_api_key_here");
+
+var response = await client.GetAsync("https://api.rybbit.io/api/sessions/sess_abc123/123?limit=50");
+var data = await response.Content.ReadAsStringAsync();
```
</Tab>
</Tabs>
@@ -548,7 +696,7 @@ Accepts all [Common Parameters](/docs/api/stats/reference#common-parameters) (ti
</div>
<div className="flex flex-col gap-4">
-<Tabs items={['cURL', 'JavaScript', 'Python']}>
+<Tabs items={['cURL', 'JavaScript', 'Python', 'PHP', 'Ruby', 'Go', 'Rust', 'Java', '.NET']}>
<Tab value="cURL">
```bash title="Request"
curl -X GET "https://api.rybbit.io/api/session-locations/123?start_date=2024-01-01&end_date=2024-01-31" \
@@ -585,6 +733,80 @@ response = requests.get(
)
data = response.json()
+```
+ </Tab>
+ <Tab value="PHP">
+```php title="Request"
+$ch = curl_init();
+curl_setopt($ch, CURLOPT_URL, 'https://api.rybbit.io/api/session-locations/123?start_date=2024-01-01&end_date=2024-01-31');
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+curl_setopt($ch, CURLOPT_HTTPHEADER, [
+ 'Authorization: Bearer your_api_key_here'
+]);
+
+$response = curl_exec($ch);
+curl_close($ch);
+
+$data = json_decode($response, true);
+```
+ </Tab>
+ <Tab value="Ruby">
+```ruby title="Request"
+require 'net/http'
+require 'json'
+
+uri = URI('https://api.rybbit.io/api/session-locations/123?start_date=2024-01-01&end_date=2024-01-31')
+req = Net::HTTP::Get.new(uri)
+req['Authorization'] = 'Bearer your_api_key_here'
+
+res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
+data = JSON.parse(res.body)
+```
+ </Tab>
+ <Tab value="Go">
+```go title="Request"
+req, _ := http.NewRequest("GET", "https://api.rybbit.io/api/session-locations/123?start_date=2024-01-01&end_date=2024-01-31", nil)
+req.Header.Set("Authorization", "Bearer your_api_key_here")
+
+client := &http.Client{}
+resp, _ := client.Do(req)
+defer resp.Body.Close()
+
+var data map[string]interface{}
+json.NewDecoder(resp.Body).Decode(&data)
+```
+ </Tab>
+ <Tab value="Rust">
+```rust title="Request"
+let client = reqwest::Client::new();
+let res = client
+ .get("https://api.rybbit.io/api/session-locations/123?start_date=2024-01-01&end_date=2024-01-31")
+ .header("Authorization", "Bearer your_api_key_here")
+ .send()
+ .await?;
+
+let data: serde_json::Value = res.json().await?;
+```
+ </Tab>
+ <Tab value="Java">
+```java title="Request"
+HttpClient client = HttpClient.newHttpClient();
+HttpRequest request = HttpRequest.newBuilder()
+ .uri(URI.create("https://api.rybbit.io/api/session-locations/123?start_date=2024-01-01&end_date=2024-01-31"))
+ .header("Authorization", "Bearer your_api_key_here")
+ .GET()
+ .build();
+
+HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
+```
+ </Tab>
+ <Tab value=".NET">
+```csharp title="Request"
+using var client = new HttpClient();
+client.DefaultRequestHeaders.Add("Authorization", "Bearer your_api_key_here");
+
+var response = await client.GetAsync("https://api.rybbit.io/api/session-locations/123?start_date=2024-01-01&end_date=2024-01-31");
+var data = await response.Content.ReadAsStringAsync();
```
</Tab>
</Tabs>
diff --git a/docs/content/docs/api/stats/users.mdx b/docs/content/docs/api/stats/users.mdx
index 997c0d426..6f07fd1ea 100644
--- a/docs/content/docs/api/stats/users.mdx
+++ b/docs/content/docs/api/stats/users.mdx
@@ -191,7 +191,7 @@ Accepts all [Common Parameters](/docs/api/stats/reference#common-parameters) plu
</div>
<div className="flex flex-col gap-4">
-<Tabs items={['cURL', 'JavaScript', 'Python']}>
+<Tabs items={['cURL', 'JavaScript', 'Python', 'PHP', 'Ruby', 'Go', 'Rust', 'Java', '.NET']}>
<Tab value="cURL">
```bash title="Request"
curl -X GET "https://api.rybbit.io/api/users/123?page=1&page_size=10&sort_by=last_seen&sort_order=desc" \
@@ -230,6 +230,80 @@ response = requests.get(
)
data = response.json()
+```
+ </Tab>
+ <Tab value="PHP">
+```php title="Request"
+$ch = curl_init();
+curl_setopt($ch, CURLOPT_URL, 'https://api.rybbit.io/api/users/123?page=1&page_size=10&sort_by=last_seen&sort_order=desc');
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+curl_setopt($ch, CURLOPT_HTTPHEADER, [
+ 'Authorization: Bearer your_api_key_here'
+]);
+
+$response = curl_exec($ch);
+curl_close($ch);
+
+$data = json_decode($response, true);
+```
+ </Tab>
+ <Tab value="Ruby">
+```ruby title="Request"
+require 'net/http'
+require 'json'
+
+uri = URI('https://api.rybbit.io/api/users/123?page=1&page_size=10&sort_by=last_seen&sort_order=desc')
+req = Net::HTTP::Get.new(uri)
+req['Authorization'] = 'Bearer your_api_key_here'
+
+res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
+data = JSON.parse(res.body)
+```
+ </Tab>
+ <Tab value="Go">
+```go title="Request"
+req, _ := http.NewRequest("GET", "https://api.rybbit.io/api/users/123?page=1&page_size=10&sort_by=last_seen&sort_order=desc", nil)
+req.Header.Set("Authorization", "Bearer your_api_key_here")
+
+client := &http.Client{}
+resp, _ := client.Do(req)
+defer resp.Body.Close()
+
+var data map[string]interface{}
+json.NewDecoder(resp.Body).Decode(&data)
+```
+ </Tab>
+ <Tab value="Rust">
+```rust title="Request"
+let client = reqwest::Client::new();
+let res = client
+ .get("https://api.rybbit.io/api/users/123?page=1&page_size=10&sort_by=last_seen&sort_order=desc")
+ .header("Authorization", "Bearer your_api_key_here")
+ .send()
+ .await?;
+
+let data: serde_json::Value = res.json().await?;
+```
+ </Tab>
+ <Tab value="Java">
+```java title="Request"
+HttpClient client = HttpClient.newHttpClient();
+HttpRequest request = HttpRequest.newBuilder()
+ .uri(URI.create("https://api.rybbit.io/api/users/123?page=1&page_size=10&sort_by=last_seen&sort_order=desc"))
+ .header("Authorization", "Bearer your_api_key_here")
+ .GET()
+ .build();
+
+HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
+```
+ </Tab>
+ <Tab value=".NET">
+```csharp title="Request"
+using var client = new HttpClient();
+client.DefaultRequestHeaders.Add("Authorization", "Bearer your_api_key_here");
+
+var response = await client.GetAsync("https://api.rybbit.io/api/users/123?page=1&page_size=10&sort_by=last_seen&sort_order=desc");
+var data = await response.Content.ReadAsStringAsync();
```
</Tab>
</Tabs>
@@ -389,7 +463,7 @@ Accepts all [Common Parameters](/docs/api/stats/reference#common-parameters) (ti
</div>
<div className="flex flex-col gap-4">
-<Tabs items={['cURL', 'JavaScript', 'Python']}>
+<Tabs items={['cURL', 'JavaScript', 'Python', 'PHP', 'Ruby', 'Go', 'Rust', 'Java', '.NET']}>
<Tab value="cURL">
```bash title="Request"
curl -X GET "https://api.rybbit.io/api/users/abc123def456/sessions/123?start_date=2024-01-01&end_date=2024-01-31" \
@@ -426,6 +500,80 @@ response = requests.get(
)
data = response.json()
+```
+ </Tab>
+ <Tab value="PHP">
+```php title="Request"
+$ch = curl_init();
+curl_setopt($ch, CURLOPT_URL, 'https://api.rybbit.io/api/users/abc123def456/sessions/123?start_date=2024-01-01&end_date=2024-01-31');
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+curl_setopt($ch, CURLOPT_HTTPHEADER, [
+ 'Authorization: Bearer your_api_key_here'
+]);
+
+$response = curl_exec($ch);
+curl_close($ch);
+
+$data = json_decode($response, true);
+```
+ </Tab>
+ <Tab value="Ruby">
+```ruby title="Request"
+require 'net/http'
+require 'json'
+
+uri = URI('https://api.rybbit.io/api/users/abc123def456/sessions/123?start_date=2024-01-01&end_date=2024-01-31')
+req = Net::HTTP::Get.new(uri)
+req['Authorization'] = 'Bearer your_api_key_here'
+
+res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
+data = JSON.parse(res.body)
+```
+ </Tab>
+ <Tab value="Go">
+```go title="Request"
+req, _ := http.NewRequest("GET", "https://api.rybbit.io/api/users/abc123def456/sessions/123?start_date=2024-01-01&end_date=2024-01-31", nil)
+req.Header.Set("Authorization", "Bearer your_api_key_here")
+
+client := &http.Client{}
+resp, _ := client.Do(req)
+defer resp.Body.Close()
+
+var data map[string]interface{}
+json.NewDecoder(resp.Body).Decode(&data)
+```
+ </Tab>
+ <Tab value="Rust">
+```rust title="Request"
+let client = reqwest::Client::new();
+let res = client
+ .get("https://api.rybbit.io/api/users/abc123def456/sessions/123?start_date=2024-01-01&end_date=2024-01-31")
+ .header("Authorization", "Bearer your_api_key_here")
+ .send()
+ .await?;
+
+let data: serde_json::Value = res.json().await?;
+```
+ </Tab>
+ <Tab value="Java">
+```java title="Request"
+HttpClient client = HttpClient.newHttpClient();
+HttpRequest request = HttpRequest.newBuilder()
+ .uri(URI.create("https://api.rybbit.io/api/users/abc123def456/sessions/123?start_date=2024-01-01&end_date=2024-01-31"))
+ .header("Authorization", "Bearer your_api_key_here")
+ .GET()
+ .build();
+
+HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
+```
+ </Tab>
+ <Tab value=".NET">
+```csharp title="Request"
+using var client = new HttpClient();
+client.DefaultRequestHeaders.Add("Authorization", "Bearer your_api_key_here");
+
+var response = await client.GetAsync("https://api.rybbit.io/api/users/abc123def456/sessions/123?start_date=2024-01-01&end_date=2024-01-31");
+var data = await response.Content.ReadAsStringAsync();
```
</Tab>
</Tabs>
@@ -546,7 +694,7 @@ Returns the number of sessions per day for a specific user. Useful for visualizi
</div>
<div className="flex flex-col gap-4">
-<Tabs items={['cURL', 'JavaScript', 'Python']}>
+<Tabs items={['cURL', 'JavaScript', 'Python', 'PHP', 'Ruby', 'Go', 'Rust', 'Java', '.NET']}>
<Tab value="cURL">
```bash title="Request"
curl -X GET "https://api.rybbit.io/api/users/session-count/123?user_id=abc123def456&time_zone=America/New_York" \
@@ -583,6 +731,80 @@ response = requests.get(
)
data = response.json()
+```
+ </Tab>
+ <Tab value="PHP">
+```php title="Request"
+$ch = curl_init();
+curl_setopt($ch, CURLOPT_URL, 'https://api.rybbit.io/api/users/session-count/123?user_id=abc123def456&time_zone=America/New_York');
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+curl_setopt($ch, CURLOPT_HTTPHEADER, [
+ 'Authorization: Bearer your_api_key_here'
+]);
+
+$response = curl_exec($ch);
+curl_close($ch);
+
+$data = json_decode($response, true);
+```
+ </Tab>
+ <Tab value="Ruby">
+```ruby title="Request"
+require 'net/http'
+require 'json'
+
+uri = URI('https://api.rybbit.io/api/users/session-count/123?user_id=abc123def456&time_zone=America/New_York')
+req = Net::HTTP::Get.new(uri)
+req['Authorization'] = 'Bearer your_api_key_here'
+
+res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
+data = JSON.parse(res.body)
+```
+ </Tab>
+ <Tab value="Go">
+```go title="Request"
+req, _ := http.NewRequest("GET", "https://api.rybbit.io/api/users/session-count/123?user_id=abc123def456&time_zone=America/New_York", nil)
+req.Header.Set("Authorization", "Bearer your_api_key_here")
+
+client := &http.Client{}
+resp, _ := client.Do(req)
+defer resp.Body.Close()
+
+var data map[string]interface{}
+json.NewDecoder(resp.Body).Decode(&data)
+```
+ </Tab>
+ <Tab value="Rust">
+```rust title="Request"
+let client = reqwest::Client::new();
+let res = client
+ .get("https://api.rybbit.io/api/users/session-count/123?user_id=abc123def456&time_zone=America/New_York")
+ .header("Authorization", "Bearer your_api_key_here")
+ .send()
+ .await?;
+
+let data: serde_json::Value = res.json().await?;
+```
+ </Tab>
+ <Tab value="Java">
+```java title="Request"
+HttpClient client = HttpClient.newHttpClient();
+HttpRequest request = HttpRequest.newBuilder()
+ .uri(URI.create("https://api.rybbit.io/api/users/session-count/123?user_id=abc123def456&time_zone=America/New_York"))
+ .header("Authorization", "Bearer your_api_key_here")
+ .GET()
+ .build();
+
+HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
+```
+ </Tab>
+ <Tab value=".NET">
+```csharp title="Request"
+using var client = new HttpClient();
+client.DefaultRequestHeaders.Add("Authorization", "Bearer your_api_key_here");
+
+var response = await client.GetAsync("https://api.rybbit.io/api/users/session-count/123?user_id=abc123def456&time_zone=America/New_York");
+var data = await response.Content.ReadAsStringAsync();
```
</Tab>
</Tabs>
@@ -766,7 +988,7 @@ Returns detailed information about a specific user, including their profile trai
</div>
<div className="flex flex-col gap-4">
-<Tabs items={['cURL', 'JavaScript', 'Python']}>
+<Tabs items={['cURL', 'JavaScript', 'Python', 'PHP', 'Ruby', 'Go', 'Rust', 'Java', '.NET']}>
<Tab value="cURL">
```bash title="Request"
curl -X GET "https://api.rybbit.io/api/users/[email protected]/123" \
@@ -799,6 +1021,80 @@ response = requests.get(
)
data = response.json()
+```
+ </Tab>
+ <Tab value="PHP">
+```php title="Request"
+$ch = curl_init();
+curl_setopt($ch, CURLOPT_URL, 'https://api.rybbit.io/api/users/[email protected]/123');
+curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
+curl_setopt($ch, CURLOPT_HTTPHEADER, [
+ 'Authorization: Bearer your_api_key_here'
+]);
+
+$response = curl_exec($ch);
+curl_close($ch);
+
+$data = json_decode($response, true);
+```
+ </Tab>
+ <Tab value="Ruby">
+```ruby title="Request"
+require 'net/http'
+require 'json'
+
+uri = URI('https://api.rybbit.io/api/users/[email protected]/123')
+req = Net::HTTP::Get.new(uri)
+req['Authorization'] = 'Bearer your_api_key_here'
+
+res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(req) }
+data = JSON.parse(res.body)
+```
+ </Tab>
+ <Tab value="Go">
+```go title="Request"
+req, _ := http.NewRequest("GET", "https://api.rybbit.io/api/users/[email protected]/123", nil)
+req.Header.Set("Authorization", "Bearer your_api_key_here")
+
+client := &http.Client{}
+resp, _ := client.Do(req)
+defer resp.Body.Close()
+
+var data map[string]interface{}
+json.NewDecoder(resp.Body).Decode(&data)
+```
+ </Tab>
+ <Tab value="Rust">
+```rust title="Request"
+let client = reqwest::Client::new();
+let res = client
+ .get("https://api.rybbit.io/api/users/[email protected]/123")
+ .header("Authorization", "Bearer your_api_key_here")
+ .send()
+ .await?;
+
+let data: serde_json::Value = res.json().await?;
+```
+ </Tab>
+ <Tab value="Java">
+```java title="Request"
+HttpClient client = HttpClient.newHttpClient();
+HttpRequest request = HttpRequest.newBuilder()
+ .uri(URI.create("https://api.rybbit.io/api/users/[email protected]/123"))
+ .header("Authorization", "Bearer your_api_key_here")
+ .GET()
+ .build();
+
+HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
+```
+ </Tab>
+ <Tab value=".NET">
+```csharp title="Request"
+using var client = new HttpClient();
+client.DefaultRequestHeaders.Add("Authorization", "Bearer your_api_key_here");
+
+var response = await client.GetAsync("https://api.rybbit.io/api/users/[email protected]/123");
+var data = await response.Content.ReadAsStringAsync();
```
</Tab>
</Tabs>