Integration via API

Adding a Lead/Contact via API

In order to send a lead / contact to RAIA programmatically we offer a Rest API. For example, if you wanted to send a lead from your website to RAIA real-time - you would use our API.

When you setup your BOT you will receive an API Key (which you will include in your API Call)

// The input fields for the post to our endpoint


APIKEY (required)
    Each Bot has a unique APIKey.  
SECRETKEY (required)
    Secret Key needs to be generated for the Bot.
FNAME (required)
    First Name of Contact
LNAME (required)
    Last Name of Contact
CHANNEL (defaults to SMS)
    Must be SMS or EMAIL (the method of communication bot will use)
PHONE (required for Channel SMS)
    Phone of Contact
EMAIL (required for Channel EMAIL)
    Email of Contact
    Source of Contact
    Context of your relationship with this contact
    The first message bot will send to contact (SMS)
    The first message bot will send to contact in HTML (Email)
    The subject line in the email.
    Your custom identifier (ID) for this contact (the ID you use in your system)
    Your custom identifier (ID) for the contact owner (e.g. Sales Rep)

Generating a Secret Key

In order to use the API you will need the Public APIKEY that is assigned to each Bot, and also need to generate a SECRETKEY in the RAIA App to ensure the request is authenticated. You can do this under the Settings > Integration > API section.

Example form code that would deliver the lead to RAIA

// Example Form Code

<form method="post" action=""> 
<input type="hidden" name="APIKEY" value="  <YOUR API KEY HERE>  ">
<input type="hidden" name="SOURCE" value="Website">
<input type="hidden" name="CONTEXT" value="This lead filled out form to learn more">
<input type="hidden" name="INTRO" value="Thank you for visiting Do you have any questions?"> 
<input type="hidden" name="CHANNEL" value="SMS">
<input type="hidden" name="ReturnURL" value="">

<input type="text" name="FName" placeholder="First Name" required><BR>
<input type="text" name="LName" placeholder="Last Name" required><BR>
<input type="text" name="Email" placeholder="Email" required><BR>
<input type="text" name="Phone" placeholder="Phone" required><BR>
<input type="Submit" value="Request More Info">

Example of posting via PHP


// Define the data to send
$data = [
    'SOURCE' => 'Website',
    'CONTEXT' => 'This lead filled out form to learn more',
    'INTRO' => 'Thank you for visiting Do you have any questions?',
    'CHANNEL' => 'SMS',
    'ReturnURL' => '',
    'FName' => $_POST['FName'], // Assuming these values are obtained from a form submission
    'LName' => $_POST['LName'],
    'Email' => $_POST['Email'],
    'Phone' => $_POST['Phone']

// Initialize cURL session
$ch = curl_init();

// Set cURL options
curl_setopt($ch, CURLOPT_URL, '');
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

// Execute the POST request
$response = curl_exec($ch);

// Check for errors
    echo 'Request Error:' . curl_error($ch);

// Close cURL session

// Process the response
echo $response;


Example in cURL

curl -X POST \
    -d SOURCE=Website \
    -d CONTEXT="This lead filled out form to learn more" \
    -d INTRO="Thank you for visiting Do you have any questions?" \
    -d CHANNEL=SMS \
    -d ReturnURL= \
    -d FName=<First Name> \
    -d LName=<Last Name> \
    -d Email=<Email Address> \
    -d Phone=<Phone Number>

Last updated