Esempio n. 1
0
        public async Task <string> CreateImportedShipment(xAddress addr, string receiverEmail, string orderId, string deliveryCode, string shippingId)
        {
            //get token :)
            var responseString = await "https://app.pakkelabels.dk/api/public/v2/users/login"
                                 .PostUrlEncodedAsync(new { api_user = "******", api_key = "1031bb73-6770-46eb-9960-6b1ab31d322e" })
                                 .ReceiveString();

            _token = JsonConvert.DeserializeObject <PakkelabelsToken>(responseString);

            return(await PostRequest("https://app.pakkelabels.dk/api/public/v2/shipments/imported_shipment", new
            {
                token = _token.token,
                order_id = orderId,
                shipping_agent = deliveryCode,
                shipping_product_id = shippingId,
                weight = "1000",

                receiver_name = addr.firstname,
                receiver_address1 = addr.address1,
                receiver_zipcode = addr.zipcode,
                receiver_city = addr.city,
                receiver_country = addr.countryId,
                receiver_mobile = addr.phone,
                receiver_email = receiverEmail,

                sender_email = "*****@*****.**",
                sender_name = "Anthony Shevlin",
                sender_address1 = "Favrgaardsvej 77",
                sender_zipcode = "8300",
                sender_country = "DK",
                sender_city = "Odder",
                services = "11, 12"
            }));
        }
Esempio n. 2
0
        public async Task <string> GetFreightRatesByCountry(string country)
        {
            var responseString = await "https://app.pakkelabels.dk/api/public/v2/users/login"
                                 .PostUrlEncodedAsync(new { api_user = "******", api_key = "1031bb73-6770-46eb-9960-6b1ab31d322e" })
                                 .ReceiveString();

            _token = JsonConvert.DeserializeObject <PakkelabelsToken>(responseString);

            return(await GetRequest("https://app.pakkelabels.dk/api/public/v2/shipments/freight_rates", new { token = _token.token, country = country }));
        }
Esempio n. 3
0
        public async Task <string> GetLogin()
        {
            var responseString = await "https://app.pakkelabels.dk/api/public/v2/users/login"
                                 .PostUrlEncodedAsync(new { api_user = "******", api_key = "1031bb73-6770-46eb-9960-6b1ab31d322e" })
                                 .ReceiveString();

            _token = JsonConvert.DeserializeObject <PakkelabelsToken>(responseString);

            return(responseString);
        }