POST api/GetLockersAndLocations_V1

Get Lockers, Carrier Locations and Retail Locations based on an address

Request Information

URI Parameters

None.

Body Parameters

The request is presented below!

WS_Repository.Models.Requests.Lockers.GetLockersAndLocationsRequest
NameDescriptionTypeAdditional information
WS_Key

(Required) Webservice Key provided by 2ship support

string

None.

AddressPoint

(Required) From this address are calculated the distances to the returning lockers

WS_Repository.Models.Requests.Lockers.AddressPoint

None.

GetLockers

(Required) Flag - specify to include lockers

boolean

None.

GetCarrierLocations

(Required) Flag - specify to include Carrier Locations

boolean

None.

GetRetailLocations

(Required) Flag - specify to include Retail Locations

boolean

None.

LocationsType

(Required) Specify the type of the returning Lockers/Locations

WS_Repository.Models.Requests.Lockers.LocationsType

None.

MaxDistanceToLockerInKM

(Optional) Specify the max distance to lockers/location in KM - default value is 10 - max value is 100

decimal number

None.

MaxNumberOfPlacesReturned

(Optional) Spcify the max number of places returned - default value is 20 - max value is 100

integer

None.

CarrierId

(Optional) if is not 0 then it only return locations/lockers for that paticular carrier

integer

None.

Request Formats

application/json, text/json

Sample:
{
  "WS_Key": "sample string 1",
  "AddressPoint": {
    "Country": "sample string 1",
    "State": "sample string 2",
    "City": "sample string 3",
    "PostalCode": "sample string 4",
    "Address1": "sample string 5"
  },
  "GetLockers": true,
  "GetCarrierLocations": true,
  "GetRetailLocations": true,
  "LocationsType": 0,
  "MaxDistanceToLockerInKM": 5.0,
  "MaxNumberOfPlacesReturned": 6,
  "CarrierId": 7
}

application/xml, text/xml

Sample:
<GetLockersAndLocationsRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/WS_Repository.Models.Requests.Lockers">
  <AddressPoint>
    <Address1>sample string 5</Address1>
    <City>sample string 3</City>
    <Country>sample string 1</Country>
    <PostalCode>sample string 4</PostalCode>
    <State>sample string 2</State>
  </AddressPoint>
  <CarrierId>7</CarrierId>
  <GetCarrierLocations>true</GetCarrierLocations>
  <GetLockers>true</GetLockers>
  <GetRetailLocations>true</GetRetailLocations>
  <LocationsType>ShipTo</LocationsType>
  <MaxDistanceToLockerInKM>5</MaxDistanceToLockerInKM>
  <MaxNumberOfPlacesReturned>6</MaxNumberOfPlacesReturned>
  <WS_Key>sample string 1</WS_Key>
</GetLockersAndLocationsRequest>

application/x-www-form-urlencoded

Sample:

Failed to generate the sample for media type 'application/x-www-form-urlencoded'. Cannot use formatter 'System.Web.Http.ModelBinding.JQueryMvcFormUrlEncodedFormatter' to write type 'WS_Repository.Models.Requests.Lockers.GetLockersAndLocationsRequest'.

Response Information

Resource Description

WS_Repository.Models.Responses.Lockers.GetLockersAndLocationsResponse
NameDescriptionTypeAdditional information
Success

Specify if the response has no errors

boolean

None.

Message

Error messages

string

None.

Places

Location/Lockers list

Collection of WS_Repository.Models.Responses.Lockers.LockerOrLocation

None.

Response Formats

application/json, text/json

