Answered

Duplicate form but "VALIDATION_ERROR"

  • 13 May 2023
  • 4 replies
  • 105 views

Dear Sirs

    I use typeform API, try to duplicate a existing form.

    Following API (https://www.typeform.com/developers/create/walkthroughs/).

    get existing form, copy the form , remove the id. but get problem in posting…

    get the error “VALIDATION_ERROR”

The whole payload is copied from existing form.

What’s kind of errors I missing ?

THank you very much!

{
    "code": "VALIDATION_ERROR",
    "description": "The payload is invalid.",
    "details": [
        {
            "code": "NOT_ALLOWED_PROPERTY",
            "description": "should NOT have additional properties",
            "field": "/url",
            "in": "body"
        },
        {
            "code": "NOT_ALLOWED_PROPERTY",
            "description": "should NOT have additional properties",
            "field": "/status",
            "in": "body"
        },
        {
            "code": "NOT_ALLOWED_PROPERTY",
            "description": "should NOT have additional properties",
            "field": "/contentType",
            "in": "body"
        },
        {
            "code": "NOT_ALLOWED_PROPERTY",
            "description": "should NOT have additional properties",
            "field": "/body",
            "in": "body"
        },
        {
            "code": "REQUIRED_PROPERTY",
            "description": "should have required property 'title'",
            "field": "/title",
            "in": "body"
        }
    ]
}

icon

Best answer by AlfinSky 16 May 2023, 07:47

View original

4 replies

Userlevel 7
Badge +5

Hi @AlfinSky Thanks for sending all this information along - this is really helpful. Are you copying the form in the same workspace? 

@mathio might also be able to help you out!

Userlevel 7
Badge +5

Hello @AlfinSky 

this seems weird. When you retrieve the form it should not have fields like the ones you listed:

  • url
  • status
  • contentType
  • body
  • title

It kind of looks like the library / tool you are using might be adding some additional fields to the response. Judging by the names those might be coming from response headers.

Can you confirm you receive same fields when you make the request using eg. Postman app or similar tool?

Would you mind sharing your code? We might be able to debug together if it is something I am familiar with.

Thank ‘s for @Liz and @mathio ‘s response.

I found the root cause.

I get the form from GET API, but I post the JSON.parse(form) as body of POST API.

How stupid I am !!!

Thank you for your great help !

 

Alfin.

 

Userlevel 7
Badge +5

Any time! Many times all you need is second pair of eyes to find the issue you might have been dealing with for a long time. Happens to everybody 😃

Reply