Donation API Level Error

Options

A (ghost) donation form has been set up. When I try submitting to the donation API, the following error comes back:

"The donation level was not found or is not accessible. If the level exists, be sure that it is published"

The level is published and the correct donation form ID included in the API params.

As near as I can tell, the issue is with the Donation API expecing the level fields to be named "level_id", whereas the donation form gave them the name "level_standardexpanded". I thought setting the API param level_id to "level_standardexpanded" would resolve the issue, however I am still seeing the same API error.

So, how do I get around this error, or rename the auto-named donation form level fields?

Tagged:

Comments

  • The correct parameter name is level_id - none of the API arguments use the same names as what is used in the generated forms.

    I have seen 2 problems that can manifest as strange errors:

    One was extraneous arguments being passed to the API. These extraneous arguments were a result of copying the generated HTML from a donation page and including either the argument "df_id=..." or "idb=...", which had been copied from the generated HTML of the ghost form. I'm not sure which one was causing the problem, but removing all of the extranous arguments fixed the problem. I have a bug queued up to figure out exactly what is going on, but if you use just the parameters that are documented for the API you should not experience this problem.

    The other was failure to improperly escape a '#' in the AJAX call. The '#' character in the body of a post will basically cause everything after it to be ignored.

    If neither one of these is the problem, you probably need to send me the HTML or post it here so I can take a look.

    Dave

Categories