dimaskiddo/go-whatsapp-multidevice-rest

[WIKI] cURL commands for API methods.

Closed this issue ยท 4 comments

I managed to work out some of the missing API methods in the Wiki, and am putting the cURL commands below for anyone who needs them.

# Check if whatsapp account exists?
curl -X 'GET' \
  "http://127.0.0.1:3000/api/v1/whatsapp/registered?msisdn=$PHONE_NUMBER" \
  -H "Authorization: Bearer $TOKEN" \
  -H 'accept: application/json'

# Send text
curl -X 'POST' \
  'http://127.0.0.1:3000/api/v1/whatsapp/send/text' \
  -H 'accept: application/json' \
  -H "Authorization: Bearer $TOKEN" \
  -H 'Content-Type: multipart/form-data' \
  -F "msisdn=$PHONE_NUMBER" \
  -F 'message=Hello World'

# Send Image
curl -X 'POST' \
  'http://127.0.0.1:3000/api/v1/whatsapp/send/image' \
  -H 'accept: application/json' \
  -H "Authorization: Bearer $TOKEN" \
  -H 'Content-Type: multipart/form-data' \
  -F "msisdn=$PHONE_NUMBER" \
  -F 'caption=<Image Caption Here>' \
  -F 'image=@image.jpg;type=image/jpeg' \
  -F 'viewonce=false'

# Send Video
curl -X 'POST' \
  'http://127.0.0.1:3000/api/v1/whatsapp/send/video' \
  -H 'accept: application/json' \
  -H "Authorization: Bearer $TOKEN" \
  -H 'Content-Type: multipart/form-data' \
  -F "msisdn=$PHONE_NUMBER" \
  -F 'caption=<Video Caption Here>' \
  -F 'video=@video.mp4;type=video/mp4' \
  -F 'viewonce=false'

# Send document
curl -X 'POST' \
  'http://127.0.0.1:3000/api/v1/whatsapp/send/document' \
  -H 'accept: application/json' \
  -H "Authorization: Bearer $TOKEN" \
  -H 'Content-Type: multipart/form-data' \
  -F "msisdn=$PHONE_NUMBER" \
  -F 'document=@document.pdf;type=application/pdf'

I hope this will help fill in the gaps in the Wiki pages :)

Hai @AvinashReddy3108 thanks for your help may be you can help me by requesting pull request for the wiki.
Thank you so much :D

Sure, I'd love to. But I can't seem to figure out how to make a pull request for the Wiki.
This is exactly why I had to make this issue ๐Ÿ‘€

ibnux commented

@AvinashReddy3108 thanks, i added to Endpoint Wiki,

i try to help to create better Documentation, but get busy with task from my work ๐Ÿ˜

https://github.com/dimaskiddo/go-whatsapp-multidevice-rest/wiki/Endpoint

Thank you so much pak @ibnux for the update ๐Ÿฅ‚ ๐Ÿ˜„