---
title: Examples
slug: net2net-rest/guide/examples
docTags: 
createdAt: 2026-06-12T09:48:23.977Z
---

Examples provided throughout this guide are not intended to be all-inclusive. This pertains to example workflows, element-specific (field) examples, or message examples. Customers should not restrict coding to the examples used herein.

When developing, this guide should be used along with the accompanying schema file, additional documentation referenced, and applicable customary XML coding standards.

## Clinical Message with PDF Attachment

The following is an example of a *Clinical* message with a PDF attachment.

```xml
<?xml version="1.0" encoding="utf-8"?>
<N2NMessage version="CIv6" release="0" xmlns="http://www.surescripts.com/messaging">
  <Header>
    <Recipients>
      <To Qualifier="DIRECT" FriendlyName="User Two">usertwo@exampledomain.com</To>
      <To Qualifier="DIRECT" CC="true" FriendlyName="User Three">userthree@exampledomain.com</To>
    </Recipients>
    <From Qualifier="DIRECT" FriendlyName="User One">userone@exampledomain.com</From>
    <MessageID>f9733ed92efe46658389d1fab1fb3e50</MessageID>
    <SentTime>2018-11-13T15:27:41.184Z</SentTime>
    <SenderSoftware>
    <SenderSoftwareDeveloper>test developer</SenderSoftwareDeveloper>
      <SenderSoftwareProduct>test product</SenderSoftwareProduct>
      <SenderSoftwareVersionRelease>1.0</SenderSoftwareVersionRelease>
    </SenderSoftware>
    <PatientInformation>
      <Given>FirstName</Given>
      <Family>LastName</Family>
      <DOB>1960-06-29</DOB>
      <Gender>F</Gender>
      <Zip>55402</Zip>
      <Identification>
        <ID Issuer="1.3.6.1.4.1.34488.150.21">1054345A</ID>
        <ID Issuer="72BD5F4A-0F71-425E-B898-B18EE433A2FF">MR-1332-0001</ID>
      </Identification>
    </PatientInformation>
  </Header>
  <Body>
    <ClinicalMessage>
      <Subject>example subject</Subject>
      <Document>
      <PlainText>example plain text message</PlainText>
      </Document>
      <Attachment>
        <DocumentName>exampledocument.pdf</DocumentName>
          <File>
            <DocumentType>application/pdf</DocumentType>
<DocumentData>JVBERi0xLjENMSAwIG9iag08PA0gL1BhZ2VzIDMgMCBSDSAvT3BlbkFjdGlvbiA3IDAgUg0+Pg1lbmRvYmoNMyAwIG9iag08PA0gL1R5cGUgL1BhZ2VzDSAvS2lkcyBbNCAwIFJdDSAvQ291bnQgMQ0+Pg1lbmRvYmoNNCAwIG9iag08PA0gL1R5cGUgL1BhZ2UNIC9QYXJlbnQgMyAwIFINIC9NZWRpYUJveCBbMCAwIDYxMiA3OTJdDSAvQ29udGVudHMgNSAwIFINIC9SZXNvdXJjZXMgPDwNICAgICAgICAgICAgIC9Qcm9jU2V0IFsvUERGIC9UZXh0XQ0gICAgICAgICAgICAgL0ZvbnQgPDwgL0YxIDYgMCBSID4+DSAgICAgICAgICAgID4+DT4+DWVuZG9iag01IDAgb2JqDTw8IC9MZW5ndGggNTYgPj4Nc3RyZWFtDUJUIC9GMSAxMiBUZiAxMDAgNzAwIFRkIDE1IFRMIChleGFtcGxlIHBkZikgVGogRVQNZW5kc3RyZWFtDWVuZG9iag10cmFpbGVyDTw8DSAvU2l6ZSA4DSAvUm9vdCAxIDAgUg0+Pg1zdGFydHhyZWYNNzczDSUlRU9G</DocumentData>
          </File>
      </Attachment>
    </ClinicalMessage>
  </Body>
</N2NMessage>
```

## Clinical Message Routed to Receiving System

The following is an example of a single recipient message routed to a receiving system.

