API Export 422 error

I am trying to connect some products of our Shopify e-commerce to another e-commerce using Parabola API Export. This is the simplest configuration:

However, when I run the process, it shows this error:

I am new using this tool and my knowledge about JSON and API is limited. Any idea about where is the fault? I was testing the system against a MOck server and it was working with no errors.

Hi @Manuel! I see you’re getting a 422 - Unprocessable Entitle Error. This means that the request was correct, but there was a problem with what you asked the API to do.

From your screenshot, I’m seeing the API’s error message says, "The 0.currency field is required" and so on. From what I can tell in your screenshot, it looks like you’re mapping all the required fields.

Is it possible that the field names for your API is actually something like, 0.currency, 0.manufacturer, 0.manufacturer_sku, 0.price, 0.sku, 0.title?

If you’re able to link us to the API docs you’re referencing, we can take a closer look!

1 Like

Hi @sachi, I have changed the destination fields, but it was not successful.

You can find the information about APi in this link:

Hi @Manuel - Thanks for giving that a try and sending the documentation over.

I learned that the 0. means that its parsing our request as an element of an array and it’s indicating that it failed in the 0th position, when trying to export the first row of data. Sorry for misdirecting you!

Took a look at the docs and your Body section looks mostly correct. Can you try wrapping your entire Body section with square brackets [ ]?

Let me know how that goes!

1 Like

Hi @sachi,

Thanks for your support, now it works! Sincerely, I wrapped it initially but I should make another mistake and though it was due to the square brackets.

Regards.

Hi @sachi,

It looks the file arrives, however the endpoint reports there is only on row of data in the file and that is the last one. Any suggestion?

only one row of data…

Hey @Manuel - Interesting, it seems like the API isn’t allowing us to export row-by-row and instead needs all the data in a single request.

To workaround this problem, please add an Insert Column step and a Merge Values step right before your Send to API step.

In the Insert Column step, we’re going to create a new column that replicates the body you’re sending in your API step minus the square brackets [ ], like so:

In the Merge Values step, we’re going to create a comma-separated blob of the new API Body column you created with the Insert Column step.

  • Select API Body under “Merge all the values in the following columns”
  • And separate each value by , (with no space).
  • Keep create a new row for each unique value in the following columns blank.

Once you do have a single cell that contains all the data you’re trying to export, update the body of your API Export step to just be:

[{new_merge_value_column}]

That should do the trick, and export all the data to the API in a single request. Let me know how that goes!

2 Likes

Thanks @sachi,

That works!!

Regards.

Manuel

4 Likes

Awesome! Glad to hear it :slight_smile:

Hey, has the Merge Values step been renamed or removed? I cannot find a way to combine the newly created API Body column into a single cell as described. Thank you.

Hi @Gregory_Parsons :wave: yes, it has been renamed to Merge duplicate rows.
(The Insert column step was also renamed to Insert text column.)

1 Like

Thanks, can you assist in configuring the Merge Duplicate Rows Step to achieve the result claimed in the discussion - i.e. achieving all data in one ‘cell’ resulting in a “Send to API” Step with a single API Request output?
I have only been able to achieve all rows being sent separately.
Thank you

@Gregory_Parsons sure thing! Here’s how to configure this:

2 Steps: Insert text column - > Merge duplicate rows

(Double-click on screenshot to enlarge/zoom in. Note: in Insert Text Column Common value section, the underlined red {" } is auto-formatting that will be skipped during the step’s function.)

The Insert text column step adds two columns: (1) an API Body column that replicates the Body Request you’d send in a Send to an API step and (2) a Merge column with the value of 1 (to help the following step merge values). Then in the connected Merge duplicate rows step, merge API body per unique value in Merge column by the dimeter of , comma.

1 Like