POST api/GetCarrierInfo_V1

Get Carrier Info: name, type, services, shipment options, etc...

Request Information

URI Parameters

None.

Body Parameters

The request is presented below!

WS_Repository.Models.Requests.Carrier.GetCarrierRequest
NameDescriptionTypeAdditional information
CarrierId

Mandatory; Carrier id for which to get info

integer

None.

ServiceCode

Optional; Service Code of the carrier for which to get the info

string

None.

WS_Key

(Mandatory) Webservice Key provided by 2ship support

string

None.

Request Formats

application/json, text/json

Sample:
{
  "CarrierId": 1,
  "ServiceCode": "sample string 2",
  "WS_Key": "sample string 3"
}

application/xml, text/xml

Sample:
<GetCarrierRequest xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/WS_Repository.Models.Requests.Carrier">
  <CarrierId>1</CarrierId>
  <ServiceCode>sample string 2</ServiceCode>
  <WS_Key>sample string 3</WS_Key>
</GetCarrierRequest>

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.GetCarrierRequest'.

Response Information

Resource Description

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.

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",
      "AdditionalOptionInfo": {
        "OptionType": 0,
        "OptionTypeFieldName": "sample string 1",
        "AdditionalFieldsType": {
          "HaveNotes": true,
          "HaveContactPerson": true,
          "HavePhoneNumber": true
        }
      }
    },
    {
      "code": 2,
      "name": "sample string 3",
      "AdditionalOptionInfo": {
        "OptionType": 0,
        "OptionTypeFieldName": "sample string 1",
        "AdditionalFieldsType": {
          "HaveNotes": true,
          "HaveContactPerson": true,
          "HavePhoneNumber": true
        }
      }
    }
  ]
}

application/xml, text/xml

Sample:
<CarrierReply xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/WS_Repository.Models.Responses.Carrier">
  <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>
      <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>
      <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>