POST api/GetCarriers_V1

Get All Carriers with with all info: name, type, services, shipment options, etc..., for a specific sender

Request Information

URI Parameters

None.

Body Parameters

The request is presented below!

WS_Repository.Models.Requests.Carrier.GetCarriersRequest
NameDescriptionTypeAdditional information
WS_Key

Mandatory; Webservice Key provided by 2ship support

string

None.

LocationId

Optional (Mandatory if Type = "Location") Location Id from where to get the carriers linked too!

integer

None.

Address

Optional (Mandatory if Type = "Address") Location Address from where to get the carriers linked too!

WS_Repository.Models.Requests.Carrier.Contact

None.

Type

Mandatory The Type of the request

WS_Repository.Models.Requests.Carrier.RequestType

None.

Request Formats

application/json, text/json

Sample:
{
  "WS_Key": "sample string 1",
  "LocationId": 2,
  "Address": {
    "Country": "sample string 1",
    "State": "sample string 2",
    "City": "sample string 3",
    "PostalCode": "sample string 4"
  },
  "Type": 0
}

application/xml, text/xml

Sample:
<GetCarriersRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/WS_Repository.Models.Requests.Carrier">
  <Address>
    <City>sample string 3</City>
    <Country>sample string 1</Country>
    <PostalCode>sample string 4</PostalCode>
    <State>sample string 2</State>
  </Address>
  <LocationId>2</LocationId>
  <Type>Address</Type>
  <WS_Key>sample string 1</WS_Key>
</GetCarriersRequest>

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.Carrier.GetCarriersRequest'.

Response Information

Resource Description

Collection of WS_Repository.Models.Responses.Carrier.CarrierReply
NameDescriptionTypeAdditional information
Id

Carrier Id

integer

None.

SCAC

Carrier SCAC (Standard Carrier Alfa Code)

string

None.

Name

Carrier Name

string

None.

Type

Carrier Type

WS_Repository.Models.Responses.Carrier.CarrierType

None.

Services

Array of Carrier Services

Collection of WS_Repository.Models.Responses.Carrier.CarrierService

None.

Options

Array of Carrier ShipmentOptions

Collection of WS_Repository.Models.Responses.Carrier.ShipmentOption

None.

HasQRCodeLabelPrinting

QR Code Label Printing

boolean

None.

Response Formats

application/json, text/json

