Inconsistent API response in /api/recent and /api/v3/posts/[pid]
Solved
Technical Support
-
When calling these two API endpoint, I got a different response for
content
field.This is the response from
https://community.nodebb.org/api/v3/posts/92425
This one is from
https://community.nodebb.org/api/recent
One has html tags in the content text, while the other doesn't.
My question is, how could I make the json responsecontent
field always show the html tags?Thanks in advance.
-
Hi @nullpointer — one reply is parsed by plugins, the other is the "raw" content.
/api/v3/posts/:pid
reflects what is saved in the database, so the post content is not parsed.You'll want to call
/api/v3/posts/:pid/summary
instead. Keep in mind that that route is not available yet, but is slated to be added after v3 is released. -
Copyright © 2024 NodeBB | Contributors