1SIMPLE1 WhatsApp WebMessage and API integration

WhatsApp Web Messages generally refers to the way WhatsApp delivers messages on its web platform. Here's how to integrate the solution on an existing solution already developed.

To get your key developer, please click here -->

  1. Main Portal:
    https://whatsapp.1simple1.com

    Message Routes

  • Send Message:

    • POST /v1/send-message-api - Handle send message request
  • Get sent message:

    • Get /messages - to get sent message
  • Headers:

    • Content-Type: application/json,
    • Accept: application/json

Send Message API Request

Request type is : - POST

    https://whatsapp.1simple1.com/api/v1/send-message-api
{
    "number": "whatsApp number with international format",
    "message": "Your Message",
    "key": "Your api key"
}

Integration in Laravel:

use Illuminate\Support\Facades\Http;

public function sendMessage(): void
    {
        Http::withHeaders([
            'Accept' => 'application/json',
            'Content-Type' => 'application/json',
        ])->post('https://whatsapp.1simple1.com/v1/send-message-api', [
            'key' => 'Your api key',
            'number' => 'whatsapp phone number',
            'message' => 'your message here',
        ]);
    }

Integration in flutter:


import 'package:http/http.dart' as http;

Future<void> sendMessageRequest() async {
    // Define the URL and headers
    final url = Uri.parse('https://whatsapp.1simple1.com/v1/send-message-api');
    final headers = {
      'Content-Type': 'application/json',
      'Accept': 'application/json'
    };

    // Define the body of the request
    final body = jsonEncode({
      'key': 'Your api key',
      'number' : 'whatsapp phone number',
      'message' : 'your message here',
    });

    try {
      // Send the POST request
      final response = await http.post(
        url,
        headers: headers,
        body: body,
      );

      // Check if the request was successful
      if (response.statusCode == 200) {
        // If the request was successful, decode the response body
        final responseBody = jsonDecode(response.body);
        print('Response data: $responseBody');
      } else {
        print('Request failed with status: ${response.statusCode}');
      }
    } catch (error) {
      print('Error: $error');
    }
  }