Duplicate form but "VALIDATION_ERROR" | Community
Skip to main content
Answered

Duplicate form but "VALIDATION_ERROR"


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"
        }
    ]
}

Best answer by AlfinSky

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.

 

View original

4 replies

Liz
Community Team
Forum|alt.badge.img+5
  • Tech Community Advocate
  • 14946 replies
  • May 15, 2023

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!


mathio-tf
Typeform
Forum|alt.badge.img+5
  • Typeform
  • 888 replies
  • May 15, 2023

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.


  • Author
  • Explorer
  • 1 reply
  • Answer
  • May 16, 2023

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.

 


mathio-tf
Typeform
Forum|alt.badge.img+5
  • Typeform
  • 888 replies
  • May 16, 2023

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