Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

Send data using JSON


nanopol Nov 12, 2021 03:47 PM

Hello,

How can I send data from a CR310 + CELL205 to a website using JSON through the POST method?


Spol Sep 6, 2023 10:56 AM

I manged to send POST JSON for TELEGRAM

'''''''''''''''''''''''''''''''''''''''''''''''''''''
' Http
'''''''''''''''''''''''''''''''''''''''''''''''''''''
Public Http_content As String * 300
Public Http_header As String * 300
Public Http_response As String * 1000
Public Http_url As String * 300 = "https://api.telegram.org/botBOT-ID/sendMessage"

'''''''''''''''''''''''''''''''''''''''''''''''''''''
' Main Program
'''''''''''''''''''''''''''''''''''''''''''''''''''''
BeginProg

'''''''''''''''''''''''''''''''''''''''''''''''''''''
' Main scan frequence - Interval Unit
'''''''''''''''''''''''''''''''''''''''''''''''''''''
Scan(5,Sec,1,0)

If Flag

Flag = false

' JSON DATA

Http_content = "{"+CHR(34)+"chat_id"+CHR(34)+": "+CHR(34)+"CHAT-ID"+CHR(34)+", "+CHR(34)+"text"+CHR(34)+": "+CHR(34)+"This is a test from CR310"+CHR(34)+", "+CHR(34)+"disable_notification"+CHR(34)+": true}"

Http_header = "Content-Type: application/json"

HTTPPost(Http_url, Http_content, Http_response, Http_header)

EndIf

NextScan

EndProg

Log in or register to post/reply in the forum.