Africa's Talking Mobile Data API

Disburse mobile data bundles to recipients.

OpenAPI Specification

africastalking-mobile-data-api-openapi.yml Raw ↑
openapi: 3.0.1
info:
  title: Africa's Talking Airtime Mobile Data API
  description: 'Unified REST API for Africa''s Talking communications products: SMS (single, bulk, premium, subscriptions), USSD callbacks, Voice (call, transfer, media upload, queue status), Airtime, Mobile Data, and Payments (mobile C2B checkout, B2C, B2B). Requests authenticate with an `apiKey` header and a `username` parameter. Hosts differ per product: messaging, airtime, and subscriptions live under api.africastalking.com/version1; voice under voice.africastalking.com; mobile data under bundles.africastalking.com; and payments under payments.africastalking.com. Sandbox equivalents insert `.sandbox.` into each host.'
  termsOfService: https://africastalking.com/terms
  contact:
    name: Africa's Talking Support
    url: https://help.africastalking.com
  version: version1
servers:
- url: https://api.africastalking.com/version1
  description: Messaging, Airtime and Subscription production host
- url: https://api.sandbox.africastalking.com/version1
  description: Messaging, Airtime and Subscription sandbox host
- url: https://voice.africastalking.com
  description: Voice production host
- url: https://bundles.africastalking.com
  description: Mobile Data production host
- url: https://payments.africastalking.com
  description: Payments production host
security:
- apiKey: []
tags:
- name: Mobile Data
  description: Disburse mobile data bundles to recipients.
paths:
  /mobile/data/request:
    post:
      operationId: sendMobileData
      tags:
      - Mobile Data
      summary: Send mobile data bundles
      description: Disburse mobile data bundles to a list of recipients. Served from bundles.africastalking.com.
      servers:
      - url: https://bundles.africastalking.com
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/MobileDataRequest'
      responses:
        '201':
          description: Mobile data request accepted.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MobileDataResponse'
components:
  schemas:
    MobileDataRequest:
      type: object
      required:
      - username
      - productName
      - recipients
      properties:
        username:
          type: string
        productName:
          type: string
          description: Registered payment product name.
        recipients:
          type: array
          items:
            type: object
            required:
            - phoneNumber
            - quantity
            - unit
            - validity
            properties:
              phoneNumber:
                type: string
                example: +254711XXXYYY
              quantity:
                type: number
                example: 50
              unit:
                type: string
                enum:
                - MB
                - GB
              validity:
                type: string
                enum:
                - Day
                - Week
                - Month
              metadata:
                type: object
                additionalProperties:
                  type: string
    MobileDataResponse:
      type: object
      properties:
        entries:
          type: array
          items:
            type: object
            properties:
              phoneNumber:
                type: string
              provider:
                type: string
              status:
                type: string
                example: Queued
              transactionId:
                type: string
              value:
                type: string
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: apiKey
      description: Africa's Talking API key generated from your account dashboard.