Skip to content

Instantly share code, notes, and snippets.

View bryanbarnard's full-sized avatar
🕶️
building

Bryan Barnard bryanbarnard

🕶️
building
View GitHub Profile
@bryanbarnard
bryanbarnard / keybase.md
Created April 15, 2014 02:50
keybase.md

Keybase proof

I hereby claim:

  • I am bryanbarnard on github.
  • I am nardbard (https://keybase.io/nardbard) on keybase.
  • I have a public key whose fingerprint is AB0C CFF7 23A6 242F 907F 5DC6 F32C 499A A096 5A86

To claim this, I am signing this object:

@bryanbarnard
bryanbarnard / jsbin.UQutIPov.html
Created May 28, 2014 19:57
Highcharts Simple Sample
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script><meta name="description" content="Highcharts Sample" />
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/modules/exporting.js"></script>
<div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
@bryanbarnard
bryanbarnard / gist:fd17525321e0cc64e4f4
Created May 13, 2015 13:54
Sample SOAP GetRecords request using _limit parameter made against Demo ServiceNow instance
POST https://demo010.service-now.com/incident_list.do?SOAP HTTP/1.1
Accept-Encoding: gzip,deflate
Content-Type: text/xml;charset=UTF-8
SOAPAction: "http://www.service-now.com/incident/getRecords"
Authorization: Basic YWRtaW46YWRtaW4=
Content-Length: 350
Host: demo010.service-now.com
Connection: Keep-Alive
User-Agent: Apache-HttpClient/4.1.1 (java 1.5)
@bryanbarnard
bryanbarnard / sample_restmessagev2.js
Created July 2, 2015 14:57
Sample RESTMessageV2 Parse JSON Response
// NOTE: this sample was run in a ServiceNow instance running release version Fuji Patch 4
(function sampleRequest() {
try {
var request = new sn_ws.RESTMessageV2();
request.setHttpMethod('get');
request.setEndpoint('https://rawgit.com/anonymous/f1c4664cafd6caf855fd/raw/f7ca3b022045e2c9f49dd2b453dea0cecc09888c/sample_json.json');
var response = request.execute();
var httpResponseStatus = response.getStatusCode();
@bryanbarnard
bryanbarnard / testHook.js
Created August 20, 2015 05:20
My first hook.io microservice
// Access incoming HTTP request data
module['exports'] = function accessRequestData (hook) {
var params = hook.params;
// params contains all incoming request parameters,
// such as query string or form data.
// See http://hook.io/docs#data for more information
// Responds back with all incoming HTTP params
hook.res.write(JSON.stringify(hook.params, true, 2));
hook.res.end();
};
@bryanbarnard
bryanbarnard / sample_request.http
Last active September 25, 2015 21:14
Sample Request Table API to GET an Incident
GET /api/now/table/incident?sysparm_limit=1 HTTP/1.1
Authorization: <removed>
Accept: application/json
Host: demo003.service-now.com
Connection: close
@bryanbarnard
bryanbarnard / sample_response.http
Created September 25, 2015 20:50
Sample Response
HTTP/1.1 200 OK
Link: <https://demo003.service-now.com/api/now/table/incident?sysparm_limit=1&sysparm_offset=0>;rel="first",<https://demo003.service-now.com/api/now/table/incident?sysparm_limit=1&sysparm_offset=-1>;rel="prev",<https://demo003.service-now.com/api/now/table/incident?sysparm_limit=1&sysparm_offset=1>;rel="next",<https://demo003.service-now.com/api/now/table/incident?sysparm_limit=1&sysparm_offset=549>;rel="last"
X-Total-Count: 550
Content-Type: application/json
Transfer-Encoding: chunked
Date: Fri, 25 Sep 2015 20:46:20 GMT
Server: ServiceNow
Connection: close
{
@bryanbarnard
bryanbarnard / sample request using sysparm_fields.http
Last active September 25, 2015 21:21
Sample Request using sysparm_fields
GET /api/now/table/incident?sysparm_limit=1&sysparm_fields=number,location HTTP/1.1
Authorization: Basic <removed>
Accept: application/json
Host: demo003.service-now.com
Connection: close
@bryanbarnard
bryanbarnard / sample_response_sysparm_fields.http
Created September 25, 2015 21:17
Sample Response - using sysparm_fields to limit response
HTTP/1.1 200 OK
Link: <https://demo003.service-now.com/api/now/table/incident?sysparm_limit=1&sysparm_fields=number&sysparm_offset=0>;rel="first",<https://demo003.service-now.com/api/now/table/incident?sysparm_limit=1&sysparm_fields=number&sysparm_offset=-1>;rel="prev",<https://demo003.service-now.com/api/now/table/incident?sysparm_limit=1&sysparm_fields=number&sysparm_offset=1>;rel="next",<https://demo003.service-now.com/api/now/table/incident?sysparm_limit=1&sysparm_fields=number&sysparm_offset=549>;rel="last"
X-Total-Count: 550
Content-Type: application/json
Transfer-Encoding: chunked
Date: Fri, 25 Sep 2015 21:08:44 GMT
Server: ServiceNow
Connection: close
{"result":[{"number":"INC0000001"}]}
@bryanbarnard
bryanbarnard / sample_request_dot_walk.http
Created September 25, 2015 21:34
Sample Request to a ServiceNow Demo Instance - using sysparm_fields dot-walk
GET /api/now/table/incident?sysparm_limit=1&sysparm_fields=number%2Clocation%2Clocation.name%2Clocation.city HTTP/1.1
Authorization: <removed>
Accept: application/json
Host: demo003.service-now.com
Connection: close