0

I have a REST webservice which returns the following output while accessing json REST url "http://example.com/api/v2.0/deliverable/?numb=339&limit=1&order_by=-id&format=json";

Backend is Django Python Framework, which provides REST API for this application. Below is the output of REST URL.

{
meta: {
    limit: 1,
    next: "/api/v2.0/deliverable/?limit=1&format=json&order_by=-id&numb=339&offset=1",
    offset: 0,
    previous: null,
    total_count: 200
},
objects: [
    {
        bcontext: "/api/v2.0/numbcontext/2/",
        bugs: [ ],
        numid: {
            numtype: "beta",
            branch: "mybranch",
            numidstatus: [
                {
                    numid: "/api/v2.0/numid/525030/",
                    failurereason: "",
                    id: "372734",
                    lastupdate: "2013-04-29T11:28:47",
                    overridden: false,
                    overridedesc: "",
                    overrideuser: null,
                    recommended: true,
                    resource_uri: "/api/v2.0/numidstatus/372734/",
                    stype: {
                        id: "1",
                        name: "2hr",
                        resource_uri: "/api/v2.0/s/1/"
                    }
                },
                                    {
                    numid: "/api/v2.0/numid/525031/",
                    failurereason: "",
                    id: "372735",
                    lastupdate: "2013-04-29T11:28:48",
                    overridden: false,
                    overridedesc: "",
                    overrideuser: null,
                    recommended: true,
                    resource_uri: "/api/v2.0/numidstatus/372735/",
                    stype: {
                        id: "1",
                        name: "2hr",
                        resource_uri: "/api/v2.0/s/1/"
                    }
                }
            ]
            id: "904930",
            cset: 2268936,
            coverage: false
        },
        endtime: "2013-04-29T08:32:27",
        starttime: "2013-04-29T07:50:15"
    }
]

}

This query returns 20 results, so i filtered it by limit=1. but i just need to access the sub-component of numid, i.e, i want to access cset which has value 989898.

I tried this url, but its not working; "http://example.com/api/v2.0/deliverable/?numb=339&cset=989898&limit=1&order_by=-id&format=json"

Please help me.

1 Answer 1

0

It's not entirely clear what you're trying to do. Do you want the entire record that contains cset: 989898 or do you want only the cset portion of the record to be returned? getting the entire record that matches the cset value passed as a request parameter is an implementation detail that depends on how you've implemented record filtering on the server side. Getting ONLY the cset portion of the record is functionality that you would likely need to implement yourself. This, of course, depends on what REST framework you're using to process these requests.

1
  • I want to access the cset of the record to be returned. but i have got the same information from another REST API URL. Thanks for your kind help.
    – Sakthi
    Commented Oct 18, 2013 at 21:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.