Why "Invalid Content Type"

Attempt to update the data field on a master record in Marketo. Using C # . I'm sending:

{"action":"updateOnly","input":[{"email":" dfranks@gmail.com ","leadQuality":"Hot"}]} 

And go back:

 {"requestId":"d98e#14b2d7dd1f3","success":false,"errors":[{"code":"612","message":"Invalid Content Type"}]} 

Why is a message of type Invalid Content? The leadQuality field is legal. Email address exists. I tried several different fields and always the same message. Access current is also good.

+6
source share
2 answers

Content-Type is an HTTP header. Usually you set it for application/json for REST calls.

You must do this in the code in which you generate the HTTP request or REST call.

I found text/json as the Content-Type and Accept header value in one of the marketo examples . You can try one of two options.

+6
source

Here are a few things to check:

  • As @StephenKing mentioned, I would check that your HTTP header content type is set to "application / json".

  • I will also confirm that the custom field created for "leadQuality" is of the String data type.

enter image description here

0
source

Source: https://habr.com/ru/post/981631/


All Articles