HTTP 422 Error with Postmark

Hi All,

I have been struggling with the Postmark API giving me a Http 422 Error when I try to use the API in a backend workflow, I came across a not from way back in November of folks expressing similar frustrations and am wondering if this is something that continues to plague people.

@Alter345 @AdamBFM @gf_wolfer did you guys find a solution to your problems in post Postmark problem API call , break my calls

This is driving me crazy so if any one can shed light on this, I would be very grateful.

Cheers

KH

Hi Kevin, yes, the solution is that you JSON must be perfectly correct … do you have the json extract to show us ?

1 Like

Hi @Alter345

Thanks for your response!!
I have initialized the API call without any problems.


I run the API in the backend with overrides on privacy rules


I have json safe on all data that gets fed into the api.

what I do not show here is a the concatenation of the URL - I take a base parameterized URL and concatenate the email of the recipient on the end.

I have added the concatenation back in and json safe’d it . I still get the error.

Workflow error - The service Postmark - Send - Signed Up But Not Subscribed just returned an error (HTTP 422). Please consult their documentation to ensure your call is setup properly. Raw error:


{"ErrorCode":402,"Message":"Invalid JSON"}

If a field is empty, it will broke your json
see attached how i set it upt using “if empty” can you try this ?
also, what i can advise is to get the json send to postmark support to ask them what is wrong
then use conditions as attached
hope that helps

thanks. I don’t think that I have any fields that are empty but I will try this!

I am unfamiliar with putting "not specified " as a delimiter. Is this a predefined value in Bubble. I don’t seem to have anything that equates to “non reseigne” in the English version of Bubble.

I will assume that equates to leaving the delimiter blank. Let me know if I am wrong on this. Cheers

@Alter345 can you explain what “non renseigne” means in this context?

Its just in case the field is empty, we still add something on the json
did you find a solution ?

Hi @Alter345 thanks for followingup. I still have no solution as I had to take a break - I had been up all night on this and crashed. … I still do not understand what “non reseigne” translates to in English. Is it “null” or is that what shows up when you leave it blank. ChatGPT seems to say blank but Bubble does not write “blank” when I leave the delimter blank in the English verion. at least not for mine. Did you write that on top of the image to provide clarity?

@kevin.hunt

I just reopened my computer to answer you since I’ve been in the same situation (even though it’s Friday and I’ve had a couple of beers :wink: ;)).

Regarding the term “non renseigné,” it’s simply a French phrase meaning “not filled in.” It allows me to have something in the JSON in case the field is empty. Because, again, if the field is sent empty, it breaks the JSON.

Another piece of advice is to use RequestBin (see here: How to see json being sent through API connector).

You can set it up, for example, with this: RequestBin — A modern request bin to collect, inspect and debug HTTP requests and webhooks - Pipedream. The basic idea is to change the URL where you send the call. By doing this, you get the exact JSON sent, and then you can check the JSON with tools like this: https://jsonlint.com/ OR (better) send the result to Postmark and ask them why you have an error.

Hope that helps.

1 Like

@Alter345 Your suggesting that I use RequestBin was huge! What a fantastic tool!!! I was able to figure out in minutes how to get Bubble and Postmark to work together.

I may be wrong but my impression is that the issue I was facing is a case of battling json corrections between the two platforms. Idiot proofing go awry. Anyway, you were a life saver!

1 Like