Sample:
[
  {
    "Id": 1,
    "SCAC": "sample string 2",
    "Name": "sample string 3",
    "Type": 0,
    "Services": [
      {
        "Name": "sample string 1",
        "Code": "sample string 2",
        "Origin": "sample string 3",
        "Destination": "sample string 4"
      },
      {
        "Name": "sample string 1",
        "Code": "sample string 2",
        "Origin": "sample string 3",
        "Destination": "sample string 4"
      }
    ],
    "Options": [
      {
        "code": 2,
        "name": "sample string 3",
        "HasAdditionalOptionInfo": true,
        "AdditionalOptionInfo": {
          "OptionType": 0,
          "OptionTypeFieldName": "sample string 1",
          "AdditionalFieldsType": {
            "HaveNotes": true,
            "HaveContactPerson": true,
            "HavePhoneNumber": true
          }
        },
        "HasSubOptions": true,
        "SubOptions": [
          {
            "Type": 0,
            "Name": "sample string 1",
            "Code": "sample string 2",
            "ValidValues": "sample string 3"
          },
          {
            "Type": 0,
            "Name": "sample string 1",
            "Code": "sample string 2",
            "ValidValues": "sample string 3"
          }
        ]
      },
      {
        "code": 2,
        "name": "sample string 3",
        "HasAdditionalOptionInfo": true,
        "AdditionalOptionInfo": {
          "OptionType": 0,
          "OptionTypeFieldName": "sample string 1",
          "AdditionalFieldsType": {
            "HaveNotes": true,
            "HaveContactPerson": true,
            "HavePhoneNumber": true
          }
        },
        "HasSubOptions": true,
        "SubOptions": [
          {
            "Type": 0,
            "Name": "sample string 1",
            "Code": "sample string 2",
            "ValidValues": "sample string 3"
          },
          {
            "Type": 0,
            "Name": "sample string 1",
            "Code": "sample string 2",
            "ValidValues": "sample string 3"
          }
        ]
      }
    ],
    "HasQRCodeLabelPrinting": true
  },
  {
    "Id": 1,
    "SCAC": "sample string 2",
    "Name": "sample string 3",
    "Type": 0,
    "Services": [
      {
        "Name": "sample string 1",
        "Code": "sample string 2",
        "Origin": "sample string 3",
        "Destination": "sample string 4"
      },
      {
        "Name": "sample string 1",
        "Code": "sample string 2",
        "Origin": "sample string 3",
        "Destination": "sample string 4"
      }
    ],
    "Options": [
      {
        "code": 2,
        "name": "sample string 3",
        "HasAdditionalOptionInfo": true,
        "AdditionalOptionInfo": {
          "OptionType": 0,
          "OptionTypeFieldName": "sample string 1",
          "AdditionalFieldsType": {
            "HaveNotes": true,
            "HaveContactPerson": true,
            "HavePhoneNumber": true
          }
        },
        "HasSubOptions": true,
        "SubOptions": [
          {
            "Type": 0,
            "Name": "sample string 1",
            "Code": "sample string 2",
            "ValidValues": "sample string 3"
          },
          {
            "Type": 0,
            "Name": "sample string 1",
            "Code": "sample string 2",
            "ValidValues": "sample string 3"
          }
        ]
      },
      {
        "code": 2,
        "name": "sample string 3",
        "HasAdditionalOptionInfo": true,
        "AdditionalOptionInfo": {
          "OptionType": 0,
          "OptionTypeFieldName": "sample string 1",
          "AdditionalFieldsType": {
            "HaveNotes": true,
            "HaveContactPerson": true,
            "HavePhoneNumber": true
          }
        },
        "HasSubOptions": true,
        "SubOptions": [
          {
            "Type": 0,
            "Name": "sample string 1",
            "Code": "sample string 2",
            "ValidValues": "sample string 3"
          },
          {
            "Type": 0,
            "Name": "sample string 1",
            "Code": "sample string 2",
            "ValidValues": "sample string 3"
          }
        ]
      }
    ],
    "HasQRCodeLabelPrinting": true
  }
]

application/xml, text/xml

