Получение всех архивных грузов [1.0]

Описание

Получение всех грузов из архива. Есть возможность фильтра по контакту.

Структура URL

HTTP метод: GET, ресурс: <base_url>/unpublished-loads?contactId=<contactId>

Результат

Массив структур "Груз"

 

Список параметров

Название
Описание
Способ передачи параметра
Обязательный
contactIdId контакта, для которого необходимо получить грузы. Будут получены только те грузы, у которых ContactId1 == contactId, либо ContactId2 == contactIdURL 

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

Запрос

GET, http://api.ati.su/unpublished-loads?contactId=0

Ответ

Json вида

[
  {
    "Id": "72775eac-196a-e611-80cf-10c37b6f39fc",
    "UpdatedAt": "2016-08-24T16:42:03.86Z",
    "AddedAt": "2016-08-24T16:42:03.86Z",
    "ArchiveDate": "2016-08-24T16:42:04.573Z",
    "CanBeDeleted": true,
    "CanBeEdited": false,
    "CanBeRenewed": false,
    "EditRestriction": 0,
    "DeleteRestriction": 0,
    "RenewRestriction": "",
    "Distance": 947,
    "Zimnik": false,
    "Ferries": false,
    "TruePrice": 0,
    "TrueCurrencyId": 0,
    "ResponseCount": 0,
    "OfferCount": 0,
    "SmsEnabled": false,
    "InsuredMinTariff": 0.041,
    "FirmId": 7561232,
    "ContactId1": 4,
    "ContactId2": null,
    "Note": "Тестовый груз",
    "FirstDate": "2016-08-24T16:42:03.803",
    "LastDate": "2016-08-24T16:42:03.803",
    "DateType": 0,
    "PeriodicityId": 0,
    "Krugoreis": false,
    "Loading": {
      "CityId": 56,
      "Latitude": null,
      "Longitude": null,
      "Street": "",
      "TimeStart": null,
      "TimeEnd": null,
      "LargeCities": []
    },
    "ExtraPoints": [],
    "Unloading": {
      "CityId": 89,
      "Latitude": null,
      "Longitude": null,
      "Street": "",
      "TimeStart": null,
      "TimeEnd": null,
      "LargeCities": []
    },
    "Cargo": {
      "Weight": 769,
      "Volume": 0,
      "ADR": 0,
      "CargoTypeId": 59,
      "CargoType": "Наименование",
      "PackType": 0,
      "PalletCount": 0,
      "BeltCount": 0,
      "DogruzType": 2,
      "SborGruz": false,
      "Size": {
        "Length": 0,
        "Width": 0,
        "Height": 0,
        "LengthHighlight": false,
        "WidthHighlight": false,
        "HeightHighlight": false
      }
    },
    "Transport": {
      "CarType": 122,
      "LoadingType": 0,
      "LoadingLogicalOperator": "OR",
      "UnloadingType": 0,
      "UnloadingLogicalOperator": "OR",
      "TrucksQuantity": 1,
      "TemperatureFrom": null,
      "TemperatureTo": null,
      "Stsepka": false,
      "Pnevmohod": false,
      "Koniki": false,
      "TIR": false,
      "CMR": false,
      "T1": false,
      "SanPassport": false
    },
    "Payment": {
      "CurrencyId": 1,
      "MoneyType": 23,
      "RateSum": 769,
      "SumWithNDS": 0,
      "SumWithoutNDS": 0,
      "PrepayPercent": 0,
      "PrepayPercentEnabled": false,
      "PayDays": 0,
      "PayDaysEnabled": false,
      "FixedRate": true,
      "Torg": false,
      "DirectContract": false,
      "OnUnloading": false
    },
    "PriorityView": null,
    "Stealth": null,
    "Boards": [
      {
        "BoardId": "a0a0a0a0a0a0a0a0a0a0a0a0",
        "PublicationTime": "2016-08-24T16:42:03.86Z",
        "PublicationOption": 0,
        "IsPublished": true
      }
    ],
    "LoadMeta": {
      "LoadMetaId": "f10420a3-3e6d-462c-a90b-f22ec58ab4dc",
      "MetaData": "Данные груза"
    }
  },
  {
    "Id": "83775eac-196a-e611-80cf-10c37b6f39fc",
    "UpdatedAt": "2016-08-24T16:42:07.29Z",
    "AddedAt": "2016-08-24T16:42:07.29Z",
    "ArchiveDate": "2016-08-24T16:42:08.053Z",
    "Distance": 20194,
    "Zimnik": false,
    "Ferries": false,
    "TruePrice": 0,
    "TrueCurrencyId": 0,
    "ResponseCount": 0,
    "OfferCount": 0,
    "SmsEnabled": false,
    "FirmId": 7561232,
    "ContactId1": 4,
    "ContactId2": null,
    "Note": "Тестовый груз",
    "FirstDate": "2016-08-24T16:42:07.107",
    "LastDate": "2016-08-24T16:42:07.107",
    "DateType": 0,
    "PeriodicityId": 0,
    "Krugoreis": true,
    "Loading": {
      "CityId": 15,
      "Latitude": 59.9701335,
      "Longitude": 30.3387451,
      "Street": "улица Смолячкова, 3",
      "TimeStart": "1900-01-01T03:21:01",
      "TimeEnd": "1900-01-01T04:32:01",
      "LargeCities": [
        135,
        170
      ]
    },
    "ExtraPoints": [
      {
        "CityId": 891,
        "PointType": 1
      },
      {
        "CityId": 6221,
        "PointType": 3
      },
      {
        "CityId": 270,
        "PointType": 3
      },
      {
        "CityId": 80,
        "PointType": 2
      },
      {
        "CityId": 200,
        "PointType": 1
      }
    ],
    "Unloading": {
      "CityId": 17,
      "Latitude": 55.7201493,
      "Longitude": 37.5540161,
      "Street": "Новолужнецкий проезд, 11 строение 1",
      "TimeStart": "1900-01-01T05:43:01",
      "TimeEnd": "1900-01-01T06:54:01",
      "LargeCities": [
        251,
        1262
      ]
    },
    "Cargo": {
      "Weight": 939,
      "Volume": 939,
      "ADR": 8,
      "CargoTypeId": 59,
      "CargoType": "Наименование",
      "PackType": 2,
      "PalletCount": 5,
      "BeltCount": 6,
      "DogruzType": 2,
      "SborGruz": true,
      "Size": {
        "Length": 1,
        "Width": 2,
        "Height": 3,
        "LengthHighlight": true,
        "WidthHighlight": true,
        "HeightHighlight": true
      }
    },
    "Transport": {
      "CarType": 122,
      "LoadingType": 7,
      "LoadingLogicalOperator": "AND",
      "UnloadingType": 4102,
      "UnloadingLogicalOperator": "OR",
      "TrucksQuantity": 2,
      "TemperatureFrom": null,
      "TemperatureTo": null,
      "Stsepka": true,
      "Pnevmohod": true,
      "Koniki": true,
      "TIR": true,
      "CMR": true,
      "T1": true,
      "SanPassport": true
    },
    "Payment": {
      "CurrencyId": 1,
      "MoneyType": 23,
      "RateSum": 939,
      "SumWithNDS": 432,
      "SumWithoutNDS": 454,
      "PrepayPercent": 50,
      "PrepayPercentEnabled": true,
      "PayDays": 9,
      "PayDaysEnabled": true,
      "FixedRate": true,
      "Torg": true,
      "DirectContract": true,
      "OnUnloading": false
    },
    "PriorityView": null,
    "Stealth": null,
    "Deal": null,
    "Boards": [
      {
        "BoardId": "a0a0a0a0a0a0a0a0a0a0a0a0",
        "PublicationTime": "2016-08-24T16:42:07.29Z",
        "PublicationOption": 0,
        "IsPublished": true
      }
    ],
    "LoadMeta": {
      "LoadMetaId": "f10420a3-3e6d-462c-a90b-f22ec58ab4dc",
      "MetaData": "Данные груза"
  }
 }
]

 

Список ответов сервера

Каждая ошибка кроме HTTP кода имеет уникальный строковый код. Подробнее..

HTTP код ответаКод ошибкиСообщение
200--Операция завершена успешно
401--Требуется авторизация
404contact_not_found_errorКонтакт, указанный в contactId не найден