TSG Global API Documentation
  • Get Started
  • ISO/IEC/SOC Certification
  • Staging Environment Access
  • API Reference
    • Programmable SMS
      • Send an SMS Message
      • Receive an SMS Message
      • Delivery Receipts (DLRs)
      • SMPP
        • Headers
        • Errors
    • Programmable MMS
      • Send an MMS Message
      • Receive an MMS Message
      • Receive DLRs
      • SMTP
    • Phone Numbers
      • Search For New Available Numbers
      • Add Number to Cart
      • Get Reserved Numbers In Cart
      • Remove Reserved Number From Cart
      • Checkout Numbers in Cart
      • Disconnect Number
      • Get Number Information
      • Manage Number for SMS & 10DLC
        • Enable SMS/10DLC on a Number
        • Disable SMS on a Number
        • Update inbound SMS webhook/URI
      • Manage Number for MMS
        • Enable MMS on a Number
        • Disable MMS on a Number
        • Update inbound MMS webhook/URI
      • Manage Number for Voice
        • List Destination Priority
        • Add Destination Priority
        • Update Destination Priority
        • Delete Destination Priority
      • Protect your phone number
        • TextProtect Webhook
      • Toll-free phone numbers - search & ordering
    • Data Services
      • CNAM Lookup
      • Lookup SMS Carrier
    • Reports
      • CDR Records
        • Get Count of CDR Records
        • Get CDR Records
    • Compliance & Identity
      • Business Identity & 10DLC (TNID v1)
      • Toll-Free Verified Sender (Order)
      • Short Code Submission (Order)
  • GraphQL API & Authentication
Powered by GitBook
On this page
  • Overview
  • Authentication
  • Mutation - Submit a short code form (order)
  • Sample arguments
  • Query - list short code form orders

Was this helpful?

  1. API Reference
  2. Compliance & Identity

Short Code Submission (Order)

PreviousToll-Free Verified Sender (Order)NextGraphQL API & Authentication

Last updated 2 years ago

Was this helpful?

Overview

This form allows you to order short code numbers for your messaging campaigns.

Authentication

This function is available via our new GraphQL API. You can read more about how to authenticate to this API .

Mutation - Submit a short code form (order)

Using a GraphQL mutation you can submit the form, the example command is below. This creates an order which will be verified and the short code numbers will be ordered based on the submitted data.

mutation (
    $businessName: String!
    $businessRegisteredAddress: String!
    $businessRegisteredCity: String!
    $businessRegisteredState: String!
    $businessRegisteredZip: String!
    $businessContactFirstName: String!
    $businessContactLastName: String!
    $businessContactEmail: String!
    $businessContactPhone: String!
    $useCase: String!
    $termsAndConditionsWebsite: String!
    $privacyPolicyWebsite: String!
    $callToActionLocations: String!
    $callToActionLanguage: String!
    $optInKeywords: String!
    $optInConfirmation: String!
    $welcomeMessage: String!
    $exampleAlerts: String!
    $helpResponseText: String!
    $stopResponseText: String!
    $customerSupportContactEmail: String!
    $customerSupportContactPhone: String!
    $customerSupportUrl: String!
    $attachments: [String!]!
  ) {
    submitShortcodeForm(
      businessName: $businessName,
      businessRegisteredAddress: $businessRegisteredAddress,
      businessRegisteredCity: $businessRegisteredCity,
      businessRegisteredState: $businessRegisteredState,
      businessRegisteredZip: $businessRegisteredZip,
      businessContactFirstName: $businessContactFirstName,
      businessContactLastName: $businessContactLastName,
      businessContactEmail: $businessContactEmail,
      businessContactPhone: $businessContactPhone,
      useCase: $useCase,
      termsAndConditionsWebsite: $termsAndConditionsWebsite,
      privacyPolicyWebsite: $privacyPolicyWebsite,
      callToActionLocations: $callToActionLocations,
      callToActionLanguage: $callToActionLanguage,
      optInKeywords: $optInKeywords,
      optInConfirmation: $optInConfirmation,
      welcomeMessage: $welcomeMessage,
      exampleAlerts: $exampleAlerts,
      helpResponseText: $helpResponseText,
      stopResponseText: $stopResponseText,
      customerSupportContactEmail: $customerSupportContactEmail,
      customerSupportContactPhone: $customerSupportContactPhone,
      customerSupportUrl: $customerSupportUrl,
      attachments: $attachments,
    ) {
      id
      publicId
      insertedAt
      name
      status
      statusNote
      finishedAt
      data {
        ...ShortcodeFormFields
      }
    }
  }

