Jump to content

Recommended Posts

I already tested, all working except sending image and button in web. (if someone can fix this please share in this post)

but if you try using rest api, its working fine, you need change send method to get not post, you can change it at code.

webhook is working to, problem is we dont have good documentation for this, so here you are my example code for webhook
 

webhook.js

  • Love 1
1 hour ago, Mobital PVT said:

@Ordinary User  Hi, using the REST API I am able to set the webhook url, however it is not firing out any messages, i am using your example server to listening for messages and nothing gets sent. Do you know how to log the server calls so i can try to debug for myself?

change webhook: function in waziper.js to this

 

    webhook: async function(instance_id, data){    
        var tb_webhook = await Common.db_query("SHOW TABLES LIKE 'sp_whatsapp_webhook'");
       
        if(tb_webhook){
          var webhook = await Common.db_query("SELECT * FROM sp_whatsapp_webhook WHERE status = 1 AND instance_id = '"+instance_id+"'");
        console.log(webhook);  
          if(webhook){
                console.log(webhook.webhook_url);
                axios.post(webhook.webhook_url, { instance_id: instance_id, data: data }).then((res) => {}).catch((err) => {});
            }
        }
    },
  • Love 1
  • Thanks 1

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
  • Create New...