Get a contact’s relationship to programs - GetProgramsByContact

Extract a list of programs for a specific contact or visitor

The GetProgramsByContact call is available in Postman.

Either CONTACT_ID or VISITOR_KEY must be passed to the method to get a valid response. If both are provided, the CONTACT_ID is used to look up the Contact. CONTACT_ID is the same as RECIPIENT_ID in meaning only and information that is used and returned for CONTACT_ID is the same information that is used and returned for RECIPIENT_ID in any other API call. Standard permissions are applied to this API so that only those programs are returned that the authenticated user has access to see.

📘

Note

  • If end track is not used in the program, the element will not have a date value
  • If the contact is currently active in the program, the element will not have a date value

Elements (Required)

LIST_ID - The source database or query tied to the returned programs

INCLUDE_ACTIVE - Specify True or False to return programs that are in Running, Scheduled, and Completed state.

INCLUDE_INACTIVE - Specify True or False to return programs that are only in Inactive state.

Elements (Optional)

CONTACT_ID (Recipient_ID) - The Contact Id (Recipient_ID) of the Contact in the Acoustic Campaign database used to get all programs associated with a specific contact. Note: Either CONTACT_ID (Recipient_ID) or VISITOR_KEY must be passed. If both passed, the CONTACT_ID (Recipient_ID) takes precedence.

VISITOR_KEY - The web tracking visitor key used to get all programs associated with a specific visitor. Note: Either CONTACT_ID (Recipient_ID) or VISITOR_KEY must be passed. If both passed, CONTACT_ID (Recipient_ID) takes precedence.

INCLUDE_HISTORY - Returns information for the contact currently active in that program. Specify True or False to receive the history for contacts that have been through the program multiple times. If this element is not included, then False is assumed. Note: There will be a separate response for each trip through the program.

CREATED_DATE_RANGE - Returns programs created within specific date range based on the program's create date.
BEGIN_DATE - A child element of CREATED_DATE_RANGE. Specify the start of the date range in the format “mm/dd/yyyy”.
END_DATE - A child element of CREATED_DATE_RANGE. Specify end of the date range in the format “mm/dd/yyyy”.

APPROVED_FOR_SALES - Specify True or False to return programs that are only Approved for Sales. If this element is not included, then False is assumed. Note: These are the programs that are available through contact insight.

INCLUDE_TAGS - Return programs associated with specific tag(s).
TAG - A child element of INCLUDE_TAGS. Returns any program associated with a specific tag. If you include multiple tags in your API call, any program containing at least one of the tags will return. Multiple tags will be treated as or statements.

INCLUDE_TRACK - Specify True or False to return the program track information the participant is currently in. If this element is not included, then False is assumed.

INCLUDE_STEP - Specify True or False to return the program step information the participant is currently in. If this element is not included, then False is assumed.

<Envelope>
      <Body>
           <GetProgramsByContact>
                 <INCLUDE_ACTIVE>True</INCLUDE_ACTIVE>
                 <INCLUDE_INACTIVE>False</INCLUDE_INACTIVE>
                 <VISITOR_KEY>125632414</VISITOR_KEY>
                 <INCLUDE_HISTORY/>
                      <APPROVED_FOR_SALES/>
                      <INCLUDE_TAGS>
                           <TAG>January Campaign</TAG>
                           <TAG>Feb Campaign</TAG>
                      </INCLUDE_TAGS>
                      <INCLUDE_TRACK/>
                      <INCLUDE_STEP/>
            </GetProgramsByContact>
       </Body>
</Envelope>
<Envelope>
     <Body>
           <RESULT>
                <SUCCESS>TRUE</SUCCESS>
                <PROGRAMS>
                     <PROGRAM>
                          <PROGRAM_ID>5435</PROGRAM_ID>
                          <STATE>Running</STATE>
                          <ENTERED_DATE>01/01/2012</ENTERED_DATE>
                          <EXITED_DATE/>
                          <TRACKtype=”start”>
                                <NAME>
                                      <![CDATA[Initialize]]>
                                </NAME>
                                 <ID>555</ID>
                          </TRACK>
                          <STEP type=”email”>
                                <NAME>
                                      <![CDATA[Welcome Email]]>
                                </NAME>
                                <ID>101</ID>
                          </STEP>
                   </PROGRAM>
                   <PROGRAM>
                         <PROGRAM_ID>5436</PROGRAM_ID>
                         <STATE>Completed</STATE>
                         <NOT_ACTIVE />
                         <ENTERED_DATE>01/01/2012</ENTERED_DATE>
                         <EXITED_DATE>01/31/2012</EXITED_DATE>
                         <TRACKtype=”end”>
                               <NAME>
                                     <![CDATA[End Track]]>
                               </NAME>
                               <ID>557</ID>
                         </TRACK>
                   </PROGRAM>
                   <PROGRAM>
                         <PROGRAM_ID>5437</PROGRAM_ID>
                         <STATE>Running</STATE>
                         <ENTERED_DATE>01/01/2012</ENTERED_DATE>
                         <EXITED_DATE/>
                         <TRACKtype=”other”>
                               <NAME>
                                     <![CDATA[Third Track]]>
                               </NAME>
                               <ID>558</ID>
                           </TRACK>
                           <STEP type=”direct mail”>
                                <NAME>
                                      <![CDATA[Customer Event]]>
                                </NAME>
                                <ID>102</ID>
                           </STEP>
                    </PROGRAM>
                    <PROGRAM>
                         <PROGRAM_ID>5437</PROGRAM_ID>
                         <STATE>Inactive</STATE>
                         <NOT_ACTIVE />
                         <ENTERED_DATE>01/01/2012</ENTERED_DATE>
                         <EXITED_DATE/>
                         <TRACKtype=”other”>
                               <NAME>
                                     <![CDATA[Track-4]]>
                               </NAME>
                               <ID>560</ID>
                          </TRACK>
                          <STEP type=”email”>
                                <NAME>
                                     <![CDATA[Renewal Email]]>
                                </NAME>
                                <ID>107</ID>
                           </STEP>
                    </PROGRAM>
              </PROGRAMS>
         </RESULT>
    </Body>
</Envelope>
<Envelope>
     <Body>
List
    </FaultString>
</Body>undefined</Envelope>undefined<RESULT>
<SUCCESS>false</SUCCESS>undefined</RESULT>undefined<Fault>
<Request/>
<FaultCode/>
<FaultString>Contact does not exist in the database or Contact     <detail>
          <error>
              <errorid>133</errorid>
              <module/>
              <class>SP.API</class>
              <method/>
           </error>
     </detail>
</Fault>

Elements (Results)

SUCCESS - True if successful; False if not.

PROGRAMS - The XML nodes defining each program.

The following elements are children of PROGRAMS>PROGRAM.

PROGRAM_ID - Returns the unique ID of the Program.

STATE - Returns the status of the program: Running, Scheduled, Completed, Inactive.

NOT_ACTIVE - This element is included in the response if the contact is not currently active in the program.

ENTERED_DATE - The date that the contact entered the program in the format “mm/dd/yyyy”.

EXITED_DATE - The date that the contact exited the program in the format “mm/dd/yyyy”.

TRACK - The XML node defining the track of a program: start (Defines Start Track), end (Defines End Track), other (Defines other than Start or End Track).
NAME - A child element of TRACK that defines the name of the track.
ID - A child element of TRACK that defines the ID of the track.

STEP - The XML node defining the step of a program: Email, Direct mail, Telesales.
NAME - A child element of STEP that defines the name of the track.
ID - A child element of STEP that defines the name of the track.