Sample:
<ArrayOfCarrierReply xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/WS_Repository.Models.Responses.Carrier">
  <CarrierReply>
    <HasQRCodeLabelPrinting>true</HasQRCodeLabelPrinting>
    <Id>1</Id>
    <Name>sample string 3</Name>
    <Options>
      <ShipmentOption>
        <AdditionalOptionInfo>
          <AdditionalFieldsType>
            <HaveContactPerson>true</HaveContactPerson>
            <HaveNotes>true</HaveNotes>
            <HavePhoneNumber>true</HavePhoneNumber>
          </AdditionalFieldsType>
          <OptionType>Checkbox</OptionType>
          <OptionTypeFieldName>sample string 1</OptionTypeFieldName>
        </AdditionalOptionInfo>
        <HasAdditionalOptionInfo>true</HasAdditionalOptionInfo>
        <HasSubOptions>true</HasSubOptions>
        <SubOptions>
          <SubShipmentOption>
            <Code>sample string 2</Code>
            <Name>sample string 1</Name>
            <Type>IsFlag</Type>
            <ValidValues>sample string 3</ValidValues>
          </SubShipmentOption>
          <SubShipmentOption>
            <Code>sample string 2</Code>
            <Name>sample string 1</Name>
            <Type>IsFlag</Type>
            <ValidValues>sample string 3</ValidValues>
          </SubShipmentOption>
        </SubOptions>
        <code>2</code>
        <name>sample string 3</name>
      </ShipmentOption>
      <ShipmentOption>
        <AdditionalOptionInfo>
          <AdditionalFieldsType>
            <HaveContactPerson>true</HaveContactPerson>
            <HaveNotes>true</HaveNotes>
            <HavePhoneNumber>true</HavePhoneNumber>
          </AdditionalFieldsType>
          <OptionType>Checkbox</OptionType>
          <OptionTypeFieldName>sample string 1</OptionTypeFieldName>
        </AdditionalOptionInfo>
        <HasAdditionalOptionInfo>true</HasAdditionalOptionInfo>
        <HasSubOptions>true</HasSubOptions>
        <SubOptions>
          <SubShipmentOption>
            <Code>sample string 2</Code>
            <Name>sample string 1</Name>
            <Type>IsFlag</Type>
            <ValidValues>sample string 3</ValidValues>
          </SubShipmentOption>
          <SubShipmentOption>
            <Code>sample string 2</Code>
            <Name>sample string 1</Name>
            <Type>IsFlag</Type>
            <ValidValues>sample string 3</ValidValues>
          </SubShipmentOption>
        </SubOptions>
        <code>2</code>
        <name>sample string 3</name>
      </ShipmentOption>
    </Options>
    <SCAC>sample string 2</SCAC>
    <Services>
      <CarrierService>
        <Code>sample string 2</Code>
        <Destination>sample string 4</Destination>
        <Name>sample string 1</Name>
        <Origin>sample string 3</Origin>
      </CarrierService>
      <CarrierService>
        <Code>sample string 2</Code>
        <Destination>sample string 4</Destination>
        <Name>sample string 1</Name>
        <Origin>sample string 3</Origin>
      </CarrierService>
    </Services>
    <Type>SmallPack</Type>
  </CarrierReply>
  <CarrierReply>
    <HasQRCodeLabelPrinting>true</HasQRCodeLabelPrinting>
    <Id>1</Id>
    <Name>sample string 3</Name>
    <Options>
      <ShipmentOption>
        <AdditionalOptionInfo>
          <AdditionalFieldsType>
            <HaveContactPerson>true</HaveContactPerson>
            <HaveNotes>true</HaveNotes>
            <HavePhoneNumber>true</HavePhoneNumber>
          </AdditionalFieldsType>
          <OptionType>Checkbox</OptionType>
          <OptionTypeFieldName>sample string 1</OptionTypeFieldName>
        </AdditionalOptionInfo>
        <HasAdditionalOptionInfo>true</HasAdditionalOptionInfo>
        <HasSubOptions>true</HasSubOptions>
        <SubOptions>
          <SubShipmentOption>
            <Code>sample string 2</Code>
            <Name>sample string 1</Name>
            <Type>IsFlag</Type>
            <ValidValues>sample string 3</ValidValues>
          </SubShipmentOption>
          <SubShipmentOption>
            <Code>sample string 2</Code>
            <Name>sample string 1</Name>
            <Type>IsFlag</Type>
            <ValidValues>sample string 3</ValidValues>
          </SubShipmentOption>
        </SubOptions>
        <code>2</code>
        <name>sample string 3</name>
      </ShipmentOption>
      <ShipmentOption>
        <AdditionalOptionInfo>
          <AdditionalFieldsType>
            <HaveContactPerson>true</HaveContactPerson>
            <HaveNotes>true</HaveNotes>
            <HavePhoneNumber>true</HavePhoneNumber>
          </AdditionalFieldsType>
          <OptionType>Checkbox</OptionType>
          <OptionTypeFieldName>sample string 1</OptionTypeFieldName>
        </AdditionalOptionInfo>
        <HasAdditionalOptionInfo>true</HasAdditionalOptionInfo>
        <HasSubOptions>true</HasSubOptions>
        <SubOptions>
          <SubShipmentOption>
            <Code>sample string 2</Code>
            <Name>sample string 1</Name>
            <Type>IsFlag</Type>
            <ValidValues>sample string 3</ValidValues>
          </SubShipmentOption>
          <SubShipmentOption>
            <Code>sample string 2</Code>
            <Name>sample string 1</Name>
            <Type>IsFlag</Type>
            <ValidValues>sample string 3</ValidValues>
          </SubShipmentOption>
        </SubOptions>
        <code>2</code>
        <name>sample string 3</name>
      </ShipmentOption>
    </Options>
    <SCAC>sample string 2</SCAC>
    <Services>
      <CarrierService>
        <Code>sample string 2</Code>
        <Destination>sample string 4</Destination>
        <Name>sample string 1</Name>
        <Origin>sample string 3</Origin>
      </CarrierService>
      <CarrierService>
        <Code>sample string 2</Code>
        <Destination>sample string 4</Destination>
        <Name>sample string 1</Name>
        <Origin>sample string 3</Origin>
      </CarrierService>
    </Services>
    <Type>SmallPack</Type>
  </CarrierReply>
</ArrayOfCarrierReply>