XF 2.2 Adding comments to threads with AAPI

ChadCLund

Member
I need some help. I successfully wrote a custom script to import my threads from my MSSQL Server, but I am having an issue importing comments to those threads.
My best guess is to use: /api/threads/ or /api/threads/{ID of parent Thread} or {ID of parent forum node} ??
Two questions: which to use, and in both, what is the prefix_id?
My initial test import put the comment as a new thread in a sub-forum, not as a comment of an existing thread.

Code:
                request1.AddHeader("Accept", "application/json;version=2.0")
                request1.AddHeader("Accept-Language", "en-US")
                request1.AddHeader("XF-Api-Key", "xxxxxxxxxxxxxxxxxxxxxxxxxx")
                request1.AddHeader("XF-Api-User", row("MemberID"))
                request1.AddHeader("Content-Type", "application/x-www-form-urlencoded")
                request1.AddParameter("node_id", row("xenForoThreadID"))
                request1.AddParameter("title", row("Title"))
                request1.AddParameter("message", ThreadText)

Is the node_id suppsed to be the prefix_ID ??

Thanks in advance
 
Top Bottom