> ## 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.

# Retrieve the associated V1 sub_request_id and port_request_id

> Retrieve the associated V1 sub_request_id and port_request_id



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/numbers-identity/porting-activation.yml get /porting_orders/{id}/sub_request
openapi: 3.1.0
info:
  title: Telnyx Porting Activation API
  version: 2.0.0
  description: API for porting activation jobs, exceptions, and sub requests.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /porting_orders/{id}/sub_request:
    get:
      tags:
        - Porting Orders
      summary: Retrieve the associated V1 sub_request_id and port_request_id
      description: Retrieve the associated V1 sub_request_id and port_request_id
      operationId: GetPortingOrderSubRequest
      parameters:
        - $ref: '#/components/parameters/PathPortingOrderID'
      responses:
        '200':
          $ref: '#/components/responses/SubRequestByPortingOrder'
        '401':
          description: Unauthorized
        '404':
          description: Porting Order not found
      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.portingOrders.retrieveSubRequest(
              '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
            );

            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.porting_orders.retrieve_sub_request(
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            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.PortingOrders.GetSubRequest(context.TODO(), \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\")\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.portingorders.PortingOrderRetrieveSubRequestParams;

            import
            com.telnyx.sdk.models.portingorders.PortingOrderRetrieveSubRequestResponse;


            public final class Main {
                private Main() {}

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

                    PortingOrderRetrieveSubRequestResponse response = client.portingOrders().retrieveSubRequest("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e");
                }
            }
        - lang: Ruby
          source: >-
            require "telnyx"


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


            response =
            telnyx.porting_orders.retrieve_sub_request("182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e")


            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->portingOrders->retrieveSubRequest(
                '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e'
              );

              var_dump($response);
            } catch (APIException $e) {
              echo $e->getMessage();
            }
        - lang: CLI
          source: |-
            telnyx porting-orders retrieve-sub-request \
              --api-key 'My API Key' \
              --id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e
components:
  parameters:
    PathPortingOrderID:
      name: id
      description: Porting Order id
      in: path
      required: true
      schema:
        type: string
        format: uuid
  responses:
    SubRequestByPortingOrder:
      description: Successful response
      content:
        application/json:
          schema:
            type: object
            properties:
              data:
                $ref: '#/components/schemas/GetSubRequestByPortingOrder'
  schemas:
    GetSubRequestByPortingOrder:
      type: object
      properties:
        sub_request_id:
          type: string
          description: Identifies the Sub Request associated with the Porting Order
          example: 9787fb5f-cbe5-4de4-b765-3303774ee9fe
        port_request_id:
          type: string
          description: Identifies the Port Request associated with the Porting Order
          example: 59b0762a-b274-4f76-ac32-4d5cf0272e66
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````