Integrations

Integrating with API


Murray Gray in Integrations

Dec 09, 2020 - 5 min read. Reqiures Growth plan or higher.

Heads up — before you dive in, you should understand and be OK with the fact that API code is usually pretty complicated, and programmers usually need to get involved!

For that reason we aren't able to provide our usual support on any API questions or issues you might face. Please refer those questions to your programmer.

API functions listed on this page:

  • Add Student to a Course
  • Remove Student from a Course
  • Remove Student from All Courses
  • Get List of Tags for a Student
  • Add Tag to Student
  • Remove Tag from Student
  • Add a Tag
  • Remove a Tag

Add Student to a Course

API Call: /api/public/student/create/?api_key={paste your key}

Send the following variables using "POST" method:
• student_email
• first_name
• last_name (optional)
• course_id
• password (optional, it will be generated and passed back to you if you do not send)

Here's a PHP code-snippet to add a student to a specific course, retrieve their unique magic link, and then redirect your student right to their membership site home page with no login required.

$api_url="https://api.xperiencify.io/api/public/student/create/?api_key={paste your key}"; // Available from your Account page

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $api_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, true);
$data = array(
   'student_email' => $email,
   'course_id' => '57365', // Course ID is in the URL of your course edit page
   'first_name' => $firstname,
   'last_name' => '', // Optional
   'password' => '' // Optional. Password will be generated & sent back to you if this is empty
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$output = curl_exec($ch);

// Everything after here is optional
// Check for errors
if (curl_errno($ch)) {
   $error_msg = curl_error($ch);
}
// Handle any possible errors
if (isset($error_msg)) {
   echo "Error: ".$error_msg."";
   exit;
} else {
   $output_array = json_decode($output, true);
   $magic_link=$output_array['magic_link'];
   header("location: ".$magic_link); // Optional; redirect student to the course membership site home page
}

Remove Student from a Course

API Call: /api/public/student/course/remove/?api_key={paste your key}

Send the following variables using "POST" method:
• student_email
• course_id

Remove Student from ALL Courses

API Call: /api/public/student/course/remove/all/?api_key={paste your key}

Send the following variables using "POST" method:
• student_email

Get List of Tags for a Student

API Call: /api/public/student/tag/list/?api_key={paste your key}

Send the following variables using "GET" method:
• student_email

Here's a PHP code-snippet:

$api_url="https://api.xperiencify.io/api/public/student/tag/list/?api_key={paste your key}; // Available from your Account page

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $api_url);
curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'GET' ); $data = array(
   'student_email' => $email,
   'tagname' => 'vip', // specify an existing tag in your XP account
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$output = curl_exec($ch);

Add Tag to Student

API Call: /api/public/student/tag/manager/?api_key={paste your key}

Send the following variables using "POST" method:
• student_email
• tagname (multiple tags possible, separated by commas)

Here's a PHP code-snippet:

$api_url="https://api.xperiencify.io/api/public/student/tag/manager/?api_key={paste your key}; // Available from your Account page

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $api_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, true);
$data = array(
   'student_email' => $email,
   'tagname' => 'vip', // specify an existing tag in your XP account
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$output = curl_exec($ch);

Remove Tag from Student

API Call: /api/public/student/tag/manager/?api_key={paste your key}

Send the following variables using "DELETE" method:
• student_email
• tagname (multiple tags possible, separated by commas)

Here's a PHP code-snippet:

$api_url="https://api.xperiencify.io/api/public/student/tag/manager/?api_key={paste your key}; // Available from your Account page

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $api_url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE");
$data = array(
   'student_email' => $email,
   'tagname' => 'vip', // specify an existing tag in your XP account
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$output = curl_exec($ch);

Add a Tag

API Call: /api/public/coach/tag/?api_key={paste your key}

Send the following variables using "POST" method:
• tagname (multiple tags possible, separated by commas)

Here's a PHP code-snippet:

$api_url="https://api.xperiencify.io/api/public/coach/tag/?api_key={paste your key}; // Available from your Account page

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $api_url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POST, true);
$data = array(
   'tagname' => 'vip', // specify an existing tag in your XP account
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$output = curl_exec($ch);

Remove a Tag

API Call: /api/public/coach/tag/?api_key={paste your key}

Send the following variables using "DELETE" method:
• tagname (multiple tags possible, separated by commas)

Here's a PHP code-snippet:

$api_url="https://api.xperiencify.io/api/public/coach/tag/?api_key={paste your key}; // Available from your Account page

$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $api_url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "DELETE"); $data = array(
   'tagname' => 'vip', // specify an existing tag in your XP account
);

curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
$output = curl_exec($ch);

HELP ARTICLES
5