$npx -y skills add team-telnyx/ai --skill telnyx-10dlc-java10DLC brand and campaign registration for US A2P messaging compliance. Assign phone numbers to campaigns.
| 1 | <!-- Auto-generated from Telnyx OpenAPI specs. Do not edit. --> |
| 2 | |
| 3 | # Telnyx 10DLC - Java |
| 4 | |
| 5 | ## Installation |
| 6 | |
| 7 | ```text |
| 8 | <!-- Maven --> |
| 9 | <dependency> |
| 10 | <groupId>com.telnyx.sdk</groupId> |
| 11 | <artifactId>telnyx</artifactId> |
| 12 | <version>6.82.0</version> |
| 13 | </dependency> |
| 14 | |
| 15 | // Gradle |
| 16 | implementation("com.telnyx.sdk:telnyx:6.82.0") |
| 17 | ``` |
| 18 | |
| 19 | ## Setup |
| 20 | |
| 21 | ```java |
| 22 | import com.telnyx.sdk.client.TelnyxClient; |
| 23 | import com.telnyx.sdk.client.okhttp.TelnyxOkHttpClient; |
| 24 | |
| 25 | TelnyxClient client = TelnyxOkHttpClient.fromEnv(); |
| 26 | ``` |
| 27 | |
| 28 | All examples below assume `client` is already initialized as shown above. |
| 29 | |
| 30 | ## Error Handling |
| 31 | |
| 32 | All API calls can fail with network errors, rate limits (429), validation errors (422), |
| 33 | or authentication errors (401). Always handle errors in production code: |
| 34 | |
| 35 | ```java |
| 36 | import com.telnyx.sdk.models.messaging10dlc.brand.BrandCreateParams; |
| 37 | import com.telnyx.sdk.models.messaging10dlc.brand.EntityType; |
| 38 | import com.telnyx.sdk.models.messaging10dlc.brand.TelnyxBrand; |
| 39 | import com.telnyx.sdk.models.messaging10dlc.brand.Vertical; |
| 40 | BrandCreateParams params = BrandCreateParams.builder() |
| 41 | .country("US") |
| 42 | .displayName("ABC Mobile") |
| 43 | .email("support@example.com") |
| 44 | .entityType(EntityType.PRIVATE_PROFIT) |
| 45 | .vertical(Vertical.TECHNOLOGY) |
| 46 | .build(); |
| 47 | TelnyxBrand telnyxBrand = client.messaging10dlc().brand().create(params); |
| 48 | ``` |
| 49 | |
| 50 | Common error codes: `401` invalid API key, `403` insufficient permissions, |
| 51 | `404` resource not found, `422` validation error (check field formats), |
| 52 | `429` rate limited (retry with exponential backoff). |
| 53 | |
| 54 | ## Important Notes |
| 55 | |
| 56 | - **Pagination:** List methods return a page. Use `.autoPager()` for automatic iteration: `for (var item : page.autoPager()) { ... }`. For manual control, use `.hasNextPage()` and `.nextPage()`. |
| 57 | |
| 58 | ## Operational Caveats |
| 59 | |
| 60 | - 10DLC is sequential: create the brand first, then submit the campaign, then attach messaging infrastructure such as the messaging profile. |
| 61 | - Registration calls are not enough by themselves. Messaging cannot use the campaign until the assignment step completes successfully. |
| 62 | - Treat registration status fields as part of the control flow. Do not assume the campaign is send-ready until the returned status fields confirm it. |
| 63 | |
| 64 | ## Reference Use Rules |
| 65 | |
| 66 | Do not invent Telnyx parameters, enums, response fields, or webhook fields. |
| 67 | |
| 68 | - If the parameter, enum, or response field you need is not shown inline in this skill, read [references/api-details.md](references/api-details.md) before writing code. |
| 69 | - Before using any operation in `## Additional Operations`, read [the optional-parameters section](references/api-details.md#optional-parameters) and [the response-schemas section](references/api-details.md#response-schemas). |
| 70 | - Before reading or matching webhook fields beyond the inline examples, read [the webhook payload reference](references/api-details.md#webhook-payload-fields). |
| 71 | |
| 72 | ## Core Tasks |
| 73 | |
| 74 | ### Create a brand |
| 75 | |
| 76 | Brand registration is the entrypoint for any US A2P 10DLC campaign flow. |
| 77 | |
| 78 | `client.messaging10dlc().brand().create()` — `POST /10dlc/brand` |
| 79 | |
| 80 | | Parameter | Type | Required | Description | |
| 81 | |-----------|------|----------|-------------| |
| 82 | | `entityType` | object | Yes | Entity type behind the brand. | |
| 83 | | `displayName` | string | Yes | Display name, marketing name, or DBA name of the brand. | |
| 84 | | `country` | string | Yes | ISO2 2 characters country code. | |
| 85 | | `email` | string | Yes | Valid email address of brand support contact. | |
| 86 | | `vertical` | object | Yes | Vertical or industry segment of the brand. | |
| 87 | | `companyName` | string | No | (Required for Non-profit/private/public) Legal company name. | |
| 88 | | `firstName` | string | No | First name of business contact. | |
| 89 | | `lastName` | string | No | Last name of business contact. | |
| 90 | | ... | | | +16 optional params in [references/api-details.md](references/api-details.md) | |
| 91 | |
| 92 | ```java |
| 93 | import com.telnyx.sdk.models.messaging10dlc.brand.BrandCreateParams; |
| 94 | import com.telnyx.sdk.models.messaging10dlc.brand.EntityType; |
| 95 | import com.telnyx.sdk.models.messaging10dlc.brand.TelnyxBrand; |
| 96 | import com.telnyx.sdk.models.messaging10dlc.brand.Vertical; |
| 97 | |
| 98 | BrandCreateParams params = BrandCreateParams.builder() |
| 99 | .country("US") |
| 100 | .displayName("ABC Mobile") |
| 101 | .email("support@example.com") |
| 102 | .entityType(EntityType.PRIVATE_PROFIT) |
| 103 | .vertical(Vertical.TECHNOLOGY) |
| 104 | .build(); |
| 105 | TelnyxBrand telnyxBrand = client.messaging10dlc().brand().create(params); |
| 106 | ``` |
| 107 | |
| 108 | Primary response fields: |
| 109 | - `telnyxBrand.brandId` |
| 110 | - `telnyxBrand.identityStatus` |
| 111 | - `telnyxBrand.status` |
| 112 | - `telnyxBrand.displayName` |
| 113 | - `telnyxBrand.state` |
| 114 | - `telnyxBrand.altBusinessId` |
| 115 | |
| 116 | ### Submit a campaign |
| 117 | |
| 118 | Campaign submission is the compliance-critical step that determines whether traffic can be provisioned. |
| 119 | |
| 120 | `client.messaging10dlc().cam |