Marketo Rest API Deleting and Rearranging Fields Issues

Matt_Walcher
Level 1

Marketo Rest API Deleting and Rearranging Fields Issues

We are in the process of mass updating our forms with the Marketo REST API to replace an old field with a new field. Right now am I testing my script on a single test form until it's ready.

The script is almost complete, but I'm having 2 issues with the API:

  1. The API returns a success response when I try to update field positions in the form, but the fields have not been rearranged.
    Endpoint Reference: https://developers.marketo.com/rest-api/endpoint-reference/asset-endpoint-reference/#!/Form_Fields/u...
  2. When I try to delete a field from the form I get this error message that seems to be referring to a different request and even the error code seems irrelevant because it is for an invalid date format:
    {
    code: '704',
    message: 'Invalid form field rearrange request. Number of fields in the form don\'t match with the number of field keys passed in the request.'
    }
    Endpoint Reference: https://developers.marketo.com/rest-api/endpoint-reference/asset-endpoint-reference/#!/Form_Fields/d...

I have successfully been able to make other API calls throughout this process like getting all fields for the form, adding a new field to the form and approving the form and I've attached my code for reference.

All help is appreciated, thank you!

Mick Warner‌ Lauren Lord