Skip to content

Instantly share code, notes, and snippets.

View boomtrain-support's full-sized avatar

Boomtrain Support boomtrain-support

View GitHub Profile
@boomtrain-support
boomtrain-support / get-resources-curl
Last active August 31, 2015 21:43
GET /resources - An example request for this endpoint using cURL
curl
-H 'x-app-id: {app_id}'
-X GET
'https://api.boomtrain.com/resources'
@boomtrain-support
boomtrain-support / get-recommendations-response.js
Created August 31, 2015 20:33
GET /recommendations - Response details about Recommendations for a User.
[
0: {
id: '{ID of the Recommendable Resource}',
model: '{Model Type}',
props: {
author: '{Author Name}',
body: '{Body of the Resource}',
description: '{Description of the Resource}',
pubDate: '{Date the Resource was Published}',
thumbnail: '{URL to the Hosted Image}',
@boomtrain-support
boomtrain-support / get-recommendations-jquery.html
Last active August 31, 2015 21:03
GET /recommendations - An example request for this endpoint using jQuery
<script>
// Get Recommendations for a specified user
function getUserUserIdRecommendations() {
// Send a jQuery AJAX request to to retreive the recommendations
$.ajax({
url: 'https://api.boomtrain.com/users/{userId}/recommendations?expand=true',
// Replace with your App Id
headers: {'x-app-id': '{app_id}'},
type: 'GET',
success: function(msg) {
@boomtrain-support
boomtrain-support / get-recommendations-curl
Last active August 31, 2015 21:03
GET /recommendations - An example request for this endpoint using cURL
curl
-H 'x-app-id: {app_id}'
-X GET
'https://api.boomtrain.com/users/{userId}/recommendations?expand=true'
@boomtrain-support
boomtrain-support / post-event-track-jquery.html
Created August 31, 2015 17:43
POST /event/track - An example request for this endpoint using jQuery
<script>
function eventTrack() {
// JSON stringify the data
var json_data = JSON.stringify({
'type': '{Event Type}',
'model': '{Model Type}',
'id': '{Resource ID}',
'userId': '{User ID}',
'timestamp': '{ISO Formatted Timestamp, will be generated if not specified}'
});
@boomtrain-support
boomtrain-support / post-event-track-curl
Created August 31, 2015 17:41
POST /event/track - An example request for this endpoint using cURL
curl -u {username}:{password}
-H 'x-app-id: {app_id}'
-X POST
-H 'Content-Type: application-json'
-d '{
"type": "{Event Type to Track}",
"model": "{Resource Model Type to Track}",
"id": "{ID of the Specific Resource to Track}",
"app_member_id": "{ID of the User to Track}",
"timestamp": "{ISO Formatted Timestamp, will be generated if not specified}"
@boomtrain-support
boomtrain-support / get-notifications-response.js
Last active August 31, 2015 20:31
GET /notifications/ - Response details about all Campaigns
[
0: {
active: {true or false},
app: "{app_id}",
emailData: {
from: '{The From: Address Information}',
layout: '{A JSON array with the body of the email}',
subject: '{The Subject of the email}'
},
exclude: {
@boomtrain-support
boomtrain-support / get-notifications-jquery.html
Created August 31, 2015 17:24
GET /notifications/ - An example request for this endpoint using jQuery
<script>
// Get a list of Campaigns
function getNotifications() {
// Send a jQuery AJAX request to get the Campaigns
$.ajax({
url: 'https://api.boomtrain.com/notificaions',
// Replace your Username, Password, and App Id
headers: {
'x-app-id': '{app_id}',
'Content-Type': 'application/json',
@boomtrain-support
boomtrain-support / get-notifications-curl
Created August 31, 2015 17:23
GET /notifications/ - An example request for this endpoint using cURL
curl -u {username}:{password}
-H 'x-app-id: {app_id}'
-X GET
'https://api.boomtrain.com/notifications'
@boomtrain-support
boomtrain-support / apiHeader-jquery-content-type-example.js
Created August 31, 2015 17:18
API Header Content-Type - An example header with Content-Type when using jQuery
$.ajax({
url: 'https://api.boomtrain.com/{endpoint}',
headers: {
'x-app-id': '{app_id}',
'Content-Type': 'application/json',
'Authentication': 'Basic ' + btoa('{username}:{password}')
},
...
})