Skip to content

GET all Sites or Fields

Ksenyia edited this page Feb 1, 2017 · 8 revisions

Resource URI

sites/{limit}/{skip}/{field}

Resource Properties

Parameter Description
limit It limit the search. Default is 50. Eg. sites/50/0/false
skip Offset of next page result. Default is 0. Eg. sites/50/0/false
field Boolean parameter. Value "true" returns fields, value "false" returns sites

Response Attribute

{
   count: Integer,
   errorList: Array,
   sites: [
     {
         _id: String,
         site_name: String,
         site_status: [
             {
                 source: String,
                 _id: String,
                 timestamp: Date,
                 string: String
             }
         ],
         site_commodity: [
             {
                 _id: String,
                 commodity_name: String,
                 commodity_type: String,
                 commodity_id: String,
             }
         ],
         site_country: [
             {
                  iso2: String,
                  name: String,
                  _id: String
             }
         ],
         field: Boolean (true or false),
         project_id: Array,
         company_count: Integer,
         project_count: Integer,
         concession_count: Integer,
         transfer_count: Integer,
         production_count: Integer
     }
  ]
}

HTTP GET

Default Request

curl -GET http://end-point-uri/sites/50/0/false

Response

HTTP Status Code 200

{
   count: 468,
   errorList: [],
   sites: [
     {
         _id: "56fcd3d8be65cd01000bd7c9",
         site_name: ""Obuasi"",
         site_status: [
             {
                 source: "56fcd3d8be65cd01000bd79c",
                 _id: "56fcd3d8be65cd01000bd7ca",
                 timestamp: "2015-01-01T00:00:00.000Z",
                 string: "production"
             }
         ],
         site_commodity: [
             {
                 _id: "56fcd1e3be65cd01000bd278",
                 commodity_name: "Gold",
                 commodity_type: "mining",
                 commodity_id: "gold",
             },
             ...
         ],
         site_country: [
             {
                  iso2: "GH",
                  name: "Ghana",
                  _id: "56fcd1e4be65cd01000bd32e"
                    
             },
             ...
         ],
         field: false,
         project_id: [ 
             "56fcd3d8be65cd01000bd7c9"
         ],
         company_count: 0,
         project_count: 1,
         concession_count: 0,
         transfer_count: 17
     },
     ...
  ]
}
Clone this wiki locally