Sample:
{
  "Success": true,
  "Message": "sample string 2",
  "Places": [
    {
      "LocationType": 1,
      "Latitude": "sample string 1",
      "Longitude": "sample string 2",
      "Postal": "sample string 3",
      "City": "sample string 4",
      "State": "sample string 5",
      "Country": "sample string 6",
      "Address1": "sample string 7",
      "Address2": "sample string 8",
      "Address3": "sample string 9",
      "Name": "sample string 10",
      "DistanceInKM": 11.0,
      "Id": "sample string 12",
      "Location": "sample string 13",
      "Observations": "sample string 14",
      "LocationTypeDescription": "sample string 15",
      "HasQRCodeLabelPrinting": true,
      "Provider": "sample string 17",
      "MaxLength": 1.0,
      "MaxWidth": 1.0,
      "MaxHeight": 1.0,
      "MaxWeight": 1.0,
      "MeasurementSystemMetric": true,
      "Carriers": [
        1,
        2
      ]
    },
    {
      "LocationType": 1,
      "Latitude": "sample string 1",
      "Longitude": "sample string 2",
      "Postal": "sample string 3",
      "City": "sample string 4",
      "State": "sample string 5",
      "Country": "sample string 6",
      "Address1": "sample string 7",
      "Address2": "sample string 8",
      "Address3": "sample string 9",
      "Name": "sample string 10",
      "DistanceInKM": 11.0,
      "Id": "sample string 12",
      "Location": "sample string 13",
      "Observations": "sample string 14",
      "LocationTypeDescription": "sample string 15",
      "HasQRCodeLabelPrinting": true,
      "Provider": "sample string 17",
      "MaxLength": 1.0,
      "MaxWidth": 1.0,
      "MaxHeight": 1.0,
      "MaxWeight": 1.0,
      "MeasurementSystemMetric": true,
      "Carriers": [
        1,
        2
      ]
    }
  ]
}

application/xml, text/xml

Sample:
<GetLockersAndLocationsResponse xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/WS_Repository.Models.Responses.Lockers">
  <Message>sample string 2</Message>
  <Places>
    <LockerOrLocation>
      <Address1>sample string 7</Address1>
      <Address2>sample string 8</Address2>
      <Address3>sample string 9</Address3>
      <Carriers xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:int>1</d4p1:int>
        <d4p1:int>2</d4p1:int>
      </Carriers>
      <City>sample string 4</City>
      <Country>sample string 6</Country>
      <DistanceInKM>11</DistanceInKM>
      <HasQRCodeLabelPrinting>true</HasQRCodeLabelPrinting>
      <Id>sample string 12</Id>
      <Latitude>sample string 1</Latitude>
      <Location>sample string 13</Location>
      <LocationType>CarrierLocation</LocationType>
      <LocationTypeDescription>sample string 15</LocationTypeDescription>
      <Longitude>sample string 2</Longitude>
      <MaxHeight>1</MaxHeight>
      <MaxLength>1</MaxLength>
      <MaxWeight>1</MaxWeight>
      <MaxWidth>1</MaxWidth>
      <MeasurementSystemMetric>true</MeasurementSystemMetric>
      <Name>sample string 10</Name>
      <Observations>sample string 14</Observations>
      <Postal>sample string 3</Postal>
      <Provider>sample string 17</Provider>
      <State>sample string 5</State>
    </LockerOrLocation>
    <LockerOrLocation>
      <Address1>sample string 7</Address1>
      <Address2>sample string 8</Address2>
      <Address3>sample string 9</Address3>
      <Carriers xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:int>1</d4p1:int>
        <d4p1:int>2</d4p1:int>
      </Carriers>
      <City>sample string 4</City>
      <Country>sample string 6</Country>
      <DistanceInKM>11</DistanceInKM>
      <HasQRCodeLabelPrinting>true</HasQRCodeLabelPrinting>
      <Id>sample string 12</Id>
      <Latitude>sample string 1</Latitude>
      <Location>sample string 13</Location>
      <LocationType>CarrierLocation</LocationType>
      <LocationTypeDescription>sample string 15</LocationTypeDescription>
      <Longitude>sample string 2</Longitude>
      <MaxHeight>1</MaxHeight>
      <MaxLength>1</MaxLength>
      <MaxWeight>1</MaxWeight>
      <MaxWidth>1</MaxWidth>
      <MeasurementSystemMetric>true</MeasurementSystemMetric>
      <Name>sample string 10</Name>
      <Observations>sample string 14</Observations>
      <Postal>sample string 3</Postal>
      <Provider>sample string 17</Provider>
      <State>sample string 5</State>
    </LockerOrLocation>
  </Places>
  <Success>true</Success>
</GetLockersAndLocationsResponse>