Table of Contents
IMPORTANT: Before you start using our API
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.
Where to find your API key
Click on the Account tab in your app sidebar: https://share.zight.com/p9u4EndL
Click on the Advanced tab in the top navigation: https://share.zight.com/rRudXJqR
Click the "Show" button to reveal your API key: https://share.zight.com/E0uNd665
Copy the API string to your clipboard: https://share.zight.com/7KuwgJJ2
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)
• phone (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.
Copy
$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
'phone' => '', // Optional
'password' => '' // Optional. Password will be generated & sent back to you if this is empty
);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($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
}
Get Info for a Specific Student
This call will provide all information on a specific student, including basic info, tags, custom field info, and points information, as explained below in greater detail.
API Call: /api/public/student/info/?api_key={paste your key}
Send the following variables using "POST" method:
• email
• course_id (optional)
If a Course ID is provided, then we'll send back all student data, an array containing all tags, as well as the following course-specific points information as well:
xp_earned
– the amount XPs the student has currently earned in the Course ID that's providedxxp_earned
– the amount of XXPs the student has currently earned in the Course ID that's providedxp_total
– the total amount of XPs available in the Course ID that's providedxxp_total
– the total amount of XXPs available in the Course ID that's providedxp_perc_complete
– the XP percent completion for the student in the course, presented in a whole number without decimalxxp_perc_complete
– the XXP percent completion for the student in the course, presented in a whole number without decimal
If a Course ID is NOT provided, then we'll send back all student data, as well as the following aggregate points data:
global_xp_earned
– the total amount XPs the student has currently earned in ALL courses in which they're enrolledglobal_xxp_earned
– the total amount of XXPs the student has currently earned in ALL courses in which they're enrolledglobal_xp_total
– the total amount of XPs available in ALL courses in which they're enrolledglobal_xxp_total
– the total amount of XXPs available in ALL courses in which they're enrolledglobal_xp_perc_complete
– the average XP percent completion for the student in ALL courses in which they're enrolledglobal_xxp_perc_complete
– the average XXP percent completion for the student in ALL courses in which they're enrolled
Here's a PHP code-snippet to query a single student without including the Course ID.
$data = array(
'email' => $email
);
$api_url="https://api.xperiencify.io/api/public/student/info/?api_key=".$api_key; // Available from your Account page
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $api_url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec($ch);
$output_array = json_decode($output); # decode the JSON object into a PHP array
echo "id: " . $output_array->id . "\n";
echo "phone: " . $output_array->phone . "\n";
echo "email: " . $output_array->email . "\n";
echo "first_name: " . $output_array->first_name . "\n";
echo "last_name: " . $output_array->last_name . "\n";
echo "xp_earned: " . $output_array->xp_earned . "\n";
echo "xxp_earned: " . $output_array->xxp_earned . "\n";
echo "xp_total: " . $output_array->xp_total . "\n";
echo "xxp_total: " . $output_array->xxp_total . "\n";
echo "xp_perc_complete: " . $output_array->xp_perc_complete . "\n";
echo "xxp_perc_complete: " . $output_array->xxp_perc_complete . "\n";
Update Basic Student Info
This API call will allow you to update student first name, last name, phone and password.
NOTE: email address is not available to update because it's the main identifier for a student in our system and if changed incorrectly, can cause unintended consequences. If you need to make a change to a student's email address, we suggest adding a new student record.
API Call: /api/public/student/update/?api_key={paste your key}
Send the following variables using "PATCH" method:
• student_email
• first_name (optional)
• last_name (optional)
• phone (optional)
• password (optional)
Here's a PHP code-snippet to update student info.
$api_url="https://api.xperiencify.io/api/public/student/update/?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,
'first_name' => $firstname,
'last_name' => $lastname,
'password' => $phone
);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
$output = curl_exec($ch);
Update a Student Custom Field
This allows you to update one or more custom fields for a student.
API Call:
Send the following variables using "POST" method:
• student (use email address)
• field (custom field's name)
• value (custom field's value)
Here's a PHP code-snippet:
$api_url="https://api.xperiencify.io/api/public/student/customfield/?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, "POST");
$data = array(
'student' => 'student@test.com', // specify a student using their email address
'field' => 'COACH_NAME', // specify the custom field name
'value' => 'Marcy Brown', // specify the custom field value
);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
$output = curl_exec($ch);
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, http_build_query($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};
$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, http_build_query($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, http_build_query($data));
$output = curl_exec($ch);
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
Add a New Tag
This allows you to add a new tag into your Xperiencify account.
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, http_build_query($data));
$output = curl_exec($ch);
Remove a Tag
This allows you to remove a new tag from your Xperiencify account.
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, http_build_query($data));
$output = curl_exec($ch);
Get a list of all Courses
This allows you to get a list of all courses in your account.
API Call: /api/public/coach/courses/?api_key={paste your key}
Here's a PHP code-snippet:
$api_url="https://api.xperiencify.io/api/public/coach/courses/?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");
$output = curl_exec($ch);
Get a list of all Students
This allows you to get a list of all students in your account, filtering by course if you wish.
Basic API Call: /api/public/coach/students/?api_key={paste your key}
API Call including a course filter: /api/public/coach/students/?api_key={paste your key}&course_id={course_id}
Here's a PHP code-snippet:
$api_key = "{paste your key}";
$course_id = "{paste your course ID}"; // optional if you want to filer by a particular course
$api_url = "https://api.xperiencify.io/api/public/coach/students/?api_key=$api_key";
$api_url = "https://api.xperiencify.io/api/public/coach/students/?api_key=$api_key&course_id=$course_id"; // optional add Course ID to filter
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $api_url);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$output = curl_exec($ch); // outputs a JSON object