This document aims to describe and provide guidelines in integrating our client's systems to the Send Mammy Service.
Audience
This document is intended for:
ChatDaddy Developers; enabling them to quickly learn to integrate and continuously improve the service
External third-party developers / organizations; enabling them to use and incorporate service into their own systems
Glossary
Terms
Descriptions
ChatDaddy
The company maintaining and managing the service
WhatsApp
A simple, secure and reliable messaging platform
Swagger
The toolset for API Documentation
Service
The Send Mammy Service
JWT
Json Web Tokens
jid
The user WhatsApp ID and it comes with a format of @s.whatsapp.net
Overview
How to Integrate
Get a Token
A user can get a token by consuming an authentication endpoint from our OAuth service. Before a user can get an access token you must have your username and password registered from the service
{
"connections": {
"phone": false,
"waWeb": "string:<state of whatsapp web connection>(open|close|connecting)"
},
"chats": {
"hasSome": boolean:<has some chats>,
"hasLatest": boolean:<has latest chats>
},
"canLogin": boolean:<is the user can login to whatsapp web>,
"user": {
"jid": "string:<jid>",
"name": "string:<name of the user>",
"phone": {
"wa_version": "string:<whatsapp version",
"mcc": "string:<mcc>",
"mnc": "string:<mnc>",
"os_version": "string:<os version>",
"device_manufacturer": "string:<device manufacturer>",
"device_model": "string:<device model>",
"os_build_number": "string:<os build number>"
},
"imgUrl": "string:<profile picture url>"
},
"pendingQR": "string:<WhatsApp QR Code Data>",
"mediaUploadsUrl": "string:<media upload url>",
"messagesLeft": {
"count": number:<message limit count>,
"unlimited": boolean:<is the user's messages is unlimited>
}
}
Open WhatsApp Web Connection
A user needs to open a WhatsApp Web connection to maximize the use of the Send Mammy service. If the user received a canLogin=true from the Get WhatsApp Web Connection State it will successfully logged in the WhatsApp account to the service. Otherwise, the pendingQR will be seen on Get WhatsApp Web Connection State response. pendingQR is a QR code data that must be used within 20 seconds to generate a QR code for WhatsApp to scan. Once this QR code is successfully scanned from WhatsApp, the user will now be logged in to the service.
If the response code returned by the request is 200 , this means that the opening a WhatsApp Web connections is successfully registered.
Sending a Message
After successfully connected the user's WhatsApp account to the service, The user can now send message to it's recipients.
Sample Request (Text Message)
curl -X 'POST' \\
'<https://api.sendmammy.com/messages/><user jid here>' \\
-H 'accept: application/json' \\
-H 'Authorization: Bearer <access token here>' \\
-H 'Content-Type: application/json' \\
-d '{
"jid": "<recipient jid here>",
"text": "This is a test message",
"scheduleAt": <can be current unix time or desired schedule of the message to be sent out>,
"randomizeMessage": true
}'
Sample Response (Text Message)
{
"key": {
"remoteJid": "string:<sender jid>",
"fromMe": boolean:<is from the sender>,
"id": "string:<message ID>"
},
"message": {
"extendedTextMessage": {
"text": "This is a test message"
}
},
"messageTimestamp": {
"low": 1618311227,
"high": 0,
"unsigned": true
},
"status": 1,
"scheduled": true,
"senderUserId": "string:<sender user id>"
}
The Server selected must be https://api.sendmammy.com/
To prevent getting Unauthorized Request, kindly ensure that you have clicked the Authorize button on the right
Upon clicking the Authorize button, the documentation will prompt an authorization modal like the image below:
The user must fill up a valid username and password and just click the Authorize button on the bottom part of the modal.
client_id & client_secret can be blank
The user can verify a successful authorization request by seeing if the lock icon is locked
The user can now request to all the endpoints of the service
NOTE: Don't forget to read the descriptions on the endpoint, parameters, request objects, and response objects for better understanding. If you have any concerns, please don't hesitate to contact our sales representative or support team.
Send Mammy is the most advanced, feature-rich unofficial API for and developed by . The Service follows the industry-standard protocol for authorization by using and using for the tokens.
The endpoints are officially documented using and following the
We are excited to hear that from you! You can explore more about the service by using our official .