I was in dire need of the same feature two years ago. I still have not found out how to do it (more) properly. This is my hack:
def get_topic_post(topic_id, post_num)
topic = @api.topic(topic_id, {print: true})
post_obj = topic['post_stream']['posts'].find { |p| p['post_number'] == post_num }
if post_obj
post_obj['id']
else
throw "Could not find post #{topic_id}/#{post_num}."
end
end
This circumvents the mentioned issues: The {print: true} addresses the pagination issue. The find is needed as moderation can create a mismatch between array indices and post numbers.
It works for topics of the size I’m working with. Still, a more direct way through the API would feel more satisfying.