asternic / wuzapi

Simple RESTful API for WhatsApp in Golang (using the Whatsmeow multi device library)
MIT License
105 stars 58 forks source link

failed on go run main.go #17

Closed Rutik7066 closed 1 year ago

Rutik7066 commented 1 year ago

command-line-arguments

.\main.go:99:4: s.routes undefined (type server has no field or method routes) .\main.go:101:4: s.connectOnStartup undefined (type server has no field or method connectOnStartup)

ssteeltm commented 1 year ago

You should "go run ." or build it. With last change of dbdata path, "go run ." wont work anymore, so you should "go build ." and then use it.

Rutik7066 commented 1 year ago

Thank you so much it is working now. I need guidance on one more thing i am unable to send text message. I mean don't know where to specify token or username for wuzapi app to understand which user is sending message.

asternic commented 1 year ago

Set the token either as an url parameter or as a request header, example using curl and token as request header:

curl -X POST "http://wuzapi.server:8080/chat/send/text" -H "accept: application/json" -H "token: 1231231234" -H "Content-Type: application/json" -d "{\"Phone\":\"13005593934\",\"Body\":\"How you doin\",\"Id\":\"ABCDABCD\"}"