APIs & Integrations

DPevzner
Member

Getting error status 400 - This media type text/html is not supported import Api

Hello, 

Im using the Import API for creating a contact record in hubspot. 

I've created a custom property which I expect to populate it with an Html code (in String).  I configured the type of this property to "Signle line text" and "Multi-line-text", but none of them worked for me. I'm recieiving the following response: 

 status 400, bad request, 'This media type text/html is not supported' .

 

How can I overcome this issue? Thanks in advance.

 

update: inserted the code i'm using

Screen Shot 2022-08-17 at 17.44.51.png

 

0 Upvotes
4 Replies 4
Teun
Recognized Expert | Diamond Partner
Recognized Expert | Diamond Partner

Getting error status 400 - This media type text/html is not supported import Api

Hi @DPevzner ,

 

You can currently add a 'richtext' property that allows HTML. Did you try that property yet?

 

Does your code work if you leave out the HTML?



Did my answer solve your issue? Help the community by marking it as the solution.
0 Upvotes
DPevzner
Member

Getting error status 400 - This media type text/html is not supported import Api

Hi,

The html code was inserted after changing the property type to "rich text" but I needed to do escaping to the html before importing it, without it, it would still throw the same error as above.  Is there a way to import it without escaping the html?

0 Upvotes
LeeBartelme
HubSpot Employee
HubSpot Employee

Getting error status 400 - This media type text/html is not supported import Api

Can you add the code you are using?

0 Upvotes
DPevzner
Member

Getting error status 400 - This media type text/html is not supported import Api

Updated the post.

0 Upvotes