Hi Alexandre,
You are going about this the wrong way. If you are attempting to navigate a structure tree, you need to start with element IDs, not paragraph IDs. Basically, you should:
1 - Get the ID of the flow that contains the structure tree, maybe something like:
flowId = F_ApiGetId(FV_SessionId, docId, FP_MainFlowInDoc);
2 - Get the ID of the highest-level element in the flow, something like:
elemId = F_ApiGetId(docId, flowId, FP_HighestLevelElement);
... then you can use the FP_FirstChildElement, FP_NextSiblingElement, etc. properties of the elemId to walk through the tree. You can't call FP_NextSiblingElement on a paragraph ID because this is an element property only... paragraphs have no concept of parents, children, and siblings.
Also, to get the name of an element, you need to get the name of its underlying element definition. Something like:
F_ObjHandleT elemDef;
StringT elemName;
elemDef = F_ApiGetId(docId, elemId, FP_ElementDef);
elemName = F_ApiGetString(docId, elemDef, FP_Name);
...in other words, you can't get the tag name directly from the element. The name is a property of the element definition in the imported EDD.
Russ