Help with sending JSON via java Android | Mobile Apps | Forum

Avatar

Please consider registering
Guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —






— Match —





— Forum Options —





Minimum search word length is 3 characters - maximum search word length is 84 characters

sp_Feed sp_TopicIcon
Help with sending JSON via java Android
No permission to create posts
February 19, 2018
10:31 am
Avatar
nedsons
New Member
Members
Forum Posts: 1
Member Since:
February 19, 2018
sp_UserOfflineSmall Offline

 I need to send an entire JSON to my channel on thingspeak, but I do not know how to do that. Just make use of the POST method?

February 20, 2018
10:32 am
Avatar
cstapels
Moderator
Members


Moderators
Forum Posts: 365
Member Since:
March 7, 2017
sp_UserOfflineSmall Offline

You can update a channel with GET or POST.  Have a look at the documentation for Write Data. You can send a JSON object to a single field, or you can write it to multiple fields.  Each field has a 255 character limit.  You may have to reformat your JSON object to get it in the correct format if you are writing multiple fields at once using this method.

You can also update with many entries at the same time using the bulk write method for JSON data.

April 23, 2018
8:00 pm
Avatar
cstapels
Moderator
Members


Moderators
Forum Posts: 365
Member Since:
March 7, 2017
sp_UserOfflineSmall Offline

Here is a sample JSON POST to the update endpoint.

POST /update.json HTTP/1.1
Host: api.thingspeak.com
Content-Type: application/json

{
"api_key": "CHANNEL_WRITE_API_KEY",
"created_at": "18-04-23 23:25:21 +0200",
"field1": "avalue",
"field3": 61,
"field4": 52,
"field5": 43,
"latitude": "-4",
"longitude": "2.2",
"status": "Perfect"
}

Forum Timezone: America/New_York

Most Users Ever Online: 114

Currently Online:
33 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

rw950431: 261

Vinod: 196

piajola: 85

turgo: 70

vespapierre: 63

Adarsh_Murthy: 62

Member Stats:

Guest Posters: 1

Members: 5703

Moderators: 0

Admins: 2

Forum Stats:

Groups: 4

Forums: 17

Topics: 1313

Posts: 4565

Newest Members:

JudestAboth, concettazx4, lyndarf60, caseybo16, iodiree, emiliacz4

Administrators: Hans: 387, lee: 457