```xml
<?xml version="1.0" encoding="utf-8"?>
<N2NMessage version="CIv6" release="0"
    xmlns="http://www.surescripts.com/messaging">
    <Header>
        <Recipients>
            <To Qualifier="DIRECT" FriendlyName="User Two" Route="true">usertwo@exampledomain.com</To>
        </Recipients>
        <From Qualifier="DIRECT" FriendlyName="User One">userone@exampledomain.com</From>
        <MessageID>S6LMlioOobgF1Ous5fJyBhC6EmZlTTEi</MessageID>
        <SentTime>2018-11-13T15:27:41.184Z</SentTime>
        <SenderSoftware>
            <SenderSoftwareDeveloper>test developer</SenderSoftwareDeveloper>
            <SenderSoftwareProduct>test product</SenderSoftwareProduct>
            <SenderSoftwareVersionRelease>1.0</SenderSoftwareVersionRelease>
        </SenderSoftware>
        <TestMessage />
    </Header>
    <Body>
        <ClinicalMessage>
            <Subject>example subject</Subject>
            <Document>
                <PlainText>example plain text message</PlainText>
            </Document>
        </ClinicalMessage>
    </Body>
</N2NMessage>
```

## Status Response – Message Delivered

The following is an example of an HTTP response *Status* message indicating the *Clinical* message was successfully delivered to the recipient.

```bash
<?xml version="1.0" encoding="utf-8"?>
<N2NMessage version="CIv6" release="0" xmlns="http://www.surescripts.com/messaging">
  <Header>
    <Recipients>
      <To Qualifier="DIRECT" FriendlyName="User One">userone@exampledomain.com</To>
    </Recipients>
    <From Qualifier="DIRECT" FriendlyName="User Two">usertwo@exampledomain.com</From>
    <MessageID>9ebee63133dd41c183309d9af4a7d851</MessageID>
    <RelatesToMessageID>91f6325d9d694222856806cc2d611166</RelatesToMessageID>
    <SentTime>2018-11-13T15:27:41.184Z</SentTime>
    <SenderSoftware>
      <SenderSoftwareDeveloper>test developer</SenderSoftwareDeveloper>
      <SenderSoftwareProduct>test product</SenderSoftwareProduct>
      <SenderSoftwareVersionRelease>1.0</SenderSoftwareVersionRelease>
    </SenderSoftware>
  </Header>
  <Body>
    <Status>
      <Code>010</Code>
    </Status>
  </Body>
</N2NMessage>
```

## Status Response – Message Delivered to Multiple Recipients

The following is an example of an HTTP response *Status* message indicating the *Clinical* message was successfully delivered to multiple recipients hosted by a single customer system.

```xml
<?xml version="1.0" encoding="utf-8"?>
<N2NMessage version="CIv6" release="0" xmlns="http://www.surescripts.com/messaging">
  <Header>
    <Recipients>
      <To Qualifier="DIRECT" FriendlyName="User One">userone@exampledomain.com</To>
    </Recipients>
    <From Qualifier="ZZZ">PortalName</From>
    <MessageID>9ebee63133dd41c183309d9af4a7d851</MessageID>
    <RelatesToMessageID>91f6325d9d694222856806cc2d611166</RelatesToMessageID>
    <SentTime>2018-11-13T15:27:41.184Z</SentTime>
    <SenderSoftware>
      <SenderSoftwareDeveloper>test developer</SenderSoftwareDeveloper>
      <SenderSoftwareProduct>test product</SenderSoftwareProduct>
      <SenderSoftwareVersionRelease>1.0</SenderSoftwareVersionRelease>
    </SenderSoftware>
  </Header>
  <Body>
    <Status>
      <Code>010</Code>
    </Status>
  </Body>
</N2NMessage>
```

## Verify Message – Message Delivered Electronically

The following is an example of a *Verify* message indicating the *Clinical* message was successfully delivered electronically to the recipient.

