Troubleshooting creation of new customer in testing

I'm testing out the CG api using my own java client library, but I'm running into an issue early on.

The following API call works just fine for adding a customer without credit card information to our trial plan:

URL: https://cheddargetter.com/xml/customers/new/productCode/SCORM_CLOUD...
post data:

code=EXAMPLE_CUSTOMER&email=test%40test.com&firstName=Example&subscription%5BplanCode%5D=SCORM_CLOUD_TRIAL&company=Test+Inc.&lastName=Customer

However, with everything else equal, the following call results in a 412 response:

URL: https://cheddargetter.com/xml/customers/new/productCode/SCORM_CLOUD...
post data:

subscription%5BccExpiration%5D=04-2011&code=EXAMPLE_CUSTOMER&subscription%5BccLastName%5D=Customer&email=test%40test.com&firstName=Example&subscription%5BccZip%5D=90210&subscription%5BccNumber%5D=4111111111111111&subscription%5BccFirstName%5D=Example&subscription%5BplanCode%5D=SCORM_CLOUD_LITTLE&company=Test+Inc.&lastName=Customer

Can you see any reason why I'm running into problems with the second test?

Also, is there any way to get more detailed information when an API call fails? A response of 412 leaves me in the dark about what parameter may be invalid or missing.

  1. David - The response should contain information about the missing or
    invalid parameter. A small XML document with an error node is returned.

  2. Marc, thank you. That was one part misreading the error message section on the API page and one part being a java dummy and forgetting about getErrorStream() on a URLConnection. Thanks, I can see a much more informative error message now, which actually tells me that the subscription[ccExpirationDate] should be in MM/YYYY format, not MM-YYYY, as listed in the API doc.

  3. Oops. Just corrected the docs. Thanks for letting us know.

    Yeah -- I remember how java didn't think it should give you the body of an error document without jumping through some hoops. That's annoying. There's a similar annoyance in .Net I've heard.

  4. Will you be making your java client publicly available?

    If nothing else, I'd greatly appreciate a bit of sample java code.

  5. Absolutely. Just need to clean it up a bit, but was certainly planning on it. Is there a preferred method to share the code? Github?

  6. Good news!

    All of the other API wrappers are on GitHub so that would make the most sense. It's up to you though.

  7. Marc Guyer closed this discussion on 06 Oct, 2009 10:12 PM.

  8. Marc Guyer re-opened this discussion on 18 Mar, 2010 04:28 PM

  9. Hello again David! Are you ready to release your Java wrapper to the world?

  10. Hey David,

    I am interested in your Java wrapper for CG. Can you release your code on github? Thanks for your help

  11. Hey David,

    I'm also interested in your Java Wrapper for CG. Would be brilliant to get it out on github. Thanks in advance!

    Tryggvi

  12. I know it's monstrously overdue, but we've finally published our CheddarGetter java wrapper as a public repository on GitHub. https://github.com/RusticiSoftware/CheddarClient

  13. Very cool David. We'll put the word out.

  14. Marc Guyer closed this discussion on 28 Apr, 2011 07:23 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