cs_api_dotnet.CaseStackApi.GetShipment C# (CSharp) Method

GetShipment() public method

Get Shipment by ID
public GetShipment ( int shipmentId ) : Shipment
shipmentId int Shipment ID
return Shipment
        public Shipment GetShipment(int shipmentId)
        {
            var client = GetRestClient();
            var request = new RestRequest
            {
                Resource = "api/shipment/" + shipmentId,
                RequestFormat = DataFormat.Json,
                RootElement = "Shipment"
            };

            var response = client.Execute<Shipment>(request);
            if (response.ErrorException != null)
                throw new ApplicationException("Error retrieving Shipment", response.ErrorException);

            var shipment = response.Data;
            return shipment;
        }