SIM
List APNs for active subscriptions
Returns the access point names (APNs) configured for the device’s active eSIM subscriptions.
GET
/
devices
/
{deviceId}
/
esim
/
apn
JavaScript
import Mobilerun from '@mobilerun/sdk';
const client = new Mobilerun({
apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
});
const apns = await client.devices.esim.apn.list('deviceId');
console.log(apns);import os
from mobilerun_sdk import Mobilerun
client = Mobilerun(
api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"), # This is the default and can be omitted
)
apns = client.devices.esim.apn.list(
device_id="deviceId",
)
print(apns)curl --request GET \
--url https://api.mobilerun.ai/v1/devices/{deviceId}/esim/apn \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mobilerun.ai/v1/devices/{deviceId}/esim/apn",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.mobilerun.ai/v1/devices/{deviceId}/esim/apn"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.mobilerun.ai/v1/devices/{deviceId}/esim/apn")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mobilerun.ai/v1/devices/{deviceId}/esim/apn")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"apn": "<string>",
"id": 123,
"isPreferred": true,
"mcc": "<string>",
"mnc": "<string>",
"name": "<string>",
"protocol": "<string>",
"roamingProtocol": "<string>",
"subId": 123,
"type": "<string>"
}
]{
"$schema": "https://example.com/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}Use an entry’s
id as apnId in select-esim-apn; isPreferred marks the APN currently in use. On Android the list covers all APNs of the active subscriptions, including carrier-provisioned ones; on iOS it shows only APNs created through this API.Authorizations
Bearer token via Authorization header
Headers
Required range:
x >= 0Path Parameters
Was this page helpful?
⌘I
JavaScript
import Mobilerun from '@mobilerun/sdk';
const client = new Mobilerun({
apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
});
const apns = await client.devices.esim.apn.list('deviceId');
console.log(apns);import os
from mobilerun_sdk import Mobilerun
client = Mobilerun(
api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"), # This is the default and can be omitted
)
apns = client.devices.esim.apn.list(
device_id="deviceId",
)
print(apns)curl --request GET \
--url https://api.mobilerun.ai/v1/devices/{deviceId}/esim/apn \
--header 'Authorization: Bearer <token>'<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.mobilerun.ai/v1/devices/{deviceId}/esim/apn",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.mobilerun.ai/v1/devices/{deviceId}/esim/apn"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.mobilerun.ai/v1/devices/{deviceId}/esim/apn")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.mobilerun.ai/v1/devices/{deviceId}/esim/apn")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body[
{
"apn": "<string>",
"id": 123,
"isPreferred": true,
"mcc": "<string>",
"mnc": "<string>",
"name": "<string>",
"protocol": "<string>",
"roamingProtocol": "<string>",
"subId": 123,
"type": "<string>"
}
]{
"$schema": "https://example.com/schemas/ErrorModel.json",
"detail": "Property foo is required but is missing.",
"errors": [
{
"location": "<string>",
"message": "<string>",
"value": "<unknown>"
}
],
"instance": "https://example.com/error-log/abc123",
"status": 400,
"title": "Bad Request",
"type": "https://example.com/errors/example"
}