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 9281689
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T18:10:58+00:00 2026-06-18T18:10:58+00:00

My REST api returns data in json in following format for `/api/users`: { objects:[

  • 0
My REST api returns data in json in following format for `/api/users`:

{
    "objects":[
        {"User":{"id":"1","created":"2013-02-13 09:22:42","modified":"2013-02-13 09:22:42","username":"some.email@gmail.com","role":"admin"}},
        {"User":{"id":"2","created":"2013-02-13 09:22:55","modified":"2013-02-13 09:22:55","username":"some.email2@gmail.com","role":"analyst"}},
        {"User":{"id":"3","created":"2013-02-13 09:23:02","modified":"2013-02-13 09:23:02","username":"some.email3@gmail.com","role":"moderator"}},
        {"User":{"id":"4","created":"2013-02-13 09:23:10","modified":"2013-02-13 09:23:10","username":"some.email4@gmail.com","role":"representative"}}
        ],
    "meta":
        {"page":1,"pageCount":1,"prevPage":false,"nextPage":false,"limit":20,"count":4,"sort":null,"direction":null}
}

For /api/users/{id} it returns data in following format:

{"User":{"id":"1","created":"2013-02-13 09:22:42","modified":"2013-02-13 09:22:42","username":"some.email@gmail.com","role":"admin"}

How I can integrate this with Backbone.js Collection and Model? I know Backbone.js expects api to return array of object dicts or pure object dict – is there a way to change it?

  • 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-18T18:10:59+00:00Added an answer on June 18, 2026 at 6:10 pm

    Yes, there is. You could override model.parse or collection.parse. For example:

    var UserCollection = Backbone.Collection.extend({
                    model: User, 
                    url: '/api/users',
                    parse: function(response) {
                            // process response.meta when necessary...
                            return response.objects;
                        });
                    }
                });
    
    var UserModel = Backbone.Model.extend({
                     //...
                     parse: function(response) {
                            return response.User;
                        });
                    }
                });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing some REST API's which are returning data in json format. ASP.net
When creating a REST API, if I return data in JSON format for GET
I'm working with an external REST API that returns some data as a comma-separated
I have made an api that returns an object as json data. I Am
As per Teamcity REST API We can use the following to get XML Data
I am creating a simple REST API that outputs JSON data. However I am
I have a REST API using Django Tastypie. Given the following code The models
I'm having trouble posting data to some views that use Django REST framework in
I'm wanting to make an API quickly, following REST principles - for a simple
Writing an iPhone app, and I'm getting my data from a REST API that

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.