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 / apiHeader-curl-content-type-example
Created August 31, 2015 17:17
API Header Content-Type - An example header with Content-Type when using cURL
curl -u {username}:{password}
-H 'x-app-id: {app_id}'
-X {POST or PUT}
-H 'Content-Type: application/json'
-d '{Data to POST or PUT}'
'https://api.boomtrain.com/{endpoint}'
@boomtrain-support
boomtrain-support / apiHeader-jquery-example.js
Created August 31, 2015 17:15
API Header - An example header when using jQuery
$.ajax({
url: 'https://api.boomtrain.com/{endpoint}',
headers: {
'x-app-id': '{app_id}'
},
...
});
@boomtrain-support
boomtrain-support / apiHeader-curl-example
Created August 31, 2015 17:14
API Header - An example header when using cURL
curl
-H 'x-app-id: {app_id}'
'https://api.boomtrain.com/{endpoint}'
@boomtrain-support
boomtrain-support / authentication-request-token-jquery.js
Created August 31, 2015 17:11
API Authentication - An example to request an OAuth token using jQuery
$.ajax({
url: 'https://api.boomtrain.com/tokens',
headers: {
'x-app-id': '{app_id}',
'Authentication': 'Basic ' + btoa('{username}:{password}')
},
...
});
@boomtrain-support
boomtrain-support / authentication-request-token-curl
Created August 31, 2015 17:08
API Authentication - An example requesting an OAuth token using cURL
curl -u {username}:{password}
-H 'x-app-id: {app_id}'
-X {HTTP Method}
'https://api.boomtrain.com/tokens'
@boomtrain-support
boomtrain-support / authentication-curl-example
Created August 31, 2015 17:06
API Authentication - An example of basic authentication using cURL
curl -u {username}:{password}
-H 'x-app-id: {app_id}'
-X {HTTP Method}
'https://api.boomtrain.com/{endpoint}'
@boomtrain-support
boomtrain-support / authentication-jquery-example.js
Created August 31, 2015 17:05
API Authentication - An example of basic authentication using jQuery
$.ajax({
url: 'https://api.boomtrain.com/{endpoint}',
headers: {
'x-app-id': '{app_id}',
'Authentication': 'Basic ' + btoa('{username}:{password}')
},
...
});
@boomtrain-support
boomtrain-support / authentication-oauth-curl
Last active August 31, 2015 17:02
API Authentication - An example OAuth token authentication request using cURL
curl -u {username}:{OAuth Token}
-H 'x-app-id: {app_id}'
-X {HTTP Method}
'https://api.boomtrain.com/{endpoint}'
@boomtrain-support
boomtrain-support / authentication-oauth-jquery.html
Last active August 31, 2015 17:20
API Authentication - An example authentication request using jQuery
<script>
// Use the OAuth Token with another request
function useToken() {
//Send a jQuery AJAX request
$.ajax({
url: 'https://api.boomtrain.com/{endpoint}',
// Replace with your Username and App Id,
// using the OAuth Token in place of your Password
headers: {
'x-app-id': '{app_id}',
@boomtrain-support
boomtrain-support / get-notifications-id-curl
Created August 31, 2015 16:55
GET /notifications/:id - 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/{id}'