Skip to content

This is only for testing purpose, a fake requesta and response for whatsapp

Notifications You must be signed in to change notification settings

ilmiawan/fake-whatsapp-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

fake-whatsapp-server

This is only for testing purpose, a fake requests and response for whatsapp business api

Installation

git clone https://github.com/ilmiawan/fake-whatsapp-server
cd fake-whatsapp-server
npm install

Run server

npm run start

How to test

Login

curl --request POST \
  --url http://localhost:3030/v1/users/login \
  --header 'Authentication: Basic asdfalskfjasdklfjsladkfjasl;kjfdlks;ajflk;asdjflkasjf' \
  --header 'Content-Type: application/json'

check-contacts

curl --request POST \
  --url http://localhost:3030/v1/cntacts/ \
  --header 'Authentication: Basic asdfalskfjasdklfjsladkfjasl;kjfdlks;ajflk;asdjflkasjf' \
  --header 'Content-Type: application/json' \
  --data '{
   "blocking": "wait",
   "contacts": [
      "+6281234567890"
   ]
}'

send-messages-template-text

curl --request POST \
  --url http://localhost:3030/v1/messages/ \
  --header 'Authentication: Basic asdfalskfjasdklfjsladkfjasl;kjfdlks;ajflk;asdjflkasjf' \
  --header 'Content-Type: application/json' \
  --data '{
	"to": "{{Recipient-WA-ID}}",
	"type": "template",
	"template": {
		"namespace": "<Message Template Namespace>",
    	"name": "<Message Template Element Name>",
        "language": {
    		"policy": "<Message Template Language Policy>",
    		"code": "<Message Template Language Code>"
        },
        "components": [{
            "type": "body",
            "parameters": [
                {
                    "type": "<param type>",
                    "text": "<param value>"
                }
            ]
        }]
	}
}'

About

This is only for testing purpose, a fake requesta and response for whatsapp

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published