Skip to content

GET all Companies

Ksenyia edited this page Feb 1, 2017 · 5 revisions

Getting list of the companies limited by 2 parameters "limit" and "skip". To get the whole list, please set limit=0 and skip=50000 (Resource URI: 'companies/0/50000')

Resource URI

companies/{limit}/{skip}

Resource Properties

Parameter Description
limit It limit the search. Default is 50. Eg. companies/50/0
skip Offset of next page result. Default is 0. Eg. companies/50/0

Response Attribute

{
    company_count: Integer,
    errorList: Array,
    companies: [
        {
            _id: String,
            company_name: String,
            company_groups: [
                 {
                     _id: String,
                     company_group_name: String
                 }
             ],
             project_count: Integer,
             site_count: Integer,
             field_count: Integer,
             transfer_count: Integer
        }
    ]
}

HTTP GET

Default Request

curl -GET http://end-point-uri/companies/50/0

Response

HTTP Status Code 200

{
    company_count: 1037, 
    errorList: [],
    companies: [
        {
            _id: "56fcd522641ff90100863140",
            company_name: "Bendon Internationa Ltd",
            company_groups: [
                 {
                     _id: "56a14d8ee47b92f110ce9a58",
                     company_group_name: "Exxon"
                 }
             ],
             project_count: 1,
             site_count: 0,
             field_count: 0,
             transfer_count: 0
        },
        ...
    ]
}
Clone this wiki locally