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
  • What is GraphQL?
  • How do I access the TSG Global GraphQL API?
  • Generate Bearer Token
  • Where can I test the GraphQL API and view more documentation?
  • What URL should I use to perform my queries and mutations?

Was this helpful?

GraphQL API & Authentication

Describes how to authenticate to our GraphQL API.

PreviousShort Code Submission (Order)

Last updated 1 year ago

Was this helpful?

What is GraphQL?

GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. GraphQL provides a complete and understandable description of the data in your API, gives clients the power to ask for exactly what they need and nothing more, makes it easier to evolve APIs over time, and enables powerful developer tools.

You can learn more about the GraphQL framework here:

For testing it would be good to use or or some other similar API client.

How do I access the TSG Global GraphQL API?

This authentication method is different than the API key authentication method used for other TSG Global services, and the TNID service.

You can generate a Bearer token to access our GraphQL API using the username and password you use to access our . This token lasts for 7 days.

Generate Bearer Token

POST https://api.portal.tsgglobal.world/account/login

Request Body

Name
Type
Description

email*

string

Your user email address.

password*

string

Your password.

{
    "token": "POAPK_*********",
    "user": {
        "email": "test.user@tsgglobal.com",
        "first_name": "Test",
        "id": "*****",
        "last_name": "User",
        "level": "basic_user"
    }
}
{
    "errors": [
        {
            "id": "unauthorized",
            "message": "Invalid email or password."
        }
    ]
}

When you query the API, you will want to pass your credentials in the header, with the header name "Authorization" and the value as "Bearer <token>".

If you are missing these credentials, please email us at: support@tsgglobal.com

Where can I test the GraphQL API and view more documentation?

What URL should I use to perform my queries and mutations?

You can test various features and view additional documentation in the GraphiQL interface we provide here:

Please use: (note this is different than the GraphiQL UI).

https://graphql.org/
Postman
Insomnia
Customer Portal
https://api.portal.tsgglobal.world/graphiql
https://api.portal.tsgglobal.world/graphql