Answered

Layout images wont load when using the create api

  • 8 May 2023
  • 6 replies
  • 53 views

Userlevel 1

Hi @Liz @mathio it’s me again, sorry for being such a bother, I was finally able to get the form updated with the new sections in the order I want but now I found this, when using attachments without layout, the image loads just fine
 

[
'attachment' => [
'href' => "https://images.typeform.com/images/4BKUhw8A9cSM",
'type' => 'image'
],
'properties' => [
'description' => 'details',
'hide_marks' => true
],
'ref' => 'event',
'title' => 'name',
'type' => 'statement'
]

But then just after this little change to use the layout, the image won’t show up, even though it sets the split

 

[
'layout' => [
'attachment' => [
'href' => "https://images.typeform.com/images/4BKUhw8A9cSM",
'type' => 'image'
],
'placement' => 'left',
'type' => 'split'
],
'properties' => [
'description' => 'details',
'hide_marks' => true
],
'ref' => 'event',
'title' => 'name',
'type' => 'statement'
]


I get something like this
 

 

I’m counting on you again guys, thanks in advance!

icon

Best answer by mathio 15 May 2023, 17:56

View original

6 replies

Userlevel 7
Badge +5

Hi @neovldz Thanks for stopping by and sharing all this! @mathio will definitely be your best help for this!

Userlevel 7
Badge +5

Hi @neovldz sorry for a late answer.

I just tried a PUT to https://api.typeform.com/forms/i2pIXcsx with a payload like this and it worked:

{

"title": "title",
"type": "form",
"fields": [
{
"layout": {
"attachment": {
"href": "https://images.typeform.com/images/4BKUhw8A9cSM",
"type": "image"
},
"placement": "left",
"type": "split"
},
"properties": {
"description": "details",
"hide_marks": true
},
"ref": "event",
"title": "name",
"type": "statement"
}
],
"workspace": {
"href": "https://api.typeform.com/workspaces/7rcxDr"
}
}

The resulting typeform is here: https://form.typeform.com/to/i2pIXcsx and it currently looks like this after the update above:

 

In your case it looks like the image on the left did not load? The issue might be with displaying the form rather than the API. Can you inspect the element to see if the image is there or if it had  issues with loading in network tab?

Or maybe just provide you typeform URL and I can have a look for you.

Userlevel 7
Badge +5

Hi @neovldz Are you still having troubles with the images using the API? Let us know if we can help!

Userlevel 1

Hey, sorry for the delay, I did notice this issue is there for all the forms I create using the api, the thing is, it only affects the “Create Screen” if I use the link it gives me on share then I am able to see the images, I have no problem with this since I know the images will be there but it will be good if you could give it a quick check to be sure.

I tried to inspect the element and this is what I am seeing, the first screenshot is from the create screen and the other is from the online typeform, looks like for some reason the Picture tag is missing from the first.
 


 


Don’t worry too much about it right now since as I said its not really important to me since I end up seeing the images in the final product, just keep an eye on it in case it happens to someone else.

P.S.
Don’t want to create a new post just to ask this so I’m hoping you can help me out here, will need a new post if I need to but… Is it possible to retrieve all responses all together in the https://api.typeform.com/forms/{form_id}/responses endpoint? Asking because when I’m not sending the ‘completed’ parameter, I only get the ones that were submitted it seems, but when I send it with a ‘false’ value then I get only what seems to be the “views” since it has ‘landed_at’ but not ‘submitted_at’

Thank you very much!

Userlevel 7
Badge +5

Hi @neovldz thanks for sending this over! @mathio might be able to help you with this. 

As for the responses, are you looking for partial responses? If so, I’m afraid we don’t collect any information that isn’t directly submitted on the form. You can read more about this here

Userlevel 7
Badge +5

if I use the link it gives me on share then I am able to see the images

What other link are you using to access the form? Which URL does not display the images correctly? I am curious now 😃

I think if you send parameter completed=false it will only display form “views” with some meta data. Partial responses to your typeform questions are not collected.

Reply