# apiRelation

The <apiRelation> element specifies a related API item that is part of the declared interface to this API item.

#### Description

This element can provide an href attribute if the description of the API item is available. If the description is not available, the <apiRelation> element provides the name of the API item in its contents.

- If you use an href attribute in a DITA API topic that describes the related API item, you do not need any other attributes.

- If you provide an href attribute to some other format (such as HTML), you must provide the name of the related API item inside the <apiRelation> element.

- If you cannot provide an href attribute (for instance, if the description of the related API item is not available), you must provide the name of the related API item inside the <apiRelation> element and the fully qualified name of the element in the keyref attribute. The keyref attribute should provide a unique key such as a fully qualified classifier name for the named API item.

#### Example

The following example shows a simple <apiRelation> element:

    <apiRef id="IRXEAfterCloseFile">
       <apiName>getApplicableStereotypesAsString</apiName>
       <shortdesc>The test function</shortdesc>
       <apiDetail>
          <apiDef>
             <apiRelation href="pluglet/IRXEAfterCloseFile.dita"/>
          </apiDef>
       </apiDetail>
    </apiRef>

#### Contained by

apiClassifierDef, apiClassifierMember, apiConstructorDef, apiDef, apiDefItem, apiEvent, apiOperationDef, apiOperationDefItem, apiParam, apiReturn, apiSyntaxText, apiValueDef, apiValueMember

#### Content model

(text data) (any number)

#### Inheritance

topic/xref reference/xref

Parent topic: apiSyntaxText
Parent topic: apiDef
Parent topic: apiClassifierMember
Parent topic: apiClassifierDef
Parent topic: apiReturn
Parent topic: apiParam
Parent topic: apiEvent
Parent topic: apiOperationDefItem
Parent topic: apiOperationDef
Parent topic: apiConstructorDef
Parent topic: apiValueMember