Trying to figure out http request POST phrasing

Joined
Mar 30, 2023
Messages
1
Reaction score
0
Hi all - have no idea if I am in the right forum for this question but seems like a good place to start.

I am trying to create some automation with MacroDroid on android phone sending commands as message to a chat room on tlk.io (a no registration chat-room website) - these message can be read by my automation software on my windows pc to execute commands.

I have manged to get most of the chain working but I cant figure out how to write the HTTP request POST message that MacroDroid can send.

The reason I am here is that I assume there is a way to monitor the string that is sent from my web browser when I post a message on the website - if i can figure out the string I can copy it to the HTTP Request message. Someone on AutoHotKey forum has worked out the "JSON data from the API data" which he done "by monitoring the data transfer as he interacted with the website" - but all he posted was how to read the messages on the chat room not how to post one.

So, in short I would like to post a message on the chat room without using a browser (and going to the website)
 
Joined
Mar 31, 2023
Messages
95
Reaction score
8
To send a message to a chat room on tlk.io via HTTP POST request, you will need to know the API endpoint and the necessary parameters required to make the request.

First, you can use the Developer Tools in your web browser to monitor the network traffic while you send a message to the chat room. To do this, open the Developer Tools in your browser (usually by pressing F12), switch to the "Network" tab, and then send a message to the chat room. You should see a new entry appear in the network log corresponding to the message you just sent.

Click on the entry to view its details, and then look for the "Request URL" and "Request Method" fields. The "Request URL" should be the API endpoint that you need to send your HTTP POST request to, and the "Request Method" should be "POST".

Next, you will need to inspect the "Request Payload" or "Form Data" section to see what parameters are required to send a message to the chat room. Depending on the API, there may be different parameters required, but typically you will need to provide the message content, your username, and possibly some kind of authorization token or password.

Once you know the API endpoint and the required parameters, you can use MacroDroid to send an HTTP POST request with those parameters. To do this, create a new macro in MacroDroid, add an "HTTP Request" action, and then set the "Method" to "POST" and the "URL" to the API endpoint you discovered earlier. In the "Data" field, enter the necessary parameters in the format required by the API (usually either JSON or URL-encoded form data).

Make sure to test your macro to ensure that it is working correctly and that messages are being sent to the chat room. Good luck!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,756
Messages
2,569,534
Members
45,007
Latest member
OrderFitnessKetoCapsules

Latest Threads

Top