← Home
WhatsApp API
Portal Login

CRITICAL WARNING: Not for Bulk Marketing

This API is designed for transactional messages (OTPs, Order Confirmations, Alerts) only.

If you use this for Bulk Marketing or Spamming, your WhatsApp number WILL BE BANNED by WhatsApp.
HashNET Solutions is NOT responsible for any number bans caused by the misuse of this service. Use responsibly.

1. Setup & Credentials

Before you can send a message, you need three things from your HashNET Dashboard.

1. API Key
Found in Profile > API Key. This acts as your password.
2. Email Address
The email you used to register. This acts as your username.
3. Connection Name
Go to "WhatsApp" > "Connections". Copy the name (e.g., my_shop_no).

2. Understanding the Data

To send a message, you need to send a "Package" of data (called JSON) to our server. Here is what needs to be inside that package:

Name What to put here?
connName The Connection Name you copied in Step 1.
receiver Who are you sending to?
Example: "94771234567" (Number with country code, no + sign).
isGroup Are you sending to a Group?
Type true for Yes, false for No.
msg The actual message you want to send.
Where to send this data?
You must send this data to: https://sender.hashnetlk.com/wtsp-api.php

3. Sending a Text Message

Copy the format below to send a simple text message.

Sending to a Person

{
  "connName": "my_connection_name",
  "isGroup": false,
  "withFile": false,
  "receiver": "94712345678",
  "msg": "Hello! Your order is ready."
}

Replace my_connection_name and the phone number with yours.

Sending to a Group

{
  "connName": "my_connection_name",
  "isGroup": true,
  "withFile": false,
  "receiver": "[email protected]",
  "msg": "Good morning team!"
}

Note: Receiver must be the Group ID (ends in @g.us).

4. Sending a File (Image/PDF)

To send a file, you must change withFile to true and provide a direct link to the file.

Limits: Max size 10MB. Allowed: PDF, JPG, PNG, DOCX.

File Message Format

{
  "connName": "my_connection_name",
  "isGroup": false,
  "withFile": true, 
  "receiver": "94712345678",
  "msg": "Here is your invoice (This text is the caption)",
  "fileUrl": "https://mysite.com/invoice_101.pdf"
}
</>

Advanced Developer Zone

If you are a developer, use the code snippets below to integrate directly into your application.

curl --location 'https://sender.hashnetlk.com/wtsp-api.php' \
--header 'Content-Type: application/json' \
--user '[email protected]:YOUR_API_KEY' \
--data '{
    "connName": "myconnection",
    "isGroup": false,
    "withFile": false,
    "receiver": "94712345678",
    "msg": "Hello from HashNET Sender!"
}'
<?php

$curl = curl_init();

$data = [
    "connName" => "myconnection",
    "isGroup" => false,
    "withFile" => false,
    "receiver" => "94712345678",
    "msg" => "Hello from PHP!"
];

curl_setopt_array($curl, array(
  CURLOPT_URL => 'https://sender.hashnetlk.com/wtsp-api.php',
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => '',
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 0,
  CURLOPT_FOLLOWLOCATION => true,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => 'POST',
  CURLOPT_POSTFIELDS => json_encode($data),
  CURLOPT_HTTPHEADER => array(
    'Content-Type: application/json'
  ),
  CURLOPT_USERPWD => "[email protected]:YOUR_API_KEY"
));

$response = curl_exec($curl);
curl_close($curl);
echo $response;
?>
import requests
import json

url = "https://sender.hashnetlk.com/wtsp-api.php"

# Basic Auth Credentials
username = "[email protected]"
password = "YOUR_API_KEY"

payload = json.dumps({
  "connName": "myconnection",
  "isGroup": False,
  "withFile": False,
  "receiver": "94712345678",
  "msg": "Hello from Python!"
})

headers = {
  'Content-Type': 'application/json'
}

response = requests.request("POST", url, auth=(username, password), headers=headers, data=payload)

print(response.text)