fragment ShortcodeFormFields on ShortcodeFormOrderData {
  type
  businessName
  businessRegisteredAddress
  businessRegisteredCity
  businessRegisteredState
  businessRegisteredZip
  businessContactFirstName
  businessContactLastName
  businessContactEmail
  businessContactPhone
  useCase
  termsAndConditionsWebsite
  privacyPolicyWebsite
  callToActionLocations
  callToActionLanguage
  optInKeywords
  optInConfirmation
  welcomeMessage
  exampleAlerts
  helpResponseText
  stopResponseText
  customerSupportContactEmail
  customerSupportContactPhone
  customerSupportUrl
  attachments
}

Sample arguments

The payload should be formatted like this, do note that the attachments is an array of base64 encoded images and/or docs.

{
  "businessName": "ACME Inc.",
  "businessRegisteredAddress": "Street 1B",
  "businessRegisteredCity": "Denver",
  "businessRegisteredState": "Colorado",
  "businessRegisteredZip": "123467",
  "businessContactFirstName": "John",
  "businessContactLastName": "Doe",
  "businessContactEmail": "john.doe@acme.org",
  "businessContactPhone": "12345678910",
  "useCase": "We'll be sending promo messages using short code numbers",
  "termsAndConditionsWebsite": "terms_and_conditions.acme.com",
  "privacyPolicyWebsite": "privacy_policy.acme.com",
  "callToActionLocations": "top and bottom of the page at acme.com",
  "callToActionLanguage": "JOIN NOW, SAVE MONEY, etc.",
  "optInKeywords": "JOIN",
  "optInConfirmation": "YES",
  "welcomeMessage": "Welcome to our shortcode campaign!",
  "exampleAlerts": "New offers available! Join now to save 20%.",
  "helpResponseText": "This is the HELP menu:\n\nSend STOP to stop all messages.",
  "stopResponseText":
    "You used STOP to stop all messages, you'll no longer recieve any promo messages from us.",
  "customerSupportContactEmail": "our_support@company.com",
  "customerSupportContactPhone": "18881231234",
  "customerSupportUrl": "www.our_support.com",
  "attachments": [
    "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAADUlEQVR42mP8z8BQDwAEhQGAhKmMIQAAAABJRU5ErkJggg=="
  ]
}

Query - list short code form orders

To retrieve the status of the request, and to list your short code orders you can use the query bellow.

query($page: Int, $publicId: String, $type: String, $addedStartDate: DateTime, $addedEndDate: DateTime) {
  orders(page: $page, publicId: $publicId, type: $type, addedStartDate: $addedStartDate, addedEndDate: $addedEndDate) {
    page
    pageSize
    totalPages
    orders {
      id
      publicId
      name
      insertedAt
      data {
        ...ShortcodeFormFields
      }
    }
  }
}


fragment ShortcodeFormFields on ShortcodeFormOrderData {
  type
  businessName
  businessRegisteredAddress
  businessRegisteredCity
  businessRegisteredState
  businessRegisteredZip
  businessContactFirstName
  businessContactLastName
  businessContactEmail
  businessContactPhone
  useCase
  termsAndConditionsWebsite
  privacyPolicyWebsite
  callToActionLocations
  callToActionLanguage
  optInKeywords
  optInConfirmation
  welcomeMessage
  exampleAlerts
  helpResponseText
  stopResponseText
  customerSupportContactEmail
  customerSupportContactPhone
  customerSupportUrl
  attachments
}

And the variables look like this.

{
  "page": 1,
  "publicId": "SCF",
  "type": "shortcode_form"
}

You can do a more detailed search, e.g. by using the full publicId.

{
  "page": 1,
  "publicId": "SCF-5XXY1YJHLK",
  "type": "shortcode_form"
}

You can also specify a date range

{
  "page": 1,
  "publicId": "SCF",
  "type": "shortcode_form",
  "addedStartDate": "2022-01-01T12:00:00Z",
  "addedEndDate": "2022-12-01T12:00:00Z"
}
here