Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Send a message via a local URL #250

Open
NiiiYaa opened this issue Aug 15, 2024 · 2 comments
Open

Send a message via a local URL #250

NiiiYaa opened this issue Aug 15, 2024 · 2 comments

Comments

@NiiiYaa
Copy link

NiiiYaa commented Aug 15, 2024

Hello,
I wanted to ask if there's a way to send a message via a local URL (e.g., http://localhost:3000/...).
If so, could you please provide the URL structure?
Thank you in advance for your help.

@mimail786
Copy link

Hi
POST to url: http://localhost:3000/client/sendMessage/ABCD
-H 'x-api-key: '
Body:
{
"chatId": "[email protected]",
"contentType": "string",
"content": "Test Message"
}

It works using https://www.usebruno.com/downloads
But i'm not sure why it does not work from command prompt using curl
URL rejected: Bad hostname
Get methods work from the browser

Let me know if yours works from curl

Thanks

@ovargasp
Copy link

ovargasp commented Oct 1, 2024

This works for me:

curl -X 'POST'
'http://localhost:3000/client/sendMessage/'
-H 'accept: /'
-H 'Content-Type: application/json'
-d '{
"chatId": "[email protected]",
"contentType": "string",
"content": "Test Message"
}'

Just to be on the safe side you may want to check your session status first...

curl -X 'GET'
'http://localhost:3000/session/status/'
-H 'accept: application/json'

I named my sessionID default so the command that I'm running is:

curl -X 'GET'
'http://locahost:3000/session/status/default'
-H 'accept: application/json'

you should receive a response like this: {"success":true,"state":"CONNECTED","message":"session_connected"}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants