SOLVED

Add Rich Text field in Marketo Form using API

Go to solution
ssRD
Level 1

Add Rich Text field in Marketo Form using API

Hello, Community members!

 

I am trying to add a Rich Text field in a Marketo form using API but it's throwing "System error" code 611. The content type used is multipart/form-data. Below is the body content (syntax similar to that described on developers.marketo.com).

 

Also, can we add JavaScript code to the Rich Text field using API?

Any suggestions would be appreciated!

 

{
    "text": "<div>Fancy Rich Text Component</div>"
}

 

Capture.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: Add Rich Text field in Marketo Form using API

You're not passing data as form/multipart (even though you say so in the headers)! You need to select the form-data in the Body (instead of raw > text). Check out this article on how to pass the multipart/form-data using Postman.

Darshil_Shah1_0-1692619044489.png

View solution in original post

3 REPLIES 3
Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: Add Rich Text field in Marketo Form using API

Marketo has a separate endpoint for adding Rich Text fields to the forms:

 

POST /rest/asset/v1/form/{id}/richText.json

 

You didn't mention the endpoint, complete payload with field content passed (as this endpoint requires data in the multipart form-data format), query parameters, headers, etc. you're using for the API call you're making to Marketo. W/o those information it'd be a little difficult to be able to provide the exact solution to your issue. Make sure you've set the Content-Type header to multipart/form-data.

 

Also, can we add JavaScript code to the Rich Text field using API?

 


The developer documentation clearly says that the field content should be structured as HTML content that does not contain any script, meta tags, or link tags. Overall, with or w/o API you may not want to house your JS in Rich text fields for the reasons very well explained by Sandy here. Please let us know if you have questions.

ssRD
Level 1

Re: Add Rich Text field in Marketo Form using API

I am using the same endpoint with Content-Type as multipart/form-data.

 

 

POST > BaseURL/rest/asset/v1/form/{id}/richText.json?{access_token}

 

 

ssRD_0-1692614667045.png ssRD_0-1692615628790.png

 

    

 

 

 

Darshil_Shah1
Level 10 - Community Advisor + Adobe Champion

Re: Add Rich Text field in Marketo Form using API

You're not passing data as form/multipart (even though you say so in the headers)! You need to select the form-data in the Body (instead of raw > text). Check out this article on how to pass the multipart/form-data using Postman.

Darshil_Shah1_0-1692619044489.png