```xml
<?xml version="1.0" encoding="utf-8"?>
<N2NMessage version="CIv6" release="0" xmlns="http://www.surescripts.com/messaging">
  <Header>
    <Recipients>
      <To Qualifier="DIRECT" FriendlyName="User One">userone@exampledomain.com</To>
    </Recipients>
    <From Qualifier="DIRECT" FriendlyName="User Two">usertwo@exampledomain.com</From>
    <MessageID>fbe03a95e68c53240419cbb58236511d</MessageID>
    <RelatesToMessageID>91f6325d9d694222856806cc2d611166</RelatesToMessageID>
    <SentTime>2018-11-13T15:27:41.184Z</SentTime>
    <SenderSoftware>
      <SenderSoftwareDeveloper>test developer</SenderSoftwareDeveloper>
      <SenderSoftwareProduct>test product</SenderSoftwareProduct>
      <SenderSoftwareVersionRelease>1.0</SenderSoftwareVersionRelease>
    </SenderSoftware>
  </Header>
  <Body>
    <Verify>
      <VerifyStatus >
        <Code>010</Code>
      </VerifyStatus>
    </Verify>
  </Body>
</N2NMessage>
```

## Error Response – Message Not Delivered

The following is an example of an *Error* response indicating the *Clinical* message could not be delivered to the recipient.

```xml
<?xml version="1.0" encoding="utf-8"?>
<N2NMessage version="CIv6" release="0" xmlns="http://www.surescripts.com/messaging">
  <Header>
    <Recipients>
      <To Qualifier="DIRECT" FriendlyName="User One">userone@exampledomain.com</To>
    </Recipients>
    <From Qualifier="ZZZ">PortalName</From>
    <MessageID>fbe03a95e68c53240419cbb58236511d</MessageID>
    <RelatesToMessageID>91f6325d9d694222856806cc2d611166</RelatesToMessageID>
    <SentTime>2018-11-13T15:27:41.184Z</SentTime>
    <SenderSoftware>
      <SenderSoftwareDeveloper>test developer</SenderSoftwareDeveloper>
      <SenderSoftwareProduct>test product</SenderSoftwareProduct>
      <SenderSoftwareVersionRelease>1.0</SenderSoftwareVersionRelease>
</SenderSoftware>
  </Header>
  <Body>
    <Error>
      <Code>600</Code>
    </Error>
  </Body>
</N2NMessage>
```

## Error Response – Message Not Delivered to Multiple Recipients

The following is an example of an *Error* response indicating the *Clinical* message could not be delivered to the recipient.

```xml
<?xml version="1.0" encoding="utf-8"?>
<N2NMessage version="CIv6" release="0" xmlns="http://www.surescripts.com/messaging">
  <Header>
    <Recipients>
      <To Qualifier="DIRECT" FriendlyName="User One">userone@exampledomain.com</To>
    </Recipients>
    <From Qualifier="ZZZ">PortalName</From>
    <MessageID>fbe03a95e68c53240419cbb58236511d</MessageID>
    <RelatesToMessageID>91f6325d9d694222856806cc2d611166</RelatesToMessageID>
    <SentTime>2018-11-13T15:27:41.184Z</SentTime>
    <SenderSoftware>
      <SenderSoftwareDeveloper>test developer</SenderSoftwareDeveloper>
      <SenderSoftwareProduct>test product</SenderSoftwareProduct>
      <SenderSoftwareVersionRelease>1.0</SenderSoftwareVersionRelease>
</SenderSoftware>
  </Header>
  <Body>
    <Error>
      <Code>600</Code>
    </Error>
  </Body>
</N2NMessage>
```

## Example of Namespace in Header

The following is an implementation example defining the cda namespace within the header of the XML.

