Coder Social home page Coder Social logo

Comments (6)

avoylenko avatar avoylenko commented on May 31, 2024

This possibility is missing, but we could implement it in the future service version.

from whatsapp-api.

mahmoudgoogle avatar mahmoudgoogle commented on May 31, 2024

Is it possible to send a message to multiple numbers with just one api call? Or is there any other way to, if sending the same file multiple times, not have to download the whole file every time?

In the case of sending files, you can send the message and the file to yourself and then forward it to any other person or group. It will not appear to them that it is a forworded message because it is actually your message.

from whatsapp-api.

ninoppp avatar ninoppp commented on May 31, 2024

Is it possible to send a message to multiple numbers with just one api call? Or is there any other way to, if sending the same file multiple times, not have to download the whole file every time?

In the case of sending files, you can send the message and the file to yourself and then forward it to any other person or group. It will not appear to them that it is a forworded message because it is actually your message.

That's a good call. However, when I try to use message/forward, it gives me

{
  "success": false,
  "error": "Message not Found"
}

despite me giving it a correct message ID. The body is supposed to look like this, right?

{ "chatId": "[email protected]", "messageId": "messageId fetched from saved messages" }

from whatsapp-api.

mdestafadilah avatar mdestafadilah commented on May 31, 2024

Is it possible to send a message to multiple numbers with just one api call? Or is there any other way to, if sending the same file multiple times, not have to download the whole file every time?

In the case of sending files, you can send the message and the file to yourself and then forward it to any other person or group. It will not appear to them that it is a forworded message because it is actually your message.

That's a good call. However, when I try to use message/forward, it gives me

{
  "success": false,
  "error": "Message not Found"
}

despite me giving it a correct message ID. The body is supposed to look like this, right?

{ "chatId": "[email protected]", "messageId": "messageId fetched from saved messages" }

please open new issue about sending file @mahmoudgoogle

from whatsapp-api.

mdestafadilah avatar mdestafadilah commented on May 31, 2024

This possibility is missing, but we could implement it in the future service version.

how we can use delay props in sendMessage?

from whatsapp-api.

Tisila avatar Tisila commented on May 31, 2024

Hello,
I'm having the same issue.
For documentation purposes, here is my attempt.

I have executed the following command to fetch the last message that a number sent to the container:

$Uri = 'http://10.xx.xx.xx:3000/chat/fetchMessages/xxxxx'
$Form = @{
    chatId='[email protected]'
}
$Result = Invoke-RestMethod -Uri $Uri -Method 'Post' -Body $Form
$Result.messages[-1].id

Where I get the result:

fromMe      : False
remote      : [email protected]
id          : xxxxxxxx2F3AFC186D283918xxxxxxxx
_serialized : [email protected]_xxxxxxxx2F3AFC186D283918xxxxxxxx

Then I proceeded to make another request to forward that message to another user with:

$Uri = 'http://10.xx.xx.xx:3000/message/forward/xxxxx'
$Form = @{
    chatId='[email protected]'
    messageId='xxxxxxxx2F3AFC186D283918xxxxxxxx'
}
$Result = Invoke-RestMethod -Uri $Uri -Method 'Post' -Body $Form

Where I get the result:

Invoke-RestMethod : {"success":false,"error":"Message not Found"}
At line:6 char:11
+ $Result = Invoke-RestMethod -Uri $Uri -Method 'Post' -Body $Form
+           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : InvalidOperation: (System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebException
    + FullyQualifiedErrorId : WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand

I think I'm using the API correctly yet something feels off.
I have tested the last request with the id and the _serialized results in the messageId parameter and keep getting the same error.
Can anyone guide me to a solution? Any help is much apreciated.
Please don't judge me about Powershell 😅

from whatsapp-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.