Query: Create File API

Anonymous
Not applicable

Query: Create File API

This question is related to "What are the different file types supported in Create File API ", since I am not able to update that thread, raising the new one.

I am using sample code provided for "Create File" API @ Create a File » Marketo Developers to create files of different types.

I am able to create text/plain and text/html type of files. When I tried to create files of types png, docx, pptx, jpeg, jpg with respective content-type header in multipart request, API returns "file created successfully" but when I tried to access it from Marketo UI link, I am not able to get the original file (file seems to be corrupted)

How should we proceed to use this API's for mentioned file types?

Any pointers will be helpful.

Thanks,

Deepali

Tags (1)
5 REPLIES 5
Kenny_Elkington
Marketo Employee

Re: Query: Create File API

What do you mean when you say that the file appears corrupted?

Anonymous
Not applicable

Re: Query: Create File API

Hi Kenny,

What I meant by "Files" getting corrupted is that when I tried opening

  • jpg,jpeg and png image types files: not able to view them (in browser or in image viewer)
  • For docx,ppt,pptx and doc type of files: when I tried to open downloaded files from Marketo UI, I am getting following error 

File Type Error.png

Thanks,

Deepali

Kenny_Elkington
Marketo Employee

Re: Query: Create File API

What content-type are you passing in with these types of files?  This will affect how the file is served.  .docx especially is a compressed format and passing it in as text would be problematic.

Anonymous
Not applicable

Re: Query: Create File API

Thanks Kenny for the response

Content Types I am passing are :

  • png : image/png
  • jpg/jpeg : image/jpeg
  • docx : application/vnd.openxmlformats-officedocument.wordprocessingml.document
  • doc : application/msword
  • pptx : application/vnd.openxmlformats-officedocument.presentationml.presentation
  • ppt : application/vnd.ms-powerpointtd

What is the correct way to pass data and expected content type header for API for this types?

Thanks,

Deepali

Kenny_Elkington
Marketo Employee

Re: Query: Create File API

That looks correct from here.  You may want to diff the original and the resulting download to see what the differences are and potentially log a support ticket with the details.