Forum Settings
Forums

(Bug) Consistent incomplete retrieval of forum threads: last post always ignored

New
Nov 30, 2023 3:51 AM
#1
Go read Medalist
Offline
Apr 2007
285
When accessing thread contents via API, the last post in the thread is never in the JSON. This is not a pagination issue and it applies even to threads that only consist of one (i.e. opening) post.

For example, if I run the following basic Python code to retrieve the contents of this thread:
url = 'https://api.myanimelist.net/v2/forum/topic/1973141'
response = requests.get(url, headers = {
        'X-MAL-CLIENT-ID': client_id
        })
thread_content = response.json()
print(thread_content)

...I receive this in the JSON:
{'data': {'title': 'BEFORE POSTING: Getting started with the API', 'posts': []}, 'paging': {}}

Sure looks empty. :\

But if I do it with a thread that has two posts, like this one, this is what it looks like:
{'data': {'title': 'XML values', 'posts': [{'id': 4027418, 'number': 1, 'created_at': '2009-07-23T16:39:19+00:00', 'created_by': {'id': 173720, 'name': 'Wile', 'forum_avator': 'https://cdn.myanimelist.net//images/kaomoji_mal_white.png'}, 'body': 'Do we have to supply all values all the time? Then clients would have to download the current values first, each time they want to modify one.<br />\r\n<br />\r\nIf not, what happens to omitted values? They should be left as is rather than set to a default value.<br />\r\n<br />\r\nHow are empty elements interpreted? I&#039;d vote for error rather than omitted, and certainly not default.', 'signature': ''}]}, 'paging': {}}

Now the opening post shows up but the sole reply is ignored instead.

This behavior doesn't look intentional unless I'm missing something? Can it be fixed anytime soon?
Reply Disabled for Non-Club Members
Nov 30, 2023 4:31 AM
#2
四十二

Offline
Mar 2016
468
I guess the API didn't survive this summer's forum update. What a pity.
It's hard to say when it'll get fixed.
HTCPCP/1.0  ★ MetaMAL  ★ Picture credits: 第三世界のじょんぺり & 1041uuu
Nov 30, 2023 4:48 AM
#3
Go read Medalist
Offline
Apr 2007
285
Ah, makes sense that it hadn't been reported until now, I suppose. Thanks for letting me know.

I hope it'll get fixed at some point at least.
Nov 30, 2023 5:21 AM
#4

Offline
Apr 2010
2707
This bug predates the forum update ; I'd noticed often missing the latest post on a thread ages ago in my own usage. Or maybe it just got more consistent.
Nov 30, 2023 10:00 AM
#5
四十二

Offline
Mar 2016
468
The many riddles of the API...
HTCPCP/1.0  ★ MetaMAL  ★ Picture credits: 第三世界のじょんぺり & 1041uuu
Reply Disabled for Non-Club Members

More topics from this board

» How to get author name?

EdibleMuffin - Feb 12

1 by ZeroCrystal »»
Feb 17, 9:53 AM

» [FEATURE REQUEST] Bulk requests & add fields param to users watchlist

KibbeWater - Feb 13

0 by KibbeWater »»
Feb 13, 8:38 AM

» Too many request even with 10 seconds delay

Joaoniespodzinsk - Jan 31

1 by ZeroCrystal »»
Feb 4, 11:04 AM

» Anime Field: Streaming Platforms

SeeYouLaterSpace - Feb 10, 2023

2 by IridescentJaune »»
Jan 30, 1:21 PM

» Allowed usage or not ?

dczerwon - Jan 13

0 by dczerwon »»
Jan 13, 3:07 AM
It’s time to ditch the text file.
Keep track of your anime easily by creating your own list.
Sign Up Login