Answered

I can't create form via API with fields that have type Calendly

  • 9 October 2023
  • 2 replies
  • 48 views

When I try to create a form with the field type 'Calendly,' I receive the error message 'The payload is invalid.' However, my Calendly account is authorized in Typeform.

Here is the body of my request:

{
"type": "quiz",
"title": "test",
"workspace": {
"href": "https://api.typeform.com/workspaces/LaGeDM"
},
"theme": {
"href": "https://api.typeform.com/themes/qHWOQ7"
},
"settings": {
"language": "en",
"progress_bar": "proportion",
"meta": {
"allow_indexing": false
},
"hide_navigation": false,
"is_public": true,
"is_trial": false,
"show_progress_bar": true,
"show_typeform_branding": true,
"are_uploads_public": false,
"show_time_to_complete": true,
"show_number_of_submissions": false,
"show_cookie_consent": false,
"show_question_number": true,
"show_key_hint_on_choices": true,
"autosave_progress": true,
"free_form_navigation": false,
"use_lead_qualification": false,
"pro_subdomain_enabled": false,
"capabilities": {
"e2e_encryption": {
"enabled": false,
"modifiable": false
}
}
},
"thankyou_screens": [{
"ref": "default_tys",
"title": "Thanks for completing this typeform\nNow *create your own* — it's free, easy, & beautiful",
"type": "thankyou_screen",
"properties": {
"show_button": true,
"share_icons": false,
"button_mode": "default_redirect",
"button_text": "Create a *typeform*"
},
"attachment": {
"type": "image",
"href": "https://images.typeform.com/images/2dpnUBBkz2VN"
}
}],
"fields": [{
"title": "What is your name?",
"ref": "bba7449c-9228-4b88-8b7b-d3349c0bbc15",
"properties": {},
"validations": {
"required": false
},
"type": "website"
},

{
"title": "...",
"ref": "3f886918-9bb6-4079-ae5d-690d38b177dc",
"properties": {},
"application": {
"application_block_id": "e0e30acc-7f97-437f-ad36-bdfb9191b5d4",
"installation_id": "e6eab9f9-5f8e-429c-bf8c-405d938c53b9",
"iframe_url": "https://api.typeform.com/applications/calendly/installations/e6eab9f9-5f8e-429c-bf8c-405d938c53b9/iframe/e0e30acc-7f97-437f-ad36-bdfb9191b5d5",
"inputs": [{
"value": "",
"label": "Name",
"ref": "name"
},
{
"value": "",
"label": "Email",
"ref": "email"
}
]
},
"validations": {
"required": false
},
"type": "calendly"
},
{
"title": "How old are you?",
"ref": "3b40b25c-0333-43d1-a3d2-dd7e7ffb2cb3",
"properties": {},
"validations": {
"required": false
},
"type": "number"
},
{
"title": "Do you like pizza?",
"ref": "63342b08-1439-43f6-a092-166a0fe0aa37",
"properties": {},
"validations": {
"required": false
},
"type": "yes_no"
}
],
"hidden": [
"user_id"
],
"variables": {
"variable_0": 1,
"variable_1": 2
},
"created_at": "2023-10-09T09:41:10+00:00",
"last_updated_at": "2023-10-09T12:33:12+00:00",
"published_at": "2023-10-09T09:43:49+00:00",
"_links": {
"display": "https://hssm76m31t1.typeform.com/to/zthUg0CF",
"responses": "https://api.typeform.com/forms/zthUg0CF/responses"
}
}

 

icon

Best answer by mathio 10 October 2023, 16:21

View original

2 replies

Userlevel 7
Badge +5

@mathio do you know if this is expected behavior? 

Userlevel 7
Badge +5

When i tried building a typeform with your payload I received an error with the following details:

{
code: 'NOT_ALLOWED_PROPERTY',
description: 'should NOT have additional properties',
field: 'field/1/application/installation_id',
in: 'body'
},
{
code: 'REQUIRED_PROPERTY',
description: "should have required property 'id'",
field: '/fields/1/application/id',
in: 'body'
}

 

I removed the installation_id and added id (with value calendly) to create a field like this:

{
"title": "...",
"ref": "3f886918-9bb6-4079-ae5d-690d38b177dc",
"properties": {},
"application": {
"id": "calendly",
"application_block_id": "e0e30acc-7f97-437f-ad36-bdfb9191b5d4",
"installation_id": "e6eab9f9-5f8e-429c-bf8c-405d938c53b9",
"iframe_url": "https://api.typeform.com/applications/calendly/installations/e6eab9f9-5f8e-429c-bf8c-405d938c53b9/iframe/e0e30acc-7f97-437f-ad36-bdfb9191b5d5",
"inputs": [
{
"value": "",
"label": "Name",
"ref": "name"
},
{
"value": "",
"label": "Email",
"ref": "email"
}
]
},
"validations": {
"required": false
},
"type": "calendly"
},

 

With this payload I was able to create this typeform:

 

Hope this helps.

Reply