Skip to content

Instantly share code, notes, and snippets.

View jwebster's full-sized avatar

James Webster jwebster

View GitHub Profile
@jwebster
jwebster / gist:f72d91ce9b6f1088c25c86498ac43723
Created June 7, 2019 11:10
sheepCRM API - PHP login example
$url = 'https://api.sheepcrm.com/api/v1/sheep-app/user/auth/';
$flock = 'example';
$sheep_token_name = 'my_third_party_app';
$post_data['email'] = $email;
$post_data['password'] = $password;
$post_data['token_name'] = $sheep_token_name;
$post_data['token_timeout'] = 43200;
$post_data['secure_hash'] = time();
@jwebster
jwebster / gist:1a7967b405588534cc66a2c63c98449c
Created June 7, 2019 11:08
sheepCRM API - PHP example POST
$payload = json_encode($packet);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");
curl_setopt($ch, CURLOPT_POSTFIELDS, $payload);
// Set URL on which you want to post the Form and/or data
curl_setopt($ch, CURLOPT_URL, $url);
// Header fields
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
'Content-type: application/json',
{u'_links': [],
u'billing_address': {u'address1': u'',
u'address2': u'',
u'city': u'',
u'company': u'',
u'country': u'',
u'country_code': u'',
u'latitude': 0,
u'longitude': 0,
u'name': u'',

Sheep API introduction

Notes:

  • replace {flock} with the client identifier
  • 200 = OK
  • 201 = create
  • 4xx = Client screwed up
  • 404 = not found (also returned on bad user credentials)
  • 409 = conflict (auth and structure ok but a problem with the data values)
  • 5xx = Sheep screwed up
@jwebster
jwebster / sheep-member-self-service.md
Last active June 26, 2019 16:17
SheepCRM member auth

Sheep Member self-service integration guide

Notes:

  • replace {flock} with the client identifier
  • 201 = create
  • 404 = not found (also returned on bad user credentials)
  • 409 = conflict (auth and structure ok but a problem with the data values)
  • curl defaults to GET the -d switch is an http POST

Login / Create a self-service member api token (bearer token)

@jwebster
jwebster / sermon-front-matter-example
Last active September 16, 2016 07:51
An example 'front matter' for adding a sermon to the coggesparish.com website
---
layout: sermon
series: "Book of 1Timothy"
title: "Challenging with Grace."
date: "2014-05-11 11:00:00"
audio: "/documents/2014-05-11 Rich White.mp3"
speaker: "Rich White"
speaker_info: ""
duration: "23"
youtube_videos: [""]