> ## 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 Single Phone Number Campaign

> Retrieve an individual phone number/campaign assignment by `phoneNumber`.



## OpenAPI

````yaml https://telnyx-openapi-ng.s3.us-east-1.amazonaws.com/messaging-10dlc/phone-number-campaigns.yml get /10dlc/phone_number_campaigns/{phoneNumber}
openapi: 3.1.0
info:
  title: Telnyx 10DLC Phone Number Campaigns API
  version: 2.0.0
  description: API for 10DLC phone number campaign assignments.
  contact:
    email: support@telnyx.com
servers:
  - url: https://api.telnyx.com/v2
security:
  - bearerAuth: []
paths:
  /10dlc/phone_number_campaigns/{phoneNumber}:
    get:
      tags:
        - Phone Number Campaigns
      summary: Get Single Phone Number Campaign
      description: >-
        Retrieve an individual phone number/campaign assignment by
        `phoneNumber`.
      operationId: GetSinglePhoneNumberCampaign
      parameters:
        - required: true
          schema:
            title: Phonenumber
            type: string
          name: phoneNumber
          in: path
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PhoneNumberCampaign'
        4XX:
          $ref: '#/components/responses/10dlc_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 phoneNumberCampaign = await
            client.messaging10dlc.phoneNumberCampaigns.retrieve(
              'phoneNumber',
            );


            console.log(phoneNumberCampaign.campaignId);
        - 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
            )

            phone_number_campaign =
            client.messaging_10dlc.phone_number_campaigns.retrieve(
                "phoneNumber",
            )

            print(phone_number_campaign.campaign_id)
        - 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\tphoneNumberCampaign, err := client.Messaging10dlc.PhoneNumberCampaigns.Get(context.TODO(), \"phoneNumber\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", phoneNumberCampaign.CampaignID)\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.messaging10dlc.phonenumbercampaigns.PhoneNumberCampaign;

            import
            com.telnyx.sdk.models.messaging10dlc.phonenumbercampaigns.PhoneNumberCampaignRetrieveParams;


            public final class Main {
                private Main() {}

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

                    PhoneNumberCampaign phoneNumberCampaign = client.messaging10dlc().phoneNumberCampaigns().retrieve("phoneNumber");
                }
            }
        - lang: Ruby
          source: >-
            require "telnyx"


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


            phone_number_campaign =
            telnyx.messaging_10dlc.phone_number_campaigns.retrieve("phoneNumber")


            puts(phone_number_campaign)
        - lang: CLI
          source: |-
            telnyx messaging-10dlc:phone-number-campaigns retrieve \
              --api-key 'My API Key' \
              --phone-number phoneNumber
components:
  schemas:
    PhoneNumberCampaign:
      title: PhoneNumberCampaign
      required:
        - phoneNumber
        - campaignId
        - createdAt
        - updatedAt
      type: object
      properties:
        phoneNumber:
          title: Phonenumber
          type: string
          example: '+18005550199'
        brandId:
          description: Brand ID. Empty if the number is associated to a shared campaign.
          title: BrandId
          type: string
          example: 7ba705b7-22af-493f-addc-ac04b7ca071c
        tcrBrandId:
          description: TCR's alphanumeric ID for the brand.
          title: TcrBrandId
          type: string
          example: BBRAND1
        campaignId:
          description: >-
            For shared campaigns, this is the TCR campaign ID, otherwise it is
            the campaign ID 
          title: Campaignid
          type: string
        tcrCampaignId:
          description: TCR's alphanumeric ID for the campaign.
          title: TcrCampaignid
          type: string
          example: CCAMPA1
        telnyxCampaignId:
          description: Campaign ID. Empty if the number is associated to a shared campaign.
          title: Telnyxcampaignid
          type: string
          example: 3008dd9f-66d7-40e0-bf23-bf2d8d1a96ba
        assignmentStatus:
          description: The assignment status of the number.
          title: AssignmentStatus
          enum:
            - FAILED_ASSIGNMENT
            - PENDING_ASSIGNMENT
            - ASSIGNED
            - PENDING_UNASSIGNMENT
            - FAILED_UNASSIGNMENT
          example: ASSIGNED
          type: string
        failureReasons:
          description: >-
            Extra info about a failure to assign/unassign a number. Relevant
            only if the assignmentStatus is either FAILED_ASSIGNMENT or
            FAILED_UNASSIGNMENT
          type: string
        createdAt:
          title: Createdat
          type: string
          example: '2021-03-08T17:57:48.801186'
        updatedAt:
          title: Updatedat
          type: string
          example: '2021-03-08T17:57:48.801186'
    10dlc_Errors:
      properties:
        errors:
          type: array
          items:
            $ref: '#/components/schemas/10dlc_Error'
      type: object
    10dlc_Error:
      required:
        - code
        - title
      type: object
      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
  responses:
    10dlc_GenericErrorResponse:
      description: Generic response error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/10dlc_Errors'
  securitySchemes:
    bearerAuth:
      scheme: bearer
      type: http

````