FogBugz Technical Support

A forum for technical support discussion related to Fogbugz.
The current FogBugz Knowledge Base can be found at http://help.fogcreek.com/fogbugz.

Posts by Fog Creek Employees are marked:

Documentation
Release Notes
Network Status

On-demand user and API

Hi,
I'm trying to create a custom form on my server to allow public case submissions.  I'm using this html to post to my FG on-demand api:

<html>
<form method="post" action="http://MYSITE.fogbugz.com/api.asp" enctype="multipart/form-data" >

<input type=hidden name=ixMailbox value="1" />
<input type=hidden name=cmd value="new" />
<input type=hidden name=token value="TOKEN" />

Title: <br/>
<input type="input" name="sTitle" value="" />
<p>

Enter Description<br/>
<textarea name="sEvent" id="sEventEdit" rows="8" cols="55" wrap="virtual"></textarea>
<p>

Email:<br/>
<input type="input" name="sCustomerEmail " value="" /><br/>
<input type="hidden" name="ixArea" value="12" />
<p>

<label for="ixProject">Project:</label>
<select name="ixProject" id="ixProject">
    <option value="5">Project 1</option>
</select>
<p>

<input type="submit" value="Submit Case">

</form>
</html>
------------------------------------
The token is correct because when I use a simple get request pasted into my browser to list Projects, I get the correct XML response. 

However, when I submit this form I always get:
  <?xml version="1.0" encoding="UTF-8" ?>
  <response>
  <error code="3">Not logged on</error>
  </response>

I've double check the all the values and the API docs and I just can't figure out why I keep getting "Not logged on"

Thanks.
Jim Jones Send private email
Thursday, December 6, 2007
 
 
One other bit of useful info:

If I use a straight GET request by pasting this URL into my browser:

https://MYSITE.fogbugz.com/api.asp?cmd=new&cols=ixBug&token=MYTOKEN&sTitle=test&ixProject=5&ixArea=12&sEvent=testaaaaaaa&sCustomerEmail=a@a.com&ixMailbox=1

the new case is created without a problem.

it just doesn't work with an HTML form and POSTing to the /api.asp page.

Thanks..
Jim Jones Send private email
Thursday, December 6, 2007
 
 
I just tried your form with my On Demand account, and it worked after I changed the http:// in the
<form method="post" action="http://MYSITE.fogbugz.com/api.asp" enctype="multipart/form-data" >

line to https://

I think that http:// works in the browser because it auto-redirects, but the form isn't smart enough to do that. 

I'm not sure why you get the completely misleading error message, though (and I got it too when I first tried your form).
Eric Nehrlich Send private email
Thursday, December 6, 2007
 
 
wow.  that worked.  thanks.
Jim Jones Send private email
Thursday, December 6, 2007
 
 
Yeah, our server redirect from http to https can cause problems with machine connections.

I've opened a case to see if we can get better error messages, though.
Eric Nehrlich Send private email
Thursday, December 6, 2007
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
 
Powered by FogBugz Bug Tracking and Evidence-Based Scheduling.