Cannot create new customer

Dharmesh Parekh's Avatar

Dharmesh Parekh

18 Jan, 2014 07:55 AM

I found error: the remote server returned an error: (404) not found while creating new customer using c#.net.

        try
        {
           Customers customers = new Customers();
            Customer newCustomer = new Customer();

            string urlBase = "https://cheddargetter.com/xml";
            string urlPath = string.Format("/customers/new/productCode/{0}", _ProductCode);
            string postParams = string.Format(
                "code={0}" +
                "&firstName={1}" +
                "&lastName={2}" +
                "&email={3}" +
                "&company={4}" +
                "&subscription[planCode]={5}" +
                "&subscription[ccFirstName]={6}" +
                "&subscription[ccLastName]={7}" +
                "&subscription[ccNumber]={8}" +
                "&subscription[ccExpiration]={9}" +
                "&subscription[ccCardCode]={10}" +
                "&subscription[ccZip]={11}",
                HttpUtility.UrlEncode(customer.Code),
                HttpUtility.UrlEncode(customer.FirstName),
                HttpUtility.UrlEncode(customer.LastName),
                HttpUtility.UrlEncode(customer.Email),
                HttpUtility.UrlEncode(customer.Company),
                HttpUtility.UrlEncode(customer.PlanCode.ToString().ToUpper()),
                HttpUtility.UrlEncode(customer.CCFirstName),
                HttpUtility.UrlEncode(customer.CCLastName),
                HttpUtility.UrlEncode(customer.CCNumber),
                HttpUtility.UrlEncode(customer.CCExpiration),
                HttpUtility.UrlEncode(customer.CCCardCode),
                HttpUtility.UrlEncode(customer.CCZip));

            string result = postRequest(urlBase, urlPath, postParams);
            XDocument newCustomerXML = XDocument.Parse(result);

            customers = getCustomerList(newCustomerXML);

            if (customers.CustomerList.Count > 0)
            {
                newCustomer = customers.CustomerList[0];
            }
        }
        catch (Exception ex)
        {
            throw ex;
        }

Please help me to solve it.

  1. 1 Posted by Jess Pendley on 20 Jan, 2014 03:41 PM

    Jess Pendley's Avatar

    Hi Dharmesh --

    Without the body content of that error it's very difficult for us to determine what may have caused your call to generate a 404 response.

    Capture the raw api request and you should be able to see what is generating the error. If you cannot determine it, send the information that you can acquire to us and we'll take a look for you.

  2. Jess Pendley closed this discussion on 20 Jan, 2014 03:41 PM.

Discussions are closed to public comments.
If you need help with Cheddar please start a new discussion.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac

Recent Discussions

28 Mar, 2024 10:45 PM
24 Jan, 2024 08:33 AM
11 Jan, 2024 07:13 AM
30 Nov, 2023 02:07 AM
22 Nov, 2023 08:41 AM