0

I am trying to figure out how to extract data from Telegram which is JSON Data. I am using RapidJSON but when i tried the code below, i dont see any data extracted.

JSON

{  
   "ok":true,
   "result":{  
      "message_id":90,
      "from":{  
         "id":123456854,
         "is_bot":true,
         "first_name":"TestTGBot",
         "username":"TestTGBot"
      },
      "chat":{  
         "id":125415667,
         "first_name":"Test Account",
         "type":"private"
      },
      "date":1506507292,
      "text":"Test Bot Message"
   }
}

Code

Document document;
document.Parse(rBuffer.c_str());

for(Value::ConstMemberIterator iter = document.MemberBegin();iter!=document.MemberEnd();++iter)
{
    tmp.Format("%s",iter->name.GetString());
    MessageBox(tmp);
}

It only returns "ok" and "result" value.

batch 1999
  • 109
  • 9

0 Answers0