External APIs in the SMS Campaign Manager

You can create an API template to make an API call to an external system directly from an SMS multi-step program in the SMS Campaign Manager.

Once you create a template, you add it as an action in a multi-step program. Only basic or oAuth authentication methods are supported when trying to connect to any external API other than Acoustic Campaign.

To create the XML API template:

  1. Log in to Acoustic Campaign and access the SMS Campaign Manager by going to SMS > Campaign Manager .
  2. Click Services and then click External API.
  3. Click the Create External API link.
  4. In Request Type, complete these fields:
    • Name: Type the name of the external API template.
    • Request Type: Select Post.
    • Authentication: Select oAuth.
  5. In Define Variables, click the + icon to add the API variables related to the database fields. Enter this information as it appears in the database (as a best practice).
  6. Add the first variable. In this example, we want to pass the SMS Phone (Mobile) Number. This variable is required to sync with the SMS mobile number field in the database.
  7. Add the second (and third) variables to pass the custom values that update the contact record in Acoustic Campaign.
  8. Click Next.
  9. Go to the Define Headers section, click the + icon to add a header, and then enter the information below in the fields:
    • Header Name: Type ‘Content-Type’.
    • Header Value: Type ‘text/xml’.
  10. In Construct URL & Document, complete the information below to configure the API endpoint:
    • URL: https://api-campaign-{data center}-{POD#}.goacoustic.com/XMLAPI
    • Document
      - Select Include Document.
      - Choose XML.
      - Paste the API payload in the text field. In this example, the AddRecipient API code is in the field.
      - Place the cursor between the value tags and select the variable from the Insert Variables list. Click Insert to add the field name to the selected value.
      Use the API payload below as your Document. The parameter names used in this example may be different than your database field names.
  11. Click the Create External API button.
    Note: Do not select any options in the Parse Response section. Acoustic Campaign does not capture these API responses.
<Envelope>

    <Body>

     <AddRecipient>

       <LIST_ID>3651415</LIST_ID>

       // This is your database (list) id

       <CREATED_FROM>1</CREATED_FROM>

       <UPDATE_IF_FOUND>true</UPDATE_IF_FOUND>

       <SYNC_FIELDS>

         <SYNC_FIELD>

           <NAME>Mobile</NAME>

           // This is SMS Phone Number Type field name

           <VALUE>{{mobile}}</VALUE>

         </SYNC_FIELD>

       </SYNC_FIELDS>

       <COLUMN>

         <NAME>name</NAME>

         // This is Custom field name such as Email

         <VALUE>{{name}}</VALUE>

       </COLUMN>

        <COLUMN>

          <NAME>name1</NAME>

          // This is Custom field name such as Age

          <VALUE>{{name1}}</VALUE>

        </COLUMN>

      </AddRecipient>

    </Body>
    
    </Envelope>