API says "title must not be blank" even when title is set.

chris (at scaledrecognition)'s Avatar

chris (at scaledrecognition)

15 Mar, 2013 06:53 PM

Hi Folks -

I'm POSTing to the API and getting a 422 that reports the title field must not be blank, and yet, the title field is not blank. Here's what I'm sending:

<?xml version="1.0"?>
<ticket><title>as</title><body>
      *User's Email: [email blocked]
      *User's Username: Chris Vander Mey
      *User's Authentication Type (1,2,3)=(fb,goog,evernote): 1
      *Device Type: iPhone Simulator
      *Device OS Version: 6.1
      *App Version: 0.0.25
      *Build Number: 0.0.25</body><tag>userbug</tag><assigned-user-id type="integer">211192</assigned-user-id></ticket>

The Response Body:

<?xml version="1.0" encoding="UTF-8"?>
<errors>
  <error>Title can't be blank</error>
</errors>

Any suggestions?

  1. 1 Posted by chris (at scale... on 15 Mar, 2013 06:54 PM

    chris (at scaledrecognition)'s Avatar

    Hm, the markup ate my XML. Trying again...

    2013-03-15 11:51:20.981 WhiteboardScanner[33752:c07] String Body:<?xml version="1.0"?>
    <ticket><title>as</title><body>
          *User's Email: [email blocked]
          *User's Username: Chris Vander Mey
          *User's Authentication Type (1,2,3)=(fb,goog,evernote): 1
          *Device Type: iPhone Simulator
          *Device OS Version: 6.1
          *App Version: 0.0.25
          *Build Number: 0.0.25</body><tag>userbug</tag><assigned-user-id type="integer">211192</assigned-user-id></ticket>
    2013-03-15 11:51:21.610 WhiteboardScanner[33752:c07] Response Body:<?xml version="1.0" encoding="UTF-8"?>
    <errors>
      <error>Title can't be blank</error>
    </errors>
    2013-03-15 11:51:21.611 WhiteboardScanner[33752:c07] Server returned an invalid response code: 422
    
  2. 2 Posted by Julien on 15 Mar, 2013 07:13 PM

    Julien's Avatar

    Hi Chris,

    You're missing the 'Content-Type: application/xml' header in your call.

    Let me know how that goes.

  3. 3 Posted by chris (at scale... on 15 Mar, 2013 09:07 PM

    chris (at scaledrecognition)'s Avatar

    That did it! Thanks. You might want to edit the page that references the 422 and consider adding the Content-Type header to the error message. I know it's in your docs somewhere, but it might save you an email or two...

    Thanks!

  4. Julien closed this discussion on 15 Mar, 2013 09:31 PM.

Discussions are closed to public comments.
If you need help with Lighthouse 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