curl --request GET \
--url https://api.ngrok.com/app/sessions/{id} \
--header 'Authorization: Bearer <token>' \
--header 'ngrok-version: <ngrok-version>'import requests
url = "https://api.ngrok.com/app/sessions/{id}"
headers = {
"ngrok-version": "<ngrok-version>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'ngrok-version': '<ngrok-version>', Authorization: 'Bearer <token>'}
};
fetch('https://api.ngrok.com/app/sessions/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ngrok.com/app/sessions/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"ngrok-version: <ngrok-version>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.ngrok.com/app/sessions/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("ngrok-version", "<ngrok-version>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.ngrok.com/app/sessions/{id}")
.header("ngrok-version", "<ngrok-version>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ngrok.com/app/sessions/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["ngrok-version"] = '<ngrok-version>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"uri": "<string>",
"public_url": "<string>",
"browser_session": {
"user_agent": {
"raw": "<string>",
"browser_name": "<string>",
"browser_version": "<string>",
"device_type": "<string>",
"os_name": "<string>",
"os_version": "<string>"
},
"ip_address": "<string>",
"location": {
"country_code": "<string>",
"latitude": 123,
"longitude": 123,
"lat_long_radius_km": 123
}
},
"application_user": {
"id": "<string>",
"uri": "<string>"
},
"created_at": "<string>",
"last_active": "<string>",
"expires_at": "<string>",
"endpoint": {
"id": "<string>",
"uri": "<string>"
},
"edge": {
"id": "<string>",
"uri": "<string>"
},
"route": {
"id": "<string>",
"uri": "<string>"
}
}{
"status_code": 123,
"msg": "<string>",
"error_code": "<string>",
"details": {}
}{
"status_code": 123,
"msg": "<string>",
"error_code": "<string>",
"details": {}
}Get
Get an application session by ID.
curl --request GET \
--url https://api.ngrok.com/app/sessions/{id} \
--header 'Authorization: Bearer <token>' \
--header 'ngrok-version: <ngrok-version>'import requests
url = "https://api.ngrok.com/app/sessions/{id}"
headers = {
"ngrok-version": "<ngrok-version>",
"Authorization": "Bearer <token>"
}
response = requests.get(url, headers=headers)
print(response.text)const options = {
method: 'GET',
headers: {'ngrok-version': '<ngrok-version>', Authorization: 'Bearer <token>'}
};
fetch('https://api.ngrok.com/app/sessions/{id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.ngrok.com/app/sessions/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"ngrok-version: <ngrok-version>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.ngrok.com/app/sessions/{id}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("ngrok-version", "<ngrok-version>")
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.ngrok.com/app/sessions/{id}")
.header("ngrok-version", "<ngrok-version>")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.ngrok.com/app/sessions/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["ngrok-version"] = '<ngrok-version>'
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"id": "<string>",
"uri": "<string>",
"public_url": "<string>",
"browser_session": {
"user_agent": {
"raw": "<string>",
"browser_name": "<string>",
"browser_version": "<string>",
"device_type": "<string>",
"os_name": "<string>",
"os_version": "<string>"
},
"ip_address": "<string>",
"location": {
"country_code": "<string>",
"latitude": 123,
"longitude": 123,
"lat_long_radius_km": 123
}
},
"application_user": {
"id": "<string>",
"uri": "<string>"
},
"created_at": "<string>",
"last_active": "<string>",
"expires_at": "<string>",
"endpoint": {
"id": "<string>",
"uri": "<string>"
},
"edge": {
"id": "<string>",
"uri": "<string>"
},
"route": {
"id": "<string>",
"uri": "<string>"
}
}{
"status_code": 123,
"msg": "<string>",
"error_code": "<string>",
"details": {}
}{
"status_code": 123,
"msg": "<string>",
"error_code": "<string>",
"details": {}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Path Parameters
a resource identifier
Response
Get an application session by ID.
unique application session resource identifier
URI of the application session API resource
URL of the hostport served by this endpoint
browser session details of the application session
Show child attributes
Show child attributes
application user this session is associated with
Show child attributes
Show child attributes
timestamp when the user was created in RFC 3339 format
timestamp when the user was last active in RFC 3339 format
timestamp when session expires in RFC 3339 format
ephemeral endpoint this session is associated with
Show child attributes
Show child attributes
edge this session is associated with, null if the endpoint is agent-initiated
Show child attributes
Show child attributes
route this session is associated with, null if the endpoint is agent-initiated
Show child attributes
Show child attributes
Was this page helpful?