Public
Documentation Settings

JSON messages

Now it is possible to send more types of messages from our server api, you have the possibility to send buttons, TemplateButtons, Lists, VCard and much more using our REST API

you need replace "sitedomain.com" with our domain

No Media Messages

This section shows the documentation to be able to send messages without media.

POSTJSON: Send Simple Text

https://sitedomain.com/api/send.php?instance_id=62E2XXXXXXXXX&access_token=fda64a915efXXXXXXXXXXXXXXXXXXXX&type=json&number=521238XXXXXXX

You can send simple text with a json format.

PARAMS
instance_id

62E2XXXXXXXXX

Instance Id of the Phone conected to our web site

access_token

fda64a915efXXXXXXXXXXXXXXXXXXXX

Access Token, you can get this on whatsapp Profile section

type

json

number

521238XXXXXXX

The whastsapp phone to send the message in this format : CountryCode+phoneNumber,

Bodyraw (json)
json
{
    "text": "hello there"
}
Example Request
curl
curl --location 'https://sitedomain.com/api/send.php?instance_id=62E2XXXXXXXXX&access_token=fda64a915efXXXXXXXXXXXXXXXXXXXX&type=json&number=521238XXXXXXX' \
--data '{
    "text": "hello there"
}'
Example Response
{
    "status": "success",
    "message": "Success",
    "data": {
        "key": {
            "remoteJid": String,
            "fromMe": Boolean,
            "id": String
        },
        "message": Object
        },
        "messageTimestamp": Int,
        "status": "PENDING"
    }
}
No response headers
This request doesn't return any response headers

POSTJSON: Send Location

https://sitedomain.com/api/send.php?instance_id=62E2XXXXXXXXX&access_token=fda64a915efXXXXXXXXXXXXXXXXXXXX&type=json&number=521238XXXXXXX

You can send a location message with a json format.

To format coordinates so they work on Google Maps, use decimal degrees in the following format:

Plain Text
Correct: 41.40338
  Wrong: 41,40338
PARAMS
instance_id

62E2XXXXXXXXX

Instance Id of the Phone conected to our web site

access_token

fda64a915efXXXXXXXXXXXXXXXXXXXX

Access Token, you can get this on whatsapp Profile section

type

json

number

521238XXXXXXX

The whastsapp phone to send the message in this format : CountryCode+phoneNumber,

Bodyraw (json)
json
{
    "location": {
        "degreesLatitude": Decimal,
        "degreesLongitude": Decimal
    }
}
Example Request
curl
curl --location 'https://sitedomain.com/api/send.php?instance_id=62E2XXXXXXXXX&access_token=fda64a915efXXXXXXXXXXXXXXXXXXXX&type=json&number=521238XXXXXXX' \
--data '{
    "location": {
        "degreesLatitude": 41.40338,
        "degreesLongitude": 2.17403
    }
}'
Example Response
{
    "status": "success",
    "message": "Success",
    "data": {
        "key": {
            "remoteJid": String,
            "fromMe": Boolean,
            "id": String
        },
        "message": Object
        },
        "messageTimestamp": Int,
        "status": "PENDING"
    }
}
No response headers
This request doesn't return any response headers

POSTJSON: Send vCard

https://sitedomain.com/api/send.php?instance_id=62E2XXXXXXXXX&access_token=fda64a915efXXXXXXXXXXXXXXXXXXXX&type=json&number=521238XXXXXXX

Now can send a vCard message with a json format.
the vCard String is composed by next properties:

Plain Text
BEGIN:VCARD           // Init of VCARD
VERSION:3.0           // VCARD Version
FN:Bob First          // Contac fullname
ORG:sitedomain.com;   // the organization of the contact
TEL;type=CELL;type=VOICE;waid=521238xxxxxxx:+521238xxxxxxx // WhatsApp ID + phone number
END:VCARD             // End of VCARD

is needed use \n for new lines, acoording to the json format for string:

Plain Text
"BEGIN:VCARD\nVERSION:3.0\nFN:Bob First\nORG:sitedomain.com;\nTEL;type=CELL;type=VOICE;waid=521238XXXXXXX:+521238XXXXXXX\nEND:VCARD"
PARAMS
instance_id

62E2XXXXXXXXX

Instance Id of the Phone conected to our web site

access_token

fda64a915efXXXXXXXXXXXXXXXXXXXX

Access Token, you can get this on whatsapp Profile section

type

json

number

521238XXXXXXX

The whastsapp phone to send the message in this format : CountryCode+phoneNumber,

Bodyraw (json)
json
{
    "contacts": {
        "displayName": "Bob First",
        "contacts": [
            {
                "vcard": "BEGIN:VCARD\nVERSION:3.0\nFN:Bob First\nORG:sitedomain.com;\nTEL;type=CELL;type=VOICE;waid=521238XXXXXXX:+521238XXXXXXX\nEND:VCARD"
            }
        ]
    }
}
Example Request
curl
curl --location 'https://sitedomain.com/api/send.php?instance_id=62E2XXXXXXXXX&access_token=fda64a915efXXXXXXXXXXXXXXXXXXXX&type=json&number=521238XXXXXXX' \
--data '{
    "contacts": {
        "displayName": "Bob First",
        "contacts": [
            {
                "vcard": "BEGIN:VCARD\nVERSION:3.0\nFN:Bob First\nORG:sitedomain.com;\nTEL;type=CELL;type=VOICE;waid=521238XXXXXXX:+521238XXXXXXX\nEND:VCARD"
            }
        ]
    }
}'
Example Response
{
    "status": "success",
    "message": "Success",
    "data": {
        "key": {
            "remoteJid": String,
            "fromMe": Boolean,
            "id": String
        },
        "message": Object
        },
        "messageTimestamp": Int,
        "status": "PENDING"
    }
}
No response headers
This request doesn't return any response headers