JSON Error : ArgumentException: JSON must represent an object type.

I am using the following script:

[System.Serializable]
public class Choice
{
    public string choice;
    public int votes;
}

[System.Serializable]
public class RootObject
{
    public string question;
    public string published_at;
    public List<Choice> choices;
}

For the following JSON data:

[
{
“question”: “Favourite programming language?”,
“published_at”: “2015-08-05T08:40:51.620Z”,
“choices”: [
{
“choice”: “Swift”,
“votes”: 2048
}, {
“choice”: “Python”,
“votes”: 1024
}, {
“choice”: “Objective-C”,
“votes”: 512
}, {
“choice”: “Ruby”,
“votes”: 256
}
]
}
]

And I am getting this Error message in console :** ArgumentException: JSON must represent an object type.
Please tell me what I am doing wrong.**

At first glance, it looks like your JSON defines an array of RootObject objects, but you are trying to deserialize a single RootObject. If you are always getting an object with this JSON and only expect one object, you have two choices: a) remove the ‘[’ and ‘]’ array designator from the JSON string and deserialize as a RootObject or deserialize the JSON as a RootObject array (i.e. RootObject) and always take the first element of the array (if its length is not zero).