> ## Documentation Index
> Fetch the complete documentation index at: https://developers.telnyx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get SIM card public IP definition

> It returns the public IP requested for a SIM card.




## OpenAPI

````yaml /openapi/source/external/wireless/wireless.json get /sim_cards/{id}/public_ip
openapi: 3.1.0
info:
  version: 2.0.0
  title: Telnyx API
  x-latency-category: responsive
  x-endpoint-cost: light
  description: SIP trunking, SMS, MMS, Call Control and Telephony Data Services.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
    description: Version 2.0.0 of the Telnyx API.
security:
  - bearerAuth: []
tags:
  - name: Wireless
    description: Wireless operations
  - name: SIM Cards
    description: SIM Cards operations
  - name: SIM Card Actions
    description: >-
      View SIM card actions, their progress and timestamps using the SIM Card
      Actions API
  - name: SIM Card Groups
    description: SIM Card Groups operations
  - name: SIM Card Group Actions
    description: SIM Card Group actions operations
  - name: SIM Card Orders
    description: SIM Card Orders operations
  - name: Reporting
    description: Wireless reporting operations
  - name: Wireless Regions
    description: Regions for wireless services
  - name: OTA updates
    description: OTA updates operations
  - name: Mobile Network Operators
    description: Mobile network operators operations
  - name: Private Wireless Gateways
    description: Private Wireless Gateways operations
  - name: Wireless Blocklists
    description: Wireless Blocklists operations
  - name: Traffic Policy Profiles
    description: Traffic Policy Profiles operations
paths:
  /sim_cards/{id}/public_ip:
    get:
      tags:
        - SIM Cards
      summary: Get SIM card public IP definition
      description: |
        It returns the public IP requested for a SIM card.
      operationId: GetSimCardPublicIp
      parameters:
        - $ref: '#/components/parameters/SIMCardId'
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    $ref: '#/components/schemas/SIMCardPublicIP'
        '401':
          description: Unauthorized
        default:
          $ref: '#/components/responses/GenericErrorResponse'
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Telnyx from 'telnyx';


            const client = new Telnyx({
              apiKey: process.env['TELNYX_API_KEY'], // This is the default and can be omitted
            });


            const response = await
            client.simCards.getPublicIP('6a09cdc3-8948-47f0-aa62-74ac943d6c58');


            console.log(response.data);
        - lang: Python
          source: |
            import os
            from telnyx import Telnyx

            client = Telnyx(
                api_key=os.environ.get("TELNYX_API_KEY"),  # This is the default and can be omitted
            )
            response = client.sim_cards.get_public_ip(
                "6a09cdc3-8948-47f0-aa62-74ac943d6c58",
            )
            print(response.data)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/team-telnyx/telnyx-go\"\n\t\"github.com/team-telnyx/telnyx-go/option\"\n)\n\nfunc main() {\n\tclient := telnyx.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tresponse, err := client.SimCards.GetPublicIP(context.TODO(), \"6a09cdc3-8948-47f0-aa62-74ac943d6c58\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Data)\n}\n"
        - lang: Java
          source: |-
            package com.telnyx.sdk.example;

            import com.telnyx.sdk.client.TelnyxClient;
            import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient;
            import com.telnyx.sdk.models.simcards.SimCardGetPublicIpParams;
            import com.telnyx.sdk.models.simcards.SimCardGetPublicIpResponse;

            public final class Main {
                private Main() {}

                public static void main(String[] args) {
                    TelnyxClient client = TelnyxOkHttpClient.fromEnv();

                    SimCardGetPublicIpResponse response = client.simCards().getPublicIp("6a09cdc3-8948-47f0-aa62-74ac943d6c58");
                }
            }
        - lang: Ruby
          source: >-
            require "telnyx"


            telnyx = Telnyx::Client.new(api_key: "My API Key")


            response =
            telnyx.sim_cards.get_public_ip("6a09cdc3-8948-47f0-aa62-74ac943d6c58")


            puts(response)
        - lang: PHP
          source: >-
            <?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 {
              $response = $client->simCards->getPublicIP(
                '6a09cdc3-8948-47f0-aa62-74ac943d6c58'
              );

              var_dump($response);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx sim-cards get-public-ip \
              --api-key 'My API Key' \
              --id 6a09cdc3-8948-47f0-aa62-74ac943d6c58
components:
  parameters:
    SIMCardId:
      name: id
      description: Identifies the SIM.
      in: path
      required: true
      schema:
        format: uuid
        type: string
        example: 6a09cdc3-8948-47f0-aa62-74ac943d6c58
  schemas:
    SIMCardPublicIP:
      type: object
      title: SIMCardPublicIP
      properties:
        record_type:
          type: string
          example: sim_card_public_ip
          readOnly: true
        region_code:
          type: string
          example: dc2
          readOnly: true
        sim_card_id:
          type: string
          format: uuid
          example: 6b14e151-8493-4fa1-8664-1cc4e6d14158
        type:
          type: string
          enum:
            - ipv4
          default: ipv4
          example: ipv4
          readOnly: true
        ip:
          type: string
          description: >-
            The provisioned IP address. This attribute will only be available
            when underlying resource status is in a "provisioned" status.
          example: 192.168.0.0
          readOnly: true
          default: null
        created_at:
          type: string
          description: >-
            ISO 8601 formatted date-time indicating when the resource was
            created.
          readOnly: true
          example: '2018-02-02T22:25:27.521Z'
        updated_at:
          type: string
          description: >-
            ISO 8601 formatted date-time indicating when the resource was
            updated.
          readOnly: true
          example: '2018-02-02T22:25:27.521Z'
    Errors:
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/Error'
      type: object
    Error:
      required:
        - code
        - title
      properties:
        code:
          type: string
        title:
          type: string
        detail:
          type: string
        source:
          type: object
          properties:
            pointer:
              description: JSON pointer (RFC6901) to the offending entity.
              type: string
            parameter:
              description: Indicates which query parameter caused the error.
              type: string
        meta:
          type: object
          additionalProperties: true
      type: object
  responses:
    GenericErrorResponse:
      description: Unexpected error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Errors'
          examples:
            unexpectedError:
              summary: Unexpected API error
              value:
                errors:
                  - code: '10007'
                    title: Unexpected error
                    detail: An unexpected error occured.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````