Whatsapp Api

Send Message API

Method : POST | GET

Endpoint: https://whatsapp.msg-box.in/send-message

Request Body : (JSON If POST)

ParameterTypeRequiredDescription
api_keystringYesAPI Key
senderstringYesNumber of your device
numberstringYesrecipient number ex 72888xxxx|62888xxxx
messagestringYesMesssage to be sent

Example JSON Request

      
        {
          "api_key": "1234567890",
          "sender": "62888xxxx",
          "number": "62888xxxx",
          "message": "Hello World"
        }
      

Example URL Request

https://whatsapp.msg-box.in/send-message?api_key=1234567890&sender=62888xxxx&number=62888xxxx&message=Hello World

Send Media API

Method : POST | GET

Endpoint: https://whatsapp.msg-box.in/send-media

Request Body : (JSON If POST)

ParameterTypeRequiredDescription
api_keystringYesAPI Key
senderstringYesNumber of your device
numberstringYesrecipient number ex 72888xxxx|62888xxxx
media_typestringYesURL of media must direct link
captionstringNoWill show if the type of image or video
urlstringYesrequired if the type is audio. true = Voice note | false = Audio
pptbooleanNorequired if type is audio. true = Voice note | false = Audio
Note: Make sure the url is direct link, not a link from google drive or other cloud storage

Example JSON Request

          {
            "api_key": "1234567890",
            "sender": "62888xxxx",
            "number": "62888xxxx",
            "media_type": "image",
            "caption": "Hello World",
            "url": "https://example.com/image.jpg"
          }

Example URL Request

https://whatsapp.msg-box.in/send-media?api_key=1234567890&sender=62888xxxx&number=62888xxxx&media_type=image&caption=Hello World&url=https://example.com/image.jpg

Send Button API

Method : POST | GET

Endpoint: https://whatsapp.msg-box.in/send-button

Request Body : (JSON If POST)

ParameterTypeRequiredDescription
api_keystringYesAPI Key
senderstringYesNumber of your device
numberstringYesrecipient number ex 72888xxxx|62888xxxx
messagestringYesText of message
buttonstringYesThe footer text of the message
footerstringNoImage or video URL
urlstringNoImage or video url

Example json

 {
     "sender" : "6281284838163",
     "api_key" : "yourapikey",
     "number" : "082298859671",
     "url" : null,
     "footer" : "optional",
     "message" : "Halo,ini pesan button",
     "button" : ["button 1","button 2","button 3"]

 }

Example URL

https://whatsapp.msg-box.in/send-button?sender=6281284838163&api_key=yourapikey&number=082298859671&url=&footer=optional&message=Halo,ini pesan button&button=button 1,button 2,button 3

The Responses of API for (SEND MESSAGE) | JSON

Response Success

        
{
    "status": true,
    "msg": "Message sent successfully!"
}
    

Response Failed

        
{
    "status": false,
    "msg": "Message failed to send!"
}
  

Response INVALID Data

          
{
    "status": false,
    "msg": "Invalid data!",
    "errors": { } // list of errors
}
        

The response failed to access the WhatsApp server

            
{
    "status": false,
    "msg": "Failed to send message!",
    "errors": "Failed to access whatsapp server"
}

Webhook Example

Webhook is a feature that allows you to receive a callback from our server when a message is incoming to your device. You can use this feature for made a dynamic chatbot or whatever you want.

We will send a POST request to your webhook URL with a JSON body. Here is an example of the JSON body we will send:

        
{
  "message" : "message",
  "from" : "the number of the whatsapp sender",
  "bufferImage" : "base64 image, null if message not contain image",
}

        
      

For example, webhook you can see in Here