SIM Cards
- cURL
- Python
- Ruby
- Node
- PHP
- Java
- .NET
curl -X GET \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: Bearer YOUR_API_KEY" \
--globoff "https://api.telnyx.com/v2/sim_cards?page[size]=10&filter[tags][]=region_5&filter[tags][]=ext_cards"
In query
The page number to load
The size of the page
It includes the associated SIM card group object in the response when present.
A valid SIM card group ID.
A list of SIM card tags to filter on.
If the SIM card contains all of the given tags
they will be found.
For example, if the SIM cards have the following tags:
['customers', 'staff', 'test']
['test']
['customers']
['customers', 'test']
returns only the first because it's the only one with both tags.Searching for
test
returns the first two SIMs, because both of them have such tag.Searching for
customers
returns the first and last SIMs.A search string to partially match for the SIM card's ICCID.
Successful response
Unexpected error
- JSON
- Schema
{
"data": [
{
"created_at": "2018-02-02T22:25:27.521Z",
"iccid": "89310410106543789301",
"id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"imsi": 81932214823362980,
"msisdn": "+13109976224",
"record_type": "sim_card",
"sim_card_group_id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"status": "enabled",
"tags": [
"personal",
"customers",
"active-customers"
],
"updated_at": "2018-02-02T22:25:27.521Z"
}
],
"meta": {
"page_number": 2,
"page_size": 25,
"total_pages": 3,
"total_results": 55
}
}
- cURL
- Python
- Ruby
- Node
- PHP
- Java
- .NET
curl -X GET \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: Bearer YOUR_API_KEY" \
--globoff "https://api.telnyx.com/v2/sim_cards/6a09cdc3-8948-47f0-aa62-74ac943d6c58?include_sim_card_group=true"
In path
Identifies the resource.
In query
It includes the associated SIM card group object in the response when present.
Successful response
Unexpected error
- JSON
- Schema
{
"data": {
"created_at": "2018-02-02T22:25:27.521Z",
"iccid": "89310410106543789301",
"id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"imsi": 81932214823362980,
"ipv4": "192.168.0.0",
"ipv6": "2001:cdba:0000:0000:0000:0000:3257:9652",
"msisdn": "+13109976224",
"record_type": "sim_card",
"sim_card_group_id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"status": "enabled",
"tags": [
"personal",
"customers",
"active-customers"
],
"updated_at": "2018-02-02T22:25:27.521Z"
}
}
- cURL
- Python
- Ruby
- Node
- PHP
- Java
- .NET
curl -X PATCH \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: Bearer YOUR_API_KEY" \
--data '{"tags": ["region_7", "int_cards"]}' \
https://api.telnyx.com/v2/sim_cards/6a09cdc3-8948-47f0-aa62-74ac943d6c58
In path
Identifies the resource.
In body
The group SIMCardGroup identification. This attribute can be null
when it's present in an associated resource.
Searchable tags associated with the SIM card
Successful response
Unexpected error
- JSON
- Schema
{
"data": {
"created_at": "2018-02-02T22:25:27.521Z",
"iccid": "89310410106543789301",
"id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"imsi": 81932214823362980,
"ipv4": "192.168.0.0",
"ipv6": "2001:cdba:0000:0000:0000:0000:3257:9652",
"msisdn": "+13109976224",
"record_type": "sim_card",
"sim_card_group_id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"status": "enabled",
"tags": [
"personal",
"customers",
"active-customers"
],
"updated_at": "2018-02-02T22:25:27.521Z"
}
}
Deletes a SIM card' fill-rule='evenodd'%3E %3Cpath d='M7.778 7.975a2.5 2.5 0 0 0 .347-3.837L6.017 2.03a2.498 2.498 0 0 0-3.542-.007 2.5 2.5 0 0 0 .006 3.543l1.153 1.15c.07-.29.154-.563.25-.773.036-.077.084-.16.14-.25L3.18 4.85a1.496 1.496 0 0 1 .002-2.12 1.496 1.496 0 0 1 2.12 0l2.124 2.123a1.496 1.496 0 0 1-.333 2.37c.16.246.42.504.685.752z'/%3E %3Cpath d='M5.657 4.557a2.5 2.5 0 0 0-.347 3.837l2.108 2.108a2.498 2.498 0 0 0 3.542.007 2.5 2.5 0 0 0-.006-3.543L9.802 5.815c-.07.29-.154.565-.25.774-.036.076-.084.16-.14.25l.842.84c.585.587.59 1.532 0 2.122-.587.585-1.532.59-2.12 0L6.008 7.68a1.496 1.496 0 0 1 .332-2.372c-.16-.245-.42-.503-.685-.75z'/%3E %3C/g%3E %3C/svg%3E)
The SIM card will be decommissioned, removed from your account and you will stop being charged.
The SIM card won't be able to connect to the network after the deletion is completed, thus making it impossible to consume data.
Transitioning to the disabled state may take a period of time.
Until the transition is completed, the SIM card status will be disabling disabling
.
In order to re-enable the SIM card, you will need to re-register it.
- cURL
- Python
- Ruby
- Node
- PHP
- Java
- .NET
curl -X DELETE \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: Bearer YOUR_API_KEY" \
"https://api.telnyx.com/v2/sim_cards/6a09cdc3-8948-47f0-aa62-74ac943d6c58"
In path
Identifies the resource.
Successful response
Unexpected error
- JSON
- Schema
{
"data": {
"created_at": "2018-02-02T22:25:27.521Z",
"iccid": "89310410106543789301",
"id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"imsi": 81932214823362980,
"ipv4": "192.168.0.0",
"ipv6": "2001:cdba:0000:0000:0000:0000:3257:9652",
"msisdn": "+13109976224",
"record_type": "sim_card",
"sim_card_group_id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"status": "enabled",
"tags": [
"personal",
"customers",
"active-customers"
],
"updated_at": "2018-02-02T22:25:27.521Z"
}
}
Request a SIM card enable' fill-rule='evenodd'%3E %3Cpath d='M7.778 7.975a2.5 2.5 0 0 0 .347-3.837L6.017 2.03a2.498 2.498 0 0 0-3.542-.007 2.5 2.5 0 0 0 .006 3.543l1.153 1.15c.07-.29.154-.563.25-.773.036-.077.084-.16.14-.25L3.18 4.85a1.496 1.496 0 0 1 .002-2.12 1.496 1.496 0 0 1 2.12 0l2.124 2.123a1.496 1.496 0 0 1-.333 2.37c.16.246.42.504.685.752z'/%3E %3Cpath d='M5.657 4.557a2.5 2.5 0 0 0-.347 3.837l2.108 2.108a2.498 2.498 0 0 0 3.542.007 2.5 2.5 0 0 0-.006-3.543L9.802 5.815c-.07.29-.154.565-.25.774-.036.076-.084.16-.14.25l.842.84c.585.587.59 1.532 0 2.122-.587.585-1.532.59-2.12 0L6.008 7.68a1.496 1.496 0 0 1 .332-2.372c-.16-.245-.42-.503-.685-.75z'/%3E %3C/g%3E %3C/svg%3E)
The SIM card will be able to connect to the network once the enabling is complete, thus making it possible to consume data.
To enable a SIM card, it must be associated with SIM card group.
Transitioning to the enabled state may take a period of time. Until the transition is completed, the SIM card status will be enabling
.
- cURL
- Python
- Ruby
- Node
- PHP
- Java
- .NET
curl -X POST \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: Bearer YOUR_API_KEY" \
--data '{}' \
https://api.telnyx.com/v2/sim_cards/6a09cdc3-8948-47f0-aa62-74ac943d6c58/actions/enable
In path
Identifies the resource.
Successful response
Unprocessable entity. Check the 'detail' field in response for details.
Unexpected error
- JSON
- Schema
{
"data": {
"created_at": "2018-02-02T22:25:27.521Z",
"iccid": "89310410106543789301",
"id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"imsi": 81932214823362980,
"msisdn": "+13109976224",
"record_type": "sim_card",
"sim_card_group_id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"status": "enabled",
"tags": [
"personal",
"customers",
"active-customers"
],
"updated_at": "2018-02-02T22:25:27.521Z"
}
}
Request a SIM card disable' fill-rule='evenodd'%3E %3Cpath d='M7.778 7.975a2.5 2.5 0 0 0 .347-3.837L6.017 2.03a2.498 2.498 0 0 0-3.542-.007 2.5 2.5 0 0 0 .006 3.543l1.153 1.15c.07-.29.154-.563.25-.773.036-.077.084-.16.14-.25L3.18 4.85a1.496 1.496 0 0 1 .002-2.12 1.496 1.496 0 0 1 2.12 0l2.124 2.123a1.496 1.496 0 0 1-.333 2.37c.16.246.42.504.685.752z'/%3E %3Cpath d='M5.657 4.557a2.5 2.5 0 0 0-.347 3.837l2.108 2.108a2.498 2.498 0 0 0 3.542.007 2.5 2.5 0 0 0-.006-3.543L9.802 5.815c-.07.29-.154.565-.25.774-.036.076-.084.16-.14.25l.842.84c.585.587.59 1.532 0 2.122-.587.585-1.532.59-2.12 0L6.008 7.68a1.496 1.496 0 0 1 .332-2.372c-.16-.245-.42-.503-.685-.75z'/%3E %3C/g%3E %3C/svg%3E)
The SIM card won't be able to connect to the network after the disabling is completed, thus making it impossible to consume data.
Transitioning to the disabled state may take a period of time.
Until the transition is completed, the SIM card status will be disabling
.
- cURL
- Python
- Ruby
- Node
- PHP
- Java
- .NET
curl -X POST \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: Bearer YOUR_API_KEY" \
--data '{}' \
https://api.telnyx.com/v2/sim_cards/6a09cdc3-8948-47f0-aa62-74ac943d6c58/actions/disable
In path
Identifies the resource.
Successful response
Unexpected error
- JSON
- Schema
{
"data": {
"created_at": "2018-02-02T22:25:27.521Z",
"iccid": "89310410106543789301",
"id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"imsi": 81932214823362980,
"msisdn": "+13109976224",
"record_type": "sim_card",
"sim_card_group_id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"status": "enabled",
"tags": [
"personal",
"customers",
"active-customers"
],
"updated_at": "2018-02-02T22:25:27.521Z"
}
}
Register SIM cards' fill-rule='evenodd'%3E %3Cpath d='M7.778 7.975a2.5 2.5 0 0 0 .347-3.837L6.017 2.03a2.498 2.498 0 0 0-3.542-.007 2.5 2.5 0 0 0 .006 3.543l1.153 1.15c.07-.29.154-.563.25-.773.036-.077.084-.16.14-.25L3.18 4.85a1.496 1.496 0 0 1 .002-2.12 1.496 1.496 0 0 1 2.12 0l2.124 2.123a1.496 1.496 0 0 1-.333 2.37c.16.246.42.504.685.752z'/%3E %3Cpath d='M5.657 4.557a2.5 2.5 0 0 0-.347 3.837l2.108 2.108a2.498 2.498 0 0 0 3.542.007 2.5 2.5 0 0 0-.006-3.543L9.802 5.815c-.07.29-.154.565-.25.774-.036.076-.084.16-.14.25l.842.84c.585.587.59 1.532 0 2.122-.587.585-1.532.59-2.12 0L6.008 7.68a1.496 1.496 0 0 1 .332-2.372c-.16-.245-.42-.503-.685-.75z'/%3E %3C/g%3E %3C/svg%3E)
Register the SIM cards associated with the provided registration codes to the current user's account.
If sim_card_group_id
is provided, the SIM cards will be associated with that group. Otherwise, the default group for the current user will be used.
- cURL
- Python
- Ruby
- Node
- PHP
- Java
- .NET
curl -X POST \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: Bearer YOUR_API_KEY" \
--data '{"registration_codes": ["1234567890, 123456332601"]}' \
https://api.telnyx.com/v2/actions/register/sim_cards
In body
The group SIMCardGroup identification. This attribute can be null
when it's present in an associated resource.
Searchable tags associated with the SIM card
Successful response
- JSON
- Schema
{
"data": [
{
"created_at": "2018-02-02T22:25:27.521Z",
"iccid": "89310410106543789301",
"id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"imsi": 81932214823362980,
"msisdn": "+13109976224",
"record_type": "sim_card",
"sim_card_group_id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"status": "enabled",
"tags": [
"personal",
"customers",
"active-customers"
],
"updated_at": "2018-02-02T22:25:27.521Z"
}
]
}
- cURL
- Python
- Ruby
- Node
- PHP
- Java
- .NET
curl -X GET \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: Bearer YOUR_API_KEY" \
--globoff "https://api.telnyx.com/v2/sim_cards/6a09cdc3-8948-47f0-aa62-74ac943d6c58/network_preferences?include_ota_updates=true"
In path
Identifies a SIM card.
In query
It includes the associated OTA update objects in the response when present.
A successful network preferences definition response.
Unexpected error
- JSON
- Schema
{
"data": {
"created_at": "2018-02-02T22:25:27.521Z",
"mobile_operator_networks_preferences": [
{
"mobile_operator_network_id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"mobile_operator_network_name": "AT&T Mobility (USACG)",
"priority": 0
}
],
"ota_updates": [
{
"created_at": "2018-02-02T22:25:27.521Z",
"id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"record_type": "ota_update",
"settings": {
"mobile_operator_networks_preferences": [
{
"mobile_operator_network_id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"mobile_operator_network_name": "AT&T Mobility (USACG)",
"priority": 0
}
]
},
"sim_card_id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"status": "in-progress",
"type": "sim_card_network_preferences",
"updated_at": "2018-02-02T22:25:27.521Z"
}
],
"record_type": "sim_card_network_preferences",
"sim_card_id": "6b14e151-8493-4fa1-8664-1cc4e6d14158",
"updated_at": "2018-02-02T22:25:27.521Z"
}
}
Set network preferences' fill-rule='evenodd'%3E %3Cpath d='M7.778 7.975a2.5 2.5 0 0 0 .347-3.837L6.017 2.03a2.498 2.498 0 0 0-3.542-.007 2.5 2.5 0 0 0 .006 3.543l1.153 1.15c.07-.29.154-.563.25-.773.036-.077.084-.16.14-.25L3.18 4.85a1.496 1.496 0 0 1 .002-2.12 1.496 1.496 0 0 1 2.12 0l2.124 2.123a1.496 1.496 0 0 1-.333 2.37c.16.246.42.504.685.752z'/%3E %3Cpath d='M5.657 4.557a2.5 2.5 0 0 0-.347 3.837l2.108 2.108a2.498 2.498 0 0 0 3.542.007 2.5 2.5 0 0 0-.006-3.543L9.802 5.815c-.07.29-.154.565-.25.774-.036.076-.084.16-.14.25l.842.84c.585.587.59 1.532 0 2.122-.587.585-1.532.59-2.12 0L6.008 7.68a1.496 1.496 0 0 1 .332-2.372c-.16-.245-.42-.503-.685-.75z'/%3E %3C/g%3E %3C/svg%3E)
This API allows setting or updating a SIM card network preference.
Every SIM card has default network preferences defined on Telnyx. These preferences will determine how a SIMCard will connect to the network by considering a list of preferable operators.
There can be multiple scenarios where an operator can be preferred over another, for example, when a specific mobile operator can provide better network latency or better pricing.
- cURL
- Python
- Ruby
- Node
- PHP
- Java
- .NET
curl -X PUT \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: Bearer YOUR_API_KEY" \
--data '{"mobile_operator_networks_preferences":"array"}' \
https://api.telnyx.com/v2/sim_cards/6a09cdc3-8948-47f0-aa62-74ac943d6c58/network_preferences
In path
Identifies a SIM card.
In body
A list of mobile operator networks and the priority that should be applied when the SIM is connecting to the network.
The mobile operator network resource identification UUID.
It determines what is the priority of a specific operator network that should be assumed by a SIM card when connecting to a network. The highest priority is 0, the second highest is 1 and so on.
A successful network preferences definition response.
The sent mobile_operator_networks_preferences parameter won't be applied to the main resource right away - this is an asynchronous operation. While interacting with this API, you will face the following scenarios:
* The first request for this API will return an empty mobile_operator_networks_preferences with an in-progress OTA update resource in the ota_updates node containing the exact sent parameters to indicate the operation progress. The value will be applied to the principal object when the OTA update finishes its processing, thus indicating the SIM card network preference current state.
* The subsequent requests will contain the current state, that is what's applied to the SIM card settings, and return the related OTA update in the ota_updates node.
The returned OTA updated (present in the ota_updates node) will, by default, be the resource related to the operation, not all of them.
Unexpected error
- JSON
- Schema
{
"data": {
"created_at": "2018-02-02T22:25:27.521Z",
"mobile_operator_networks_preferences": [
{
"mobile_operator_network_id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"mobile_operator_network_name": "AT&T Mobility (USACG)",
"priority": 0
}
],
"ota_updates": [
{
"created_at": "2018-02-02T22:25:27.521Z",
"id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"record_type": "ota_update",
"settings": {
"mobile_operator_networks_preferences": [
{
"mobile_operator_network_id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"mobile_operator_network_name": "AT&T Mobility (USACG)",
"priority": 0
}
]
},
"sim_card_id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"status": "in-progress",
"type": "sim_card_network_preferences",
"updated_at": "2018-02-02T22:25:27.521Z"
}
],
"record_type": "sim_card_network_preferences",
"sim_card_id": "6b14e151-8493-4fa1-8664-1cc4e6d14158",
"updated_at": "2018-02-02T22:25:27.521Z"
}
}
DELETE network preferences' fill-rule='evenodd'%3E %3Cpath d='M7.778 7.975a2.5 2.5 0 0 0 .347-3.837L6.017 2.03a2.498 2.498 0 0 0-3.542-.007 2.5 2.5 0 0 0 .006 3.543l1.153 1.15c.07-.29.154-.563.25-.773.036-.077.084-.16.14-.25L3.18 4.85a1.496 1.496 0 0 1 .002-2.12 1.496 1.496 0 0 1 2.12 0l2.124 2.123a1.496 1.496 0 0 1-.333 2.37c.16.246.42.504.685.752z'/%3E %3Cpath d='M5.657 4.557a2.5 2.5 0 0 0-.347 3.837l2.108 2.108a2.498 2.498 0 0 0 3.542.007 2.5 2.5 0 0 0-.006-3.543L9.802 5.815c-.07.29-.154.565-.25.774-.036.076-.084.16-.14.25l.842.84c.585.587.59 1.532 0 2.122-.587.585-1.532.59-2.12 0L6.008 7.68a1.496 1.496 0 0 1 .332-2.372c-.16-.245-.42-.503-.685-.75z'/%3E %3C/g%3E %3C/svg%3E)
This API asynchronously removes the custom-defined network preferences settings. After this operation is done the Telnyx default settings, the same applied for an unaltered SIM card, will be in place.
- cURL
- Python
- Ruby
- Node
- PHP
- Java
- .NET
curl -X DELETE \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: Bearer YOUR_API_KEY" \
"https://api.telnyx.com/v2/sim_cards/6a09cdc3-8948-47f0-aa62-74ac943d6c58/network_preferences"
In path
Identifies a SIM card.
A successful network preferences deletion response.
The delete won't be done right away - this is an asynchronous operation. The request will return the resource with an in-progress OTA update resource (in the ota_updates node) representing the delete operation. Similarly to the PUT API, the resource will only be deleted when the OTA updated is successfully completed.
Unexpected error
- JSON
- Schema
{
"data": {
"created_at": "2018-02-02T22:25:27.521Z",
"mobile_operator_networks_preferences": [
{
"mobile_operator_network_id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"mobile_operator_network_name": "AT&T Mobility (USACG)",
"priority": 0
}
],
"ota_updates": [
{
"created_at": "2018-02-02T22:25:27.521Z",
"id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"record_type": "ota_update",
"settings": {
"mobile_operator_networks_preferences": [
{
"mobile_operator_network_id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"mobile_operator_network_name": "AT&T Mobility (USACG)",
"priority": 0
}
]
},
"sim_card_id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"status": "in-progress",
"type": "sim_card_network_preferences",
"updated_at": "2018-02-02T22:25:27.521Z"
}
],
"record_type": "sim_card_network_preferences",
"sim_card_id": "6b14e151-8493-4fa1-8664-1cc4e6d14158",
"updated_at": "2018-02-02T22:25:27.521Z"
}
}
Bulk Network Preferences for SIM cards' fill-rule='evenodd'%3E %3Cpath d='M7.778 7.975a2.5 2.5 0 0 0 .347-3.837L6.017 2.03a2.498 2.498 0 0 0-3.542-.007 2.5 2.5 0 0 0 .006 3.543l1.153 1.15c.07-.29.154-.563.25-.773.036-.077.084-.16.14-.25L3.18 4.85a1.496 1.496 0 0 1 .002-2.12 1.496 1.496 0 0 1 2.12 0l2.124 2.123a1.496 1.496 0 0 1-.333 2.37c.16.246.42.504.685.752z'/%3E %3Cpath d='M5.657 4.557a2.5 2.5 0 0 0-.347 3.837l2.108 2.108a2.498 2.498 0 0 0 3.542.007 2.5 2.5 0 0 0-.006-3.543L9.802 5.815c-.07.29-.154.565-.25.774-.036.076-.084.16-.14.25l.842.84c.585.587.59 1.532 0 2.122-.587.585-1.532.59-2.12 0L6.008 7.68a1.496 1.496 0 0 1 .332-2.372c-.16-.245-.42-.503-.685-.75z'/%3E %3C/g%3E %3C/svg%3E)
This API allows dispatching the same operation described for the PUT sim_cards/:sim_card_id/network_preferences API for multiple SIM cards at once.
Although, a SIM card network preference may fail individually under any validation triggered as a consequence of its state. For example, a SIM can't have an in-progress OTA update for applying a Network Preference, so they'll fail when requested in this API. In that scenario, the specific error will be present in the response along with the successful definitions in the "errors" response node.
- cURL
- Python
- Ruby
- Node
- PHP
- Java
- .NET
curl -X PUT \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: Bearer YOUR_API_KEY" \
--data '{"mobile_operator_networks_preferences":"array","sim_card_ids":["6b14e151-8493-4fa1-8664-1cc4e6d14158","6b14e151-8493-4fa1-8664-1cc4e6d14158"]}' \
https://api.telnyx.com/v2/actions/network_preferences/sim_cards
In body
A list of mobile operator networks and the priority that should be applied when the SIM is connecting to the network.
The mobile operator network resource identification UUID.
It determines what is the priority of a specific operator network that should be assumed by a SIM card when connecting to a network. The highest priority is 0, the second highest is 1 and so on.
Unprocessable entity. Check the 'detail' field in response for details.
- JSON
- Schema
{
"data": [
{
"created_at": "2018-02-02T22:25:27.521Z",
"mobile_operator_networks_preferences": [
{
"mobile_operator_network_id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"mobile_operator_network_name": "AT&T Mobility (USACG)",
"priority": 0
}
],
"ota_updates": [
{
"created_at": "2018-02-02T22:25:27.521Z",
"id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"record_type": "ota_update",
"settings": {
"mobile_operator_networks_preferences": [
{
"mobile_operator_network_id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"mobile_operator_network_name": "AT&T Mobility (USACG)",
"priority": 0
}
]
},
"sim_card_id": "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
"status": "in-progress",
"type": "sim_card_network_preferences",
"updated_at": "2018-02-02T22:25:27.521Z"
}
],
"record_type": "sim_card_network_preferences",
"sim_card_id": "6b14e151-8493-4fa1-8664-1cc4e6d14158",
"updated_at": "2018-02-02T22:25:27.521Z"
}
]
}
- cURL
- Python
- Ruby
- Node
- PHP
- Java
- .NET
curl -X GET \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: Bearer YOUR_API_KEY" \
--globoff "https://api.telnyx.com/v2/sim_cards/6a09cdc3-8948-47f0-aa62-74ac943d6c58/public_ip"
In path
Identifies a SIM card.
Successful response
Unexpected error
- JSON
- Schema
{
"data": {
"created_at": "2018-02-02T22:25:27.521Z",
"ip": "192.168.0.0",
"record_type": "sim_card_public_ip",
"sim_card_id": "6b14e151-8493-4fa1-8664-1cc4e6d14158",
"status": {
"error_code": null,
"error_description": null,
"value": "provisioned"
},
"type": "ipv4",
"updated_at": "2018-02-02T22:25:27.521Z"
}
}
Set SIM card public IP' fill-rule='evenodd'%3E %3Cpath d='M7.778 7.975a2.5 2.5 0 0 0 .347-3.837L6.017 2.03a2.498 2.498 0 0 0-3.542-.007 2.5 2.5 0 0 0 .006 3.543l1.153 1.15c.07-.29.154-.563.25-.773.036-.077.084-.16.14-.25L3.18 4.85a1.496 1.496 0 0 1 .002-2.12 1.496 1.496 0 0 1 2.12 0l2.124 2.123a1.496 1.496 0 0 1-.333 2.37c.16.246.42.504.685.752z'/%3E %3Cpath d='M5.657 4.557a2.5 2.5 0 0 0-.347 3.837l2.108 2.108a2.498 2.498 0 0 0 3.542.007 2.5 2.5 0 0 0-.006-3.543L9.802 5.815c-.07.29-.154.565-.25.774-.036.076-.084.16-.14.25l.842.84c.585.587.59 1.532 0 2.122-.587.585-1.532.59-2.12 0L6.008 7.68a1.496 1.496 0 0 1 .332-2.372c-.16-.245-.42-.503-.685-.75z'/%3E %3C/g%3E %3C/svg%3E)
This API will asynchronously map a random public IP to a SIM card, making it reachable on the public internet.
The request will return the resource as "provisioning" right away, and it'll eventually get "provisioned", meaning it completed the setup.
Setting up a public IP will generate charges, and we won't be able to provide the IP if the account doesn't have a balance. In that case, this operation will succeed, but its status will change to failed eventually, and the resource will be updated with the associated status. The IP resource will need to be deleted and re-created with our DELETE and POST APIs in this scenario.
- cURL
- Python
- Ruby
- Node
- PHP
- Java
- .NET
curl -X POST \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: Bearer YOUR_API_KEY" \
--data '{}' \
https://api.telnyx.com/v2/sim_cards/6a09cdc3-8948-47f0-aa62-74ac943d6c58/public_ip
In path
Identifies a SIM card.
A successful response on an asynchronous operation. The content in this response represents the current status of the public IP. But, it'll change during the operation processing.
Unexpected error
- JSON
- Schema
{
"data": {
"created_at": "2018-02-02T22:25:27.521Z",
"ip": "192.168.0.0",
"record_type": "sim_card_public_ip",
"sim_card_id": "6b14e151-8493-4fa1-8664-1cc4e6d14158",
"status": {
"error_code": null,
"error_description": null,
"value": "provisioned"
},
"type": "ipv4",
"updated_at": "2018-02-02T22:25:27.521Z"
}
}
- cURL
- Python
- Ruby
- Node
- PHP
- Java
- .NET
curl -X DELETE \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: Bearer YOUR_API_KEY" \
"https://api.telnyx.com/v2/sim_cards/6a09cdc3-8948-47f0-aa62-74ac943d6c58/public_ip"
In path
Identifies a SIM card.
A successful and synchronous decommission of a public IP. This response happens when no further processing is required. Therefore, a new public IP can be requested right away.
A successful response on an asynchronous operation. The content in this response represents the current status of the public IP. But, it'll change during the operation processing.
Unexpected error
- JSON
- Schema
{
"data": {
"created_at": "2018-02-02T22:25:27.521Z",
"ip": "192.168.0.0",
"record_type": "sim_card_public_ip",
"sim_card_id": "6b14e151-8493-4fa1-8664-1cc4e6d14158",
"status": {
"error_code": null,
"error_description": null,
"value": "provisioned"
},
"type": "ipv4",
"updated_at": "2018-02-02T22:25:27.521Z"
}
}