Create an API template to make an API call to an external system directly from an SMS multi-step program in SMS Campaign Manager. After you create the template, add it as an action in a multi-step program.
About this task
If trying to connect to any external API other than Watson Campaign Automation, only basic or oAuth authentication methods are supported.
Program(s) used in the use case
How it Works
Use this feature to update custom fields in your database. You can also refer to the Using API to add or update profile information article.
Create the XML API Template
- Log in to Watson Campaign Automation and access the SMS Campaign Manager by going to Content then Mobile Messages.
- Click Services and then click External API.
- Click the Create External API link.
- In Request Type, complete these fields:
- Name: Type the name of the external api template.
- Request Type: Select Post.
- Authentication: Select oAuth.
- In Define Variables, click the + icon to add the API variables related to to the database fields. Enter this information as it appears in the database (as a best practice).
- 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.
- Add the second (and third) variables to pass the custom values that updates the contact record in Watson Campaign Automation.
- Click Next.
- 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’.
- In Construct URL & Document, complete the information below to configure the API endpoint:
- URL: Type ‘https://api[x].silverpop.com/XMLAPI’.
- 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 following API payload as your Document. The parameter names used in this example may be different than your database field names.
// This is your database (list) id
// This is SMS Phone Number Type field name
// This is Custom field name such as Email
// This is Custom field name such as Age
- Click the Create External API button.
Note: Do not select any options in the Parse Response section. Watson Campaign Automation does not capture these API responses.