SimpleTexting Contact Segments API

Read dynamic contact segments.

OpenAPI Specification

simpletexting-contact-segments-api-openapi.yml Raw ↑
openapi: 3.2.0
info:
  title: SimpleTexting API Documentation Contact Segments API
  description: '# Introduction



    Thousands of businesses rely on SimpleTexting to communicate with their audience via text message. With our API, developers can access many of our platform’s features and integrate them with other websites or applications. This document details the available SimpleTexting API functions and their parameters. For additional security, our API is by approval only. If you’d like access, sign up for a trial account and email [support@simpletexting.net](mailto:support@simpletexting.net) with details about your use case.


    **How it works**


    Our API is organized around [REST](https://en.wikipedia.org/wiki/Representational_state_transfer). It uses standard HTTP response codes and authentication. Before you get started, there a few things to keep in mind:


    - When using the POST request, you must specify that `content-type` is `application/json`.



    - The format of responses for all requests is JSON, you can skip the `Accept` request header or set it to `application/json`.


    # Authentication


    Each time you make a request to our API, we use a bearer token in your header to authenticate your account. API requests without authentication will fail. Your API token can be found under [settings](https://app2.simpletexting.com/integrations/webhooks).<br><br>

    Please be sure to keep your bearer token secure. Don’t share it any public areas such as GitHub, client-side code, etc.


    <!-- ReDoc-Inject: <security-definitions> -->

    '
  termsOfService: https://simpletexting.com/terms/
  version: 2.0.0
servers:
- url: https://api-app2.simpletexting.com/v2
security:
- api_key: []
tags:
- name: Contact Segments
  description: Get all of the segments on a given SimpleTexting account.
paths:
  /api/contact-segments:
    get:
      tags:
      - Contact Segments
      summary: Get all Segments
      description: 'Retrieves all segments from your SimpleTexting account.


        **Example:** Here we return all segments from an account:


        `https://api-app2.simpletexting.com/v2/api/contact-segments?page=100&size=2`'
      operationId: getSegments
      parameters:
      - name: page
        in: query
        description: An ordinal number of the page to return with the results of a request (with the segments of the given account). Please note that page numbering starts at zero (`0`)
        required: false
        schema:
          minimum: 0
          type: integer
          format: int32
          default: 0
        example: 0
      - name: size
        in: query
        description: The number of the returned segments to show per page
        required: false
        schema:
          maximum: 500
          type: integer
          format: int32
          default: 50
        example: 50
      responses:
        '200':
          description: Success. Returns all segments from your SimpleTexting account.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PageViewSegment'
components:
  schemas:
    PageViewSegment:
      type: object
      properties:
        content:
          type: array
          description: Page content and number of elements is restricted by page size.
          items:
            $ref: '#/components/schemas/Segment'
        totalPages:
          type: integer
          description: The total number of pages. This is the number of elements divided by the page size.
          format: int32
        totalElements:
          type: integer
          description: Total number of elements.
          format: int64
      description: Page representation for search/fetch result
    Segment:
      type: object
      properties:
        segmentId:
          title: Segment ID in hexadecimal format
          type: string
          example: 507f191e810c19729de860ea
        name:
          title: Segment name
          type: string
        created:
          title: Created timestamp
          type: string
          format: date-time
        updated:
          title: Updated timestamp
          type: string
          format: date-time
      description: Page content and number of elements is restricted by page size.
  securitySchemes:
    api_key:
      type: apiKey
      description: 'Bearer authentication (also called token authentication) is an authentication scheme that involves security tokens called bearer tokens. The name “Bearer authentication” can be understood as “give access to the bearer of this token.” The bearer token is a cryptic string, usually generated by the server in response to a login request. The client must send this token in the `Authorization: Bearer <token>` header when making requests to protected resources. To understand more about bearer tokens, please take a look at the following [resource](https://swagger.io/docs/specification/authentication/bearer-authentication/).'
      name: Authorization
      in: header
x-tagGroups:
- name: CAMPAIGNS & MESSAGES
  tags:
  - Campaigns
  - Messages
  - Media Items
  - File Information
- name: Contacts
  tags:
  - Contacts
  - Contacts - Batch Operations
  - Contact Lists
  - Contact Segments
  - Custom Fields
- name: Webhook Services
  tags:
  - Webhooks
  - Webhook Reports