Доступ к справочнику улиц



Структура моделей, назначение полей

Модель Street(инфо. улицы)

Модель Street — представляет справочник улиц

* @property integer $id
* @property string $title // название
* @property integer $city_id // Город
* @property string $type // тип, может принимать значение - 'street','bulvar','pereulok','prospect','proezd'

Пример запросов

Пример street

curl -i -H "Accept: application/json" -H "X-REST-API-KEY: 950a183ccebb639d464c04ed4b70528b" http://example/rest/api/street

{

   "success": true,
   "message": "Records Retrieved Successfully",
   "data": {
       "totalCount": "37",
       "street": [
           {
               "id": "2",
               "title": "Мирная",
               "city_id": "252",
               "type": "street",
               "city": {
                   "id": "252",
                   "title": "Москва"
               }
           },
           {
               "id": "8",
               "title": "Усова",
               "city_id": "268",
               "type": "prospect",
               "city": {
                   "id": "268",
                   "title": "Анапа"
               }
           },
           {
               "id": "28",
               "title": "Красная",
               "city_id": "255",
               "type": "street",
               "city": {
                   "id": "255",
                   "title": "Краснодар"
               }
           },
           {
               "id": "30",
               "title": "Уральская",
               "city_id": "255",
               "type": "street",
               "city": {
                   "id": "255",
                   "title": "Краснодар"
               }
           },
           {
               "id": "31",
               "title": "ул. Тургенева",
               "city_id": "255",
               "type": "street",
               "city": {
                   "id": "255",
                   "title": "Краснодар"
               }
           },
           {
               "id": "33",
               "title": "Уч.хоз.",
               "city_id": "256",
               "type": "street",
               "city": {
                   "id": "256",
                   "title": "Уч.хоз. \"Кубань\""
               }
           }
       ]
   }

}

{

   "success": true,
   "message": "Record Retrieved Successfully",
   "data": {
       "totalCount": 1,
       "street": {
           "id": "2",
           "title": "Мирная",
           "city_id": "252",
           "type": "street",
           "city": {
               "id": "252",
               "title": "Москва"
           }
       }
   }

}