CMS Development

Fadi1
Member

Get the custom fields data of a module into the JSON response when using content search API

Hello,

I'm filtering the blog posts based on tags and loading the result of the filters by ajax using this URL:

 

https://api.hubapi.com/contentsearch/v2/search?portalId=xxxxx&groupId=xxxx&term=test

 


It returns the posts just fine but it does not include the custom fields inside the posts modules.

Is there any way to include some specific data in the returned JSON response?

Thank you




0 Upvotes
2 Replies 2
Jaycee_Lewis
Community Manager
Community Manager

Get the custom fields data of a module into the JSON response when using content search API

Hi, @Fadi1 👋 Thanks for reaching out! Can you include an example of specifically what you expect to be retuned when mentioning “custom fields inside the posts modules”? Are these tags you've created? Or custom properties? I want to make sure the community fully understands.

 

Hey, @Jnix284 @rlopez @Indra, do you have any quick suggestions for @Fadi1?

 

Best,

Jaycee

linkedin

Jaycee Lewis

Developer Community Manager

Community | HubSpot

0 Upvotes
Fadi1
Member

Get the custom fields data of a module into the JSON response when using content search API

Hey @Jaycee_Lewis 

I added this field in the blog-post.html template

{% text "start_date" label="Date", value="", export_to_template_context="true" %}

So admins can include a custom string "start_date" in each blog post, so I want this date to be in the JSON response when I use the API to query the posts
Is there any way to do this? 

Also, I'm not sure how to add a placeholder to the "start_date" field.

Thank you

0 Upvotes