TeamDesk Knowledge Base & Support

   Home      FAQ      Forum      Idea Exchange      Ask a Question      My Stuff      Help   
  
How to send a view to a WhatsApp group
I was recently asked to send a daily report from TeamDesk to a WhatsApp group.

There were 2 main challenges:
• TeamDesk can only send view subscriptions to emails
• The official WhatsApp app only allows you to send messages to individual numbers, not to groups

I was able to get it working using 2 third-party services:
• Abstractapi.com, to convert a TeamDesk view to an image
• Whapi.cloud, to send the image to a WhatsApp group

I'll describe how I did it. Maybe there is a better, simpler way to accomplish this. If you know of a better one, please share. Anyway, this works.

Preliminary setup
• Open an account with Abstractapi.com & take note of the primary key.
• Open an account with Whapi.cloud & follow the procedure to get a token. You’ll have to scan a QR code with a phone running WhatsApp. That will be the phone number that messages will be sent from. That number should be one of the participants in the group.
• In WhapiCloud, use the GET Groups command to get the WhatsApp Id of the group.

TeamDesk setup
• So as to avoid using a TeamDesk access token associated to one of your regular users, use the token for the public user & restrict public user access to only the necessary tables.
• Create a table called DAILY REPORTS & made it viewable by the public user.
• Create a dummy empty record in the DAILY REPORTS table.
• Go to the view that you want to send to the WhatsApp group, check the Enable Embedding checkbox & copy the Embed code.
• In the DAILY REPORTS table, create a dashboard and give it the same name as the view you want to send.
• Take note of the page number of this new dashboard. You’ll find it in the browser’s address bar, right after “page=”. It should be something like 1568777.
• As a section to this dashboard, add a text element:
o Write a space as Heading.
o Select HTML.
o Copy here the Embed code of the view you want to send.
• In this same table, create a Periodic trigger.
o Give it a name that relates to the name of the view you want to send.
o Set the periodicity.
• Create a Call URL action for this trigger.
o Give it an appropriate name.
o Create a Whapi Cloud authorization using the Whapi Cloud token.
o Select POST as method.
o Under Url, write: https://gate.whapi.cloud/messages/image/
o Under Body, select JSON.
o In the Body box copy the following code:

{
"media": "https://screenshot.abstractapi.com/v1/?api_key=34385fecd8224ba8875ff9e550997777&url=https://www.teamdesk.net/secure/embedded/db/77777/overview.aspx?p=1568777&capture_full_page=false&width=500",
"to": "19566408777-1575926777@g.us"
}

o In the code above, replace:
- the api_key= parameter with your Abstractapi primary key.
- the number 77777 with your TeamDesk application number. You’ll see it in your browser’s address bar, right after db/
- the p= parameter with the page number of the dashboard you created.
-.the string of numbers after the “to” key with the WhatsApp Id of the group that you want to send the view to. If you want to send it to an individual number, write the phone number with the country indicator
- You might have to adjust the width= parameter to get the best results for your report.
o This command instructs WhapiCloud to send to the WhatsApp group a screenshot of your view provided by Abstractapi.
ID
2027
Category
Integration/API
Author

Jorge Sola Ullod
Date Created
12/16/2023 2:09:50 AM
Date Updated
12/16/2023 5:24:09 AM
Comments
Senco 12/16/2023 5:22:08 AM
Thank you Jorge!

basenine 12/16/2023 5:24:09 AM
My apologies…I didn’t realise I was logged in a different account…

Feedback
Back to Search Results