Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8471357
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T16:46:28+00:00 2026-06-10T16:46:28+00:00

I’m trying to deserialize a json string and I’m getting the error End element

  • 0

I’m trying to deserialize a json string and I’m getting the error End element 'caption' from namespace '' expected. Found element 'created_time' from namespace ''. when calling

InstagramObject test = (InstagramObject) instagramObject.ReadObject(instagramWebResponse.GetResponseStream());

The json from Instagram returns many elements but there are only a few that I need. My DataContract will be posted below.

Basically I need {data:[{caption: string, link: string, images: {...}}]}

Here’s an example of the json…

{
"data": [{
    "comments": {
        "data": [],
        "count": 0
    },
    "caption": {
        "created_time": "1296710352",
        "text": "Inside le truc #foodtruck",
        "from": {
            "username": "kevin",
            "full_name": "Kevin Systrom",
            "type": "user",
            "id": "3"
        },
        "id": "26621408"
    },
    "likes": {
        "count": 15,
        "data": [{
            "username": "mikeyk",
            "full_name": "Mike Krieger",
            "id": "4",
            "profile_picture": "..."
        }, {...subset of likers...}]
    },
    "link": "http://instagr.am/p/BWrVZ/",
    "user": {
        "username": "kevin",
        "profile_picture": "http://distillery.s3.amazonaws.com/profiles/profile_3_75sq_1295574122.jpg",
        "id": "3"
    },
    "created_time": "1296710327",
    "images": {
        "low_resolution": {
            "url": "http://distillery.s3.amazonaws.com/media/2011/02/02/6ea7baea55774c5e81e7e3e1f6e791a7_6.jpg",
            "width": 306,
            "height": 306
        },
        "thumbnail": {
            "url": "http://distillery.s3.amazonaws.com/media/2011/02/02/6ea7baea55774c5e81e7e3e1f6e791a7_5.jpg",
            "width": 150,
            "height": 150
        },
        "standard_resolution": {
            "url": "http://distillery.s3.amazonaws.com/media/2011/02/02/6ea7baea55774c5e81e7e3e1f6e791a7_7.jpg",
            "width": 612,
            "height": 612
        }
    },
    "type": "image",
    "filter": "Earlybird",
    "tags": ["foodtruck"],
    "id": "22721881",
    "location": {
        "latitude": 37.778720183610183,
        "longitude": -122.3962783813477,
        "id": "520640",
        "street_address": "",
        "name": "Le Truc"
    }
}]
} 

and here’s my DataContract…

[DataContract]
public class InstagramObject {

    [DataMember(Name = "data")]
    public IEnumerable<InstagramData> instagramData { get; set; }

}

[DataContract]
public class InstagramData {

    [DataMember(Name = "images")]
    public List<InstagramImage> instagramImages { get; set; }

    [DataMember(Name = "caption")]
    public string caption { get; set; }

    [DataMember(Name = "link")]
    public string link { get; set; }

}

[DataContract]
public class InstagramImage {

    [DataMember(Name = "low_resolution")]
    public InstagramImageInfo lowResolutionImage { get; set; }

    [DataMember(Name = "thumbnail")]
    public InstagramImageInfo thumbnail { get; set; }

    [DataMember(Name = "standard_resolution")]
    public InstagramImageInfo standardResolution { get; set; }

}

[DataContract]
public class InstagramImageInfo {

    [DataMember(Name = "url")]
    public string url { get; set; }

    [DataMember(Name = "width")]
    public int width { get; set; }

    [DataMember(Name = "height")]
    public int height { get; set; }

}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T16:46:29+00:00Added an answer on June 10, 2026 at 4:46 pm

    In the data contract caption is declared as a string, but in the JSON caption is a record with various fields – caption should be declared to be an object with a compatible structure:

    [DataContract]  
    public class InstagramCaption {
    
       [DataMember(Name = "text")]
       public string Text {get; set;}
    
    } 
    
    . . . 
    
      [DataMember(Name = "caption")]     
      public InstagramCaption caption { get; set; }     
    
    . . . 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to find ID3V2 tags from MP3 file using jid3lib in Java.
I'm trying to select an H1 element which is the second-child in its group
I'm trying to convert HTML to plain text. I get many &\#8217; &\#8220; etc.
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
Does anyone know how can I replace this 2 symbol below from the string
I'm trying to use string.replace('’','') to replace the dreaded weird single-quote character: ’ (aka
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am currently running into a problem where an element is coming back from
I am using jsonparser to parse data and images obtained from json response. When
I am trying to understand how to use SyndicationItem to display feed which is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.