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 / post-resources-model-jquery.html
Last active August 31, 2015 23:09
POST /resources/:model - Create a new Resource with the specified model type using jQuery
<script>
// Create a new Resource of the specified model type
function postResourcesModel() {
// JSON stringify the data
var json_data = JSON.stringify({
'id': '{Resource ID}',
'props': {
'url': '{The Canonical URL}',
'title': '{The Title of the Resource}',
'thumbnail': '{URL to the Hosted Image}',
@boomtrain-support
boomtrain-support / post-resources-model-curl
Last active August 31, 2015 23:08
POST /resources/:model - Create a new Resource with the specified model type using cURL
curl -u {username}:{password}
-H 'x-app-id: {app_id}'
-X POST
-H 'Content-Type: application-json'
-d '{
"id": "{Resource ID}",
"props": {
"url": "{The Canonical URL}",
"title": "{The Title of the Resource}",
"thumbnail": "{URL of the Hosted Image}",
@boomtrain-support
boomtrain-support / get-resources-model-id-response.js
Created August 31, 2015 22:07
GET /resources/:model/:id - Response details with the Resource by model type and ID.
{
id: "{Specified ID}",
model: "{Model}",
props: {
author: "{Author}",
body: "{Body of the Resource}",
categories: {
"{Category 1}",
"{Category 2}"
},
@boomtrain-support
boomtrain-support / get-resources-model-id-jquery.html
Last active August 31, 2015 22:06
GET /resources/:model/:id - Retrieve the specified model type and Resource using jQuery.
<script>
// Get the Resource by model type and ID
function getResourcesModelId() {
// Send a jQuery AJAX request to retrieve the Resource
$.ajax({
url: 'https://api.boomtrain.com/resources/{model}/{id}',
// Replace with your App Id
headers: {'x-app-id': '{app_id}'},
type: 'GET',
success: function(msg) {
@boomtrain-support
boomtrain-support / get-resources-model-id-curl
Last active August 31, 2015 22:03
GET /resources/:model/:id - Retrieve the specified model type and Resource using cURL.
curl
-H 'x-app-id: {app_id}'
-X GET
'https://api.boomtrain.com/resources/{model}/{id}'
@boomtrain-support
boomtrain-support / get-resources-model-response.js
Created August 31, 2015 21:54
GET /resources/:model - Response details for the specified model type.
[
0: {
createdAt: "{ISO Formatted Date the Resource was Ingested}",
debug: "{A JSON array of items used by Boomtrain}",
props: "{A JSON array of the Resource Properties based on Your meta Tags}",
updatedAt: "{ISO Formatted Date the Resource was Last Reingested}"
},
1: {
createdAt: "{ISO Formatted Date the Resource was Ingested}",
debug: "{A JSON array of items used by Boomtrain}",
@boomtrain-support
boomtrain-support / get-resources-model-jquery.html
Created August 31, 2015 21:45
GET /resources/:model - An example request for this endpoint using cURL
<script>
// Request all Resources by model type
function getResourcesModel() {
// Send a jQuery AJAX request to retrieve the Resources by model type
$.ajax({
url: 'https://api.boomtrain.com/resources/{model}',
// Replace with your App Id
headers: {'x-app-id': '{app_id}'},
type: 'GET',
success: function(msg) {
@boomtrain-support
boomtrain-support / get-resources-model-curl
Created August 31, 2015 21:42
GET /resources/:model - An example request for this endpoint using cURL
curl
-H 'x-app-id: {app_id}'
-X GET
'https://api.boomtrain.com/resources/{model}'
@boomtrain-support
boomtrain-support / get-resources-response.js
Last active August 31, 2015 21:27
GET /resources - Response details with the model types.
{
"{Model Type 1}",
"{Model Type 2}",
...
}
@boomtrain-support
boomtrain-support / get-resources-jquery.html
Last active August 31, 2015 21:46
GET /resources - An example request for this endpoint using jQuery
<script>
// Get the model types for Resources
function getResources() {
// Send a jQuery AJAX request to retrieve the model types
$.ajax({
url: 'https://api.boomtrain.com/resources',
// Replace with your App Id
headers: {'x-app-id': '{app_id}'},
type: 'GET',
success: function(msg) {