```xml
<?xml version="1.0" encoding="utf-8"?>
<N2NMessage version="CIv6" release="0" xmlns:cda="urn:hl7-org:v3" xmlns="http://www.surescripts.com/messaging">
  <Header>
    <Recipients>
      <To Qualifier="DIRECT" FriendlyName="User One">userone@exampledomain.com</To>
    </Recipients>
    <From Qualifier="ZZZ">PortalName</From>
    <MessageID>fbe03a95e68c53240419cbb58236511d</MessageID>
    <RelatesToMessageID>91f6325d9d694222856806cc2d611166</RelatesToMessageID>
    <SentTime>2018-11-13T15:27:41.184Z</SentTime>
    <SenderSoftware>
      <SenderSoftwareDeveloper>test developer</SenderSoftwareDeveloper>
      <SenderSoftwareProduct>test product</SenderSoftwareProduct>
      <SenderSoftwareVersionRelease>1.0</SenderSoftwareVersionRelease>
</SenderSoftware>
  </Header>
  <Body>
    <ClinicalMessage>
      <Subject>Test Message for ERX-24414</Subject>
      <Document>
        <PlainText/>
      </Document>
      <Attachment>
        <DocumentName>Latifa.CDA.xml</DocumentName>
        <cda:ClinicalDocument>
          <cda:realmCode code="US" />
          <cda:typeId root="2.16.840.1.113883.1.3" extension="POCD_HD000040" />
          <cda:templateId root="2.16.840.1.113883.10.20.22.1.1" />
          <cda:templateId root="2.16.840.1.113883.10.20.22.1.2" />
          <cda:id root="2.16.840.1.113883.3.2054" extension="7f2f1a44ab934cddave108a43285e7b7" />
          <cda:code code="34133-9" displayName="Summarization of episode note" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" />
          <cda:title>Dev Imm Title</cda:title>
          <cda:effectiveTime value="20130903082505" />
          <cda:confidentialityCode code="N" displayName="Normal" codeSystem="2.16.840.1.113883.5.25" codeSystemName="HL7 Confidentiality Code" />
          <cda:languageCode code="US" />
          <cda:documentationOf>
            <cda:serviceEvent classCode="PCPR">
              <cda:effectiveTime>
                <cda:low nullFlavor="UNK" />
                <cda:high nullFlavor="UNK"/>
              </cda:effectiveTime>
            </cda:serviceEvent>
          </cda:documentationOf>
        </cda:ClinicalDocument>
      </Attachment>
    </ClinicalMessage>
  </Body>
</N2NMessage>
```

## Example of Namespace in Element

The following is an implementation example defining the cda namespace within the ClinicalDocument element of the XML.

```xml
<?xml version="1.0" encoding="utf-8"?>
<N2NMessage version="CIv6" release="0" xmlns:cda="urn:hl7-org:v3" xmlns="http://www.surescripts.com/messaging">
  <Header>
    <Recipients>
      <To Qualifier="DIRECT" FriendlyName="User One">userone@exampledomain.com</To>
    </Recipients>
    <From Qualifier="ZZZ">PortalName</From>
    <MessageID>fbe03a95e68c53240419cbb58236511d</MessageID>
    <RelatesToMessageID>91f6325d9d694222856806cc2d611166</RelatesToMessageID>
    <SentTime>2018-11-13T15:27:41.184Z</SentTime>
    <SenderSoftware>
      <SenderSoftwareDeveloper>test developer</SenderSoftwareDeveloper>
      <SenderSoftwareProduct>test product</SenderSoftwareProduct>
      <SenderSoftwareVersionRelease>1.0</SenderSoftwareVersionRelease>
</SenderSoftware>
  </Header>
  <Body>
    <ClinicalMessage>
      <Subject>Test Message for ERX-24414</Subject>
      <Document>
        <PlainText />
      </Document>
      <Attachment>
        <DocumentName>Latifa.CDA.xml</DocumentName>
        <cda:ClinicalDocument xmlns="urn:hl7-org:v3" xmlns:xsltUtil="urn:xsltUtil">
          <cda:realmCode code="US" />
          <cda:typeId root="2.16.840.1.113883.1.3" extension="POCD_HD000040" />
          <cda:templateId root="2.16.840.1.113883.10.20.22.1.1" />
          <cda:templateId root="2.16.840.1.113883.10.20.22.1.2" />
          <cda:id root="2.16.840.1.113883.3.2054" extension="7f2f1a44ab934cddave108a43285e7b7" />
          <cda:code code="34133-9" displayName="Summarization of episode note" codeSystem="2.16.840.1.113883.6.1" codeSystemName="LOINC" />
          <cda:title>Dev Imm Title</title>
          <cda:effectiveTime value="20130903082505" />
          <cda:confidentialityCode code="N" displayName="Normal" codeSystem="2.16.840.1.113883.5.25" codeSystemName="HL7 Confidentiality Code" />
          <cda:languageCode code="US" />
          <cda:documentationOf>
            <cda:serviceEvent classCode="PCPR">
              <cda:effectiveTime>
                <cda:low nullFlavor="UNK" />
                <cda:high nullFlavor="UNK" />
              </cda:effectiveTime>
            </cda:serviceEvent>
          </cda:documentationOf>
        </cda:ClinicalDocument>
      </Attachment>
    </ClinicalMessage>
  </Body>
</N2NMessage>
```

