Get all SIM cards
Get all SIM cards belonging to the user that match the given filters.
GET
/
sim_cards
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const simpleSimCard of client.simCards.list()) {
console.log(simpleSimCard.id);
}import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
page = client.sim_cards.list()
page = page.data[0]
print(page.id)package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
page, err := client.SimCards.List(context.TODO(), telnyx.SimCardListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.simcards.SimCardListPage;
import com.telnyx.sdk.models.simcards.SimCardListParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
SimCardListPage page = client.simCards().list();
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
page = telnyx.sim_cards.list
puts(page)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$page = $client->simCards->list(
filter: [
'iccid' => '89310410106543789301',
'msisdn' => '+13109976224',
'status' => ['enabled'],
'tags' => ['personal', 'customers', 'active-customers'],
],
filterSimCardGroupID: '47a1c2b0-cc7b-4ab1-bb98-b33fb0fc61b9',
includeSimCardGroup: true,
pageNumber: 0,
pageSize: 0,
sort: 'current_billing_period_consumed_data.amount',
);
var_dump($page);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx sim-cards list \
--api-key 'My API Key'curl --request GET \
--url https://api.telnyx.com/v2/sim_cards \
--header 'Authorization: Bearer <token>'{
"data": [
{
"id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"record_type": "sim_card",
"status": {
"value": "enabled",
"reason": "The SIM card is active, ready to connect to networks and consume data."
},
"type": "physical",
"iccid": "89310410106543789301",
"imsi": "081932214823362973",
"msisdn": "+13109976224",
"sim_card_group_id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"tags": [
"personal",
"customers",
"active-customers"
],
"data_limit": {
"amount": "2048.0",
"unit": "MB"
},
"current_billing_period_consumed_data": {
"amount": "2049.0",
"unit": "MB"
},
"actions_in_progress": true,
"created_at": "2018-02-02T22:25:27.521Z",
"updated_at": "2018-02-02T22:25:27.521Z",
"esim_installation_status": "released",
"version": "4.3",
"resources_with_in_progress_actions": [],
"eid": null,
"authorized_imeis": [
"106516771852751",
"534051870479563",
"508821468377961"
],
"voice_enabled": false
}
],
"meta": {
"total_pages": 3,
"total_results": 55,
"page_number": 2,
"page_size": 25
}
}{
"errors": [
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Query Parameters
Consolidated filter parameter for SIM cards (deepObject style). Originally: filter[iccid], filter[msisdn], filter[status], filter[tags]
Show child attributes
Show child attributes
Consolidated pagination parameter (deepObject style). Originally: page[number], page[size]
Show child attributes
Show child attributes
It includes the associated SIM card group object in the response when present.
Example:
true
A valid SIM card group ID.
Example:
"47a1c2b0-cc7b-4ab1-bb98-b33fb0fc61b9"
Sorts SIM cards by the given field. Defaults to ascending order unless field is prefixed with a minus sign.
Available options:
current_billing_period_consumed_data.amount, -current_billing_period_consumed_data.amount Was this page helpful?
⌘I
JavaScript
import Telnyx from 'telnyx';
const client = new Telnyx({
apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
});
// Automatically fetches more pages as needed.
for await (const simpleSimCard of client.simCards.list()) {
console.log(simpleSimCard.id);
}import os
from telnyx import Telnyx
client = Telnyx(
api_key=os.environ.get("TELNYX_API_KEY"), # This is the default and can be omitted
)
page = client.sim_cards.list()
page = page.data[0]
print(page.id)package main
import (
"context"
"fmt"
"github.com/team-telnyx/telnyx-go"
"github.com/team-telnyx/telnyx-go/option"
)
func main() {
client := telnyx.NewClient(
option.WithAPIKey("My API Key"),
)
page, err := client.SimCards.List(context.TODO(), telnyx.SimCardListParams{})
if err != nil {
panic(err.Error())
}
fmt.Printf("%+v\n", page)
}package com.telnyx.sdk.example;
import com.telnyx.sdk.client.TelnyxClient;
import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
import com.telnyx.sdk.models.simcards.SimCardListPage;
import com.telnyx.sdk.models.simcards.SimCardListParams;
public final class Main {
private Main() {}
public static void main(String[] args) {
TelnyxClient client = TelnyxOkHttpClient.fromEnv();
SimCardListPage page = client.simCards().list();
}
}require "telnyx"
telnyx = Telnyx::Client.new(api_key: "My API Key")
page = telnyx.sim_cards.list
puts(page)<?php
require_once dirname(__DIR__) . '/vendor/autoload.php';
use Telnyx\Client;
use Telnyx\Core\Exceptions\APIException;
$client = new Client(apiKey: getenv('TELNYX_API_KEY') ?: 'My API Key');
try {
$page = $client->simCards->list(
filter: [
'iccid' => '89310410106543789301',
'msisdn' => '+13109976224',
'status' => ['enabled'],
'tags' => ['personal', 'customers', 'active-customers'],
],
filterSimCardGroupID: '47a1c2b0-cc7b-4ab1-bb98-b33fb0fc61b9',
includeSimCardGroup: true,
pageNumber: 0,
pageSize: 0,
sort: 'current_billing_period_consumed_data.amount',
);
var_dump($page);
} catch (APIException $e) {
echo $e->getMessage();
}telnyx sim-cards list \
--api-key 'My API Key'curl --request GET \
--url https://api.telnyx.com/v2/sim_cards \
--header 'Authorization: Bearer <token>'{
"data": [
{
"id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"record_type": "sim_card",
"status": {
"value": "enabled",
"reason": "The SIM card is active, ready to connect to networks and consume data."
},
"type": "physical",
"iccid": "89310410106543789301",
"imsi": "081932214823362973",
"msisdn": "+13109976224",
"sim_card_group_id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"tags": [
"personal",
"customers",
"active-customers"
],
"data_limit": {
"amount": "2048.0",
"unit": "MB"
},
"current_billing_period_consumed_data": {
"amount": "2049.0",
"unit": "MB"
},
"actions_in_progress": true,
"created_at": "2018-02-02T22:25:27.521Z",
"updated_at": "2018-02-02T22:25:27.521Z",
"esim_installation_status": "released",
"version": "4.3",
"resources_with_in_progress_actions": [],
"eid": null,
"authorized_imeis": [
"106516771852751",
"534051870479563",
"508821468377961"
],
"voice_enabled": false
}
],
"meta": {
"total_pages": 3,
"total_results": 55,
"page_number": 2,
"page_size": 25
}
}{
"errors": [
{
"code": "<string>",
"title": "<string>",
"detail": "<string>",
"source": {
"pointer": "<string>",
"parameter": "<string>"
},
"meta": {}
}
]
}