0

Hey,

I can log in to Fogbuz, but when I try to log in by xml it will not log on. Following this is a log on attempt. Any ideas why it will not work out?

thanks Brandon Marick

public bool Login(string email, string password)
    {
        Url url = new Url(Api.BaseApiUrl);
        url.AddExtension(this.ApiExtension);
        url.AddQuery("cmd", "logon");
        url.AddQuery("email", email);
        url.AddQuery("password", password);

        XmlDocument xml = new XmlDocument();
        WebResponse response = url.Post();

        xml.Load(response.GetResponseStream());
        response.Close();

        if(xml.GetElementsByTagName("error").Count > 0)
            return(false);

        this.ApiSessionToken = xml.GetElementsByTagName("token")[0].InnerText;
        this.ApiLoggedIn = true;
        this.ApiLogonEmail = email;

        if (this.Filters.Values.Any(f => f.status == "current"))
            this.OriginalFilter = this.Filters.Values.Where(f => f.status == "current").First();
        else
            this.OriginalFilter = null;

        this.SetFilter("All");

        return(true);
    }
flag
What's the XML you get in response? – James McLeod Jul 13 at 17:19
i am getting error code 3, not logged in – bmarick Jul 13 at 17:29
And what are the values of Api.BaseApiURL and this.ApiExtension? – James McLeod Jul 13 at 19:09
Error code 3 is not an expected response for logon - the API documentation says "7.If the token is not supplied, or if the token does not correspond to a logged-in user, you'll get error code 3". When to you see Error Code 3? What is the immediate preceeding request? – James McLeod Jul 13 at 19:15
you get it at the response.Close(); I send in the url: a@#$%@#e.fogbugz.com/api.asp?cmd=logon&email=bmarick@a#$#@c.net&password=***** – bmarick Jul 13 at 19:59
show 1 more comment

closed as too localized by Rich Armstrong♦♦ Jul 19 at 15:37

1 Answer

0

We attempted to troubleshoot this with you directly and it ended up being a typo in an underlying library, I think. This came up when you inspected the request directly. Let me know if that's not the case.

link|flag

Not the answer you're looking for? Browse other questions tagged or ask your own question.