-4

Hi Im new to JSON this may be a basic question, im having data as a JSON object and i want to print the "message" data alone. My sample JSON data, in this how can i access message?

{ "name": "Usingtagproject", "fan_count": 0, "category": "Product/Service", "feed": { "data": [ { "created_time": "2017-05-02T18:24:27+0000", "message": "hii", }, { "created_time": "2017-05-02T09:26:37+0000", "message": "Hi Google", }, { "created_time": "2017-05-02T09:24:26+0000", "message": "Hi Demoproject", } ], } 
3

1 Answer 1

1

JSON is essentially a map (keys with values), that has a specific syntax. It completely depends on what language you're accessing it in, but you can assume that most languages will have key indexing, so that you can say:

string name = my_json['name'] list<map> data = my_json['data'] for data_map in data: print "found message: " + data_map['message'] 
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.