Valid JSON response for The Cloud Message Send request

59 views
Skip to first unread message

Vitaliy Vityuk

unread,
Jun 10, 2024, 7:15:26 PMJun 10
to Automate for Android
Hello!
This message for the Automate developer. Is it possible to get the valid JSON response for the Cloud Message Send request?

I mean, we have this endpoint /automate/cloud/message (https://llamalab.com/automate/cloud/) where we can send cloud messages to the devices. But, in the response, we have the HTML code with simple H1 headings. It's not so compatible for me, my code expects the valid JSON (application/json) but get the html instead.

The simple
{
"success": true
}
will be enough.

So, please review the way you responding the /automate/cloud/message requests.

Thank you!

Henrik "The Developer" Lindqvist

unread,
Jun 11, 2024, 5:26:56 AMJun 11
to Automate for Android
Sorry, i don't fully understand.
At the bottom of the endpoint form page there's an example request for sending JSON, i.e. just replace the "Hello World!" string with another JSON type, e.g. an object { "success": true }
You'll need to use some other tool, e.g. curl, to send such a request since the form page only works with webforms, i.e. text payload.

Vitaliy Vityuk

unread,
Jun 11, 2024, 6:48:19 AMJun 11
to Automate for Android
Please see the screenshot. As you can see, the request is in JSON format, but, the response in the HTML. It would be great if it also will be in JSON. 

вівторок, 11 червня 2024 р. о 12:26:56 UTC+3 Henrik "The Developer" Lindqvist пише:
SCR-20240611-mcjt.png

Henrik "The Developer" Lindqvist

unread,
Jun 11, 2024, 6:53:38 AMJun 11
to Automate for Android
That's the response body when it's successfully sent, hence the "Message sent".

Abdulla Redha

unread,
Jun 11, 2024, 8:07:34 AMJun 11
to automa...@googlegroups.com
Hi 

I was trying to create new text file,  I can see commands to read list and write file but nothing ti create new file .

Please advise  

Thank you. 

--
You received this message because you are subscribed to the Google Groups "Automate for Android" group.
To unsubscribe from this group and stop receiving emails from it, send an email to automate-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/automate-user/229df508-e310-41b8-a5fe-d2e5dc5b9cb5n%40googlegroups.com.

Vitaliy Vityuk

unread,
Jun 11, 2024, 8:11:50 AMJun 11
to Automate for Android
I understand it, I just asking is it possible to change the way to represent success of sending massage from html to JSON? For e.g. 
{
"message_sent": true
}

or smth like that.

Thank you!
вівторок, 11 червня 2024 р. о 13:53:38 UTC+3 Henrik "The Developer" Lindqvist пише:

Henrik "The Developer" Lindqvist

unread,
Jun 11, 2024, 11:23:04 AMJun 11
to Automate for Android
Just ignore the response body, the status code will tell if it succeeded or not, i.e. 200 means success.

Henrik "The Developer" Lindqvist

unread,
Jun 11, 2024, 11:23:50 AMJun 11
to Automate for Android
The File write block will create the file.

Vitaliy Vityuk

unread,
Jun 12, 2024, 3:50:15 PMJun 12
to Automate for Android
OK, thank you!

вівторок, 11 червня 2024 р. о 18:23:04 UTC+3 Henrik "The Developer" Lindqvist пише:
Reply all
Reply to author
Forward
0 new messages