Skip to content

Shipping Detail

GET

using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using Wdcs.Wip.Api;
using Wdcs.Wip.Client;
using Wdcs.Wip.Model;

namespace wip_project.Api
{
    public partial class ShippingDetailService : IGetApi
    {
        public async Task GetAsync(string apiUrl, string username, string password)
        {
            var config = new Configuration()
            {
                BasePath = apiUrl
            };
            var tokenRequest = new TokenApi(config);
            // Get the Token

            var response = tokenRequest.Create(new TokenUser(username, password));
            var authorization = "Bearer " + response.AuthToken;
            // Instantiate API
            var Api = new ItemUnitOfMeasuresApi(config);
            var ShippingD = await Api.GetAsync(authorization: authorization);
            foreach (var ShD in ShippingD.Results)
            {
                Console.WriteLine($"Item: {ShD.ItemId} Details: {ShD.UomId}");
            }
            Console.ReadKey();
        }
    }
}