Logo Lanfrica

GithungoIan/at-nigeria

Domain:

digital infrastructure

Record type:

software
Creator:
Git
Host:
# Africa's Talking Nigeria Workshop API A Node.js API for integrating with Africa's Talking services including SMS, USSD, Voice, and Airtime for Nigerian applications. ## Table of Contents - Requirements - Installation - Configuration - Running the Service - API Endpoints - USSD - Voice - Testing - Project Structure ## Requirements ### System Requirements - **Node.js** v18.0.0 or higher - **npm** v9.0.0 or higher - **Africa's Talking Account** - Sign up here ## Installation 1. **Clone the repository** ```bash git clone cd at-nigeria ``` 2. **Install dependencies** ```bash npm install ``` 3. **Create environment file** ```bash cp .env.example .env ``` 4. **Configure your environment variables** (see Configuration) ## Configuration Create a `.env` file in the root directory with the following variables: ```env # Africa's Talking API Credentials (Required) AT_API_KEY=your_api_key_here AT_USERNAME=your_username_here # Application Configuration PORT=3000 APP_URL=localhost # Voice Configuration (Required for voice features) VOICE_PHONE_NUMBER=+234xxxxxxxxxx ``` ### Getting Your API Credentials 1. Log in to your Africa's Talking Dashboard 2. Go to **Settings** > **API Key** 3. Generate or copy your API key 4. Your username is displayed at the top of the dashboard (use `sandbox` for testing) ## Running the Service ### Development Mode (with auto-reload) ```bash npm run dev ``` ### Production Mode ```bash npm start ``` The server will start on `localhost` (or your configured PORT). ### Verify the Service ```bash curl localhost ``` Expected response: ```json { "status": "success", "message": "Africa's Talking Workshop API", "timestamp": "2024-01-01T00:00:00.000Z" } ``` ## API Endpoints ### Health Check | Method | Endpoint | Description | |--------|----------|-------------| | GET | `/` | API health check | ### Airtime | Method | Endpoint | Description | |--------|----------|-------------| | POST | `/api/a …