Skip to content

Instantly share code, notes, and snippets.

@uncletammy
Last active August 29, 2015 14:27
Show Gist options
  • Save uncletammy/41759eda69cc0905e27c to your computer and use it in GitHub Desktop.
Save uncletammy/41759eda69cc0905e27c to your computer and use it in GitHub Desktop.
Honey API Examples

eSnap Record Examples

Action Route
Location Record location
User Record user
Product Record product

Location Record

Location

{ name: 'Upper Kirby District',
    latitude: 29.7334,
    longitude: -95.4192,
    hoursMonday: [ '0700', '2100' ],
    hoursTuesday: [ '0700', '2100' ],
    hoursWednesday: [ '0700', '2100' ],
    hoursThursday: [ '0700', '2100' ],
    hoursFriday: [ '0700', '2000' ],
    hoursSaturday: [ '0900', '2000' ],
    hoursSunday: [ '0900', '2100' ],
    address: '3600 Kirby Dr',
    city: 'Houston',
    state: 'TX',
    zip: '77098',
    phoneNumber: '7135265700',
    faxNumber: null,
    email: 'houstoninfo@snapkitchen.com',
    imageUrl: 'http://ohsnapproductimages.s3-website-us-west-1.amazonaws.com/locations/2/0.png',
    imageTimestamp: '2014-12-02T15:06:22.413',
    region: 'Houston',
    accessibility: '',
    isStoreActive: true,
    isOpenForBusiness: true,
    isOnlineOrderActive: true,
    isDeliveryActive: false,
    timestamp: '2015-08-21T12:46:07.06',
    id: 2,
    createdAt: '2015-08-10T19:12:15.000Z',
    updatedAt: '2015-08-21T20:07:17.000Z' }

Product Record

product

{ location: 2,
    name: 'Bison Hash S',
    displayName: 'Bison Quinoa Hash',
    groupId: 355,
    size: 'Small',
    imageUrl: 'http://ohsnapproductimages.s3-website-us-west-1.amazonaws.com/products/355.jpg',
    imageTimestamp: '2014-12-01T07:42:00.437',
    description: 'Bison Hash S',
    longDescription: 'Lean ground bison, organic red quinoa, organic brown rice, smashed kidney beans, red onions, and grated cheddar cheese.',
    nutrition: 
     { servingsize: '250.24g',
       servingsPerContainer: '1',
       kcals: 320,
       caloriesFromFat: 90,
       protein: 31,
       carbs: 28,
       percentDailyCarbs: 9,
       fats: 10,
       percentDailyFat: 15,
       satfat: 4,
       percentDailySatFat: 20,
       cholestrol: 70,
       percentCholestrol: 23,
       sugar: 3,
       fiber: 7,
       percentDailyFiber: 28,
       sodium: 350,
       percentDailySodium: 15,
       vitaminA: 20,
       vitaminC: 35,
       calcium: 10,
       iron: 30 },
    ingredients: 
     [ 'Ground Bison',
       'Organic Red Quinoa',
       'Red Kidney Bean',
       'Organic Brown Rice',
       'White Onion',
       'Green & Red Bell Peppers',
       'Red Onion',
       'Reduced Fat Cheddar Cheese',
       'Green Onion',
       'Paprika',
       'Sea Salt',
       'Ground Black Pepper',
       'Cayenne',
       'Cumin' ],
    category: 'Lunch',
    tags: [ 'Gluten Free', 'Carb Conscious', 'Sodium Conscious' ],
    plu: 355,
    remoteID: 355,
    isActive: true,
    region: 'Houston',
    price: 8.49,
    taxRatePickup: 8.25,
    taxRateDinein: null,
    quantity: -2,
    displayThreshold: 3,
    warningThreshold: 5,
    timestamp: '2015-08-20T19:49:14.313',
    id: 30,
    createdAt: '2015-08-10T18:40:02.000Z',
    updatedAt: '2015-08-21T20:04:55.000Z' }

User Record

User

{ email: 'snapkitchenbeta@gmail.com',
    password: '$2a$10$HxLr.RHDwDjbmvBtjahCdOpOs25mq18cW7QgtODm43GDbzIIKkxte',
    resetPasswordToken: null,
    resetPasswordTokenExpireDate: '2015-04-04T17:56:08.000Z',
    firstName: 'Snap',
    lastName: 'Beta',
    phoneNumber: '5129444444',
    locationPreferenceId: 9,
    menuPreferences: null,
    receiveUpdates: false,
    isAdmin: false,
    betaUser: true,
    loyaltyBalance: 0,
    loyaltyBalanceLastUpdated: '2015-03-02T21:30:46.000Z',
    stripeCustomerId: 'cus_5oKqn4Fymewh5w',
    loyaltyAccountId: '1111111119',
    id: 1,
    createdAt: '2015-03-02T22:38:57.000Z',
    updatedAt: '2015-08-21T17:44:14.000Z' } 

Honey Response Examples

Action Route
List locations GET /locations
List products GET /products
List products at location GET /location/:id/products
Get loyalty account by Phone GET /loyalty-account/phone/:phoneNumber

List locations

GET /locations

Expected Success Response

200 OK

[
    {
        "id": 1,
        "name": "Triangle",
        "hoursMonday": [
            "0700",
            "2100"
        ],
        "hoursTuesday": [
            "0700",
            "2100"
        ],
        "hoursWednesday": [
            "0700",
            "2100"
        ],
        "hoursThursday": [
            "0700",
            "2100"
        ],
        "hoursFriday": [
            "0700",
            "2000"
        ],
        "hoursSaturday": [
            "0900",
            "2000"
        ],
        "hoursSunday": [
            "0900",
            "2100"
        ],
        "address": "4616 Triangle Ave",
        "city": "Austin",
        "region": "Austin",
        "state": "TX",
        "phoneNumber": "5124599000",
        "email": "austininfo@snapkitchen.com",
        "photos": [
            "https://snapkitchendevelopment.azurewebsites.net/api/location/1/image"
        ],
        "testphotos": [
            {
                "imageUrl": "https://snapkitchendevelopment.azurewebsites.net/api/location/1/image",
                "imageTimeStamp": "2014-12-02T15:05:04.603"
            }
        ],
        "accessibility": "Wheelchair",
        "latitude": 30.314758,
        "longitude": -97.733934,
        "description": "Snap Kitchen's first location is in the center of Austin's Triangle area. This store features a wonderful fresh salad bar so that you can customize your salad.  ",
        "zip": "78751",
        "isStoreActive": true,
        "isOnlineOrderActive": false,
        "isDeliveryActive": false,
        "isOpenForBusiness": true,
        "timestamp": "2015-08-21T11:33:13.243"
    },
    {
        "id": 2,
        "name": "Upper Kirby District",
        "hoursMonday": [
            "0700",
            "2100"
        ],
        "hoursTuesday": [
            "0700",
            "2100"
        ],
        "hoursWednesday": [
            "0700",
            "2100"
        ],
        "hoursThursday": [
            "0700",
            "2100"
        ],
        "hoursFriday": [
            "0700",
            "2000"
        ],
        "hoursSaturday": [
            "0900",
            "2000"
        ],
        "hoursSunday": [
            "0900",
            "2100"
        ],
        "address": "3600 Kirby Dr",
        "city": "Houston",
        "region": "Houston",
        "state": "TX",
        "phoneNumber": "7135265700",
        "email": "houstoninfo@snapkitchen.com",
        "photos": [
            "https://snapkitchendevelopment.azurewebsites.net/api/location/2/image"
        ],
        "testphotos": [
            {
                "imageUrl": "https://snapkitchendevelopment.azurewebsites.net/api/location/2/image",
                "imageTimeStamp": "2014-12-02T15:06:22.413"
            }
        ],
        "accessibility": "",
        "latitude": 29.733365,
        "longitude": -95.419213,
        "description": "",
        "zip": "77098",
        "isStoreActive": true,
        "isOnlineOrderActive": true,
        "isDeliveryActive": false,
        "isOpenForBusiness": true,
        "timestamp": "2015-08-21T11:33:13.243"
    },
]

List products

GET /products

Expected Success Response

200 OK

[
    {
        "id": 355,
        "plu": 355,
        "groupId": 355,
        "name": "Bison Hash S",
        "displayName": "Bison Quinoa Hash",
        "description": "Bison Hash S",
        "longDescription": "Lean ground bison, organic red quinoa, organic brown rice, smashed kidney beans, red onions, and grated cheddar cheese.",
        "imageUrl": "https://snapkitchendevelopment.azurewebsites.net/api/product/355/image",
        "imageTimestamp": "2014-12-01T07:42:00.437",
        "tags": [
            "Gluten Free",
            "Carb Conscious",
            "Sodium Conscious"
        ],
        "price": 7.5,
        "categoryId": 10003,
        "category": "Lunch",
        "isIngredient": false,
        "ingredients": [
            "Ground Bison",
            "Organic Red Quinoa",
            "Red Kidney Bean",
            "Organic Brown Rice",
            "White Onion",
            "Green & Red Bell Peppers",
            "Red Onion",
            "Reduced Fat Cheddar Cheese",
            "Green Onion",
            "Paprika",
            "Sea Salt",
            "Ground Black Pepper",
            "Cayenne",
            "Cumin"
        ],
        "isActive": true,
        "caloriecount": 320,
        "recipe": "",
        "size": "Small",
        "nutrition": {
            "servingsize": "250.24g",
            "servingsPerContainer": "1",
            "kcals": 320,
            "caloriesFromFat": 90,
            "protein": 31,
            "carbs": 28,
            "percentDailyCarbs": 9,
            "fats": 10,
            "percentDailyFat": 15,
            "satfat": 4,
            "percentDailySatFat": 20,
            "cholestrol": 70,
            "percentCholestrol": 23,
            "sugar": 3,
            "fiber": 7,
            "percentDailyFiber": 28,
            "sodium": 350,
            "percentDailySodium": 15,
            "vitaminA": 20,
            "vitaminC": 35,
            "calcium": 10,
            "iron": 30
        },
        "timestamp": "2015-08-20T19:49:14.313"
    },
    {
        "id": 356,
        "plu": 356,
        "groupId": 355,
        "name": "Bison Hash M",
        "displayName": "Bison Quinoa Hash",
        "description": "Bison Hash M",
        "longDescription": "Lean ground bison, organic red quinoa, organic brown rice, smashed kidney beans, red onions, and grated cheddar cheese.",
        "imageUrl": "https://snapkitchendevelopment.azurewebsites.net/api/product/355/image",
        "imageTimestamp": "2014-12-01T07:42:00.437",
        "tags": [
            "Gluten Free",
            "Sodium Conscious"
        ],
        "price": 9.25,
        "categoryId": 10003,
        "category": "Lunch",
        "isIngredient": false,
        "ingredients": [
            "Ground Bison",
            "Organic Red Quinoa",
            "Red Kidney Bean",
            "Organic Brown Rice",
            "White Onion",
            "Green & Red Bell Peppers",
            "Red Onion",
            "Reduced Fat Cheddar Cheese",
            "Green Onion",
            "Paprika",
            "Sea Salt",
            "Ground Black Pepper",
            "Cayenne",
            "Cumin"
        ],
        "isActive": true,
        "caloriecount": 400,
        "recipe": "",
        "size": "Medium",
        "nutrition": {
            "servingsize": "306.93g",
            "servingsPerContainer": "1",
            "kcals": 400,
            "caloriesFromFat": 110,
            "protein": 39,
            "carbs": 34,
            "percentDailyCarbs": 11,
            "fats": 12,
            "percentDailyFat": 18,
            "satfat": 5,
            "percentDailySatFat": 25,
            "cholestrol": 85,
            "percentCholestrol": 28,
            "sugar": 4,
            "fiber": 8,
            "percentDailyFiber": 32,
            "sodium": 420,
            "percentDailySodium": 18,
            "vitaminA": 25,
            "vitaminC": 50,
            "calcium": 10,
            "iron": 35
        },
        "timestamp": "2015-08-21T11:04:18.46"
    },
    {
        "id": 357,
        "plu": 357,
        "groupId": 355,
        "name": "Bison Hash L",
        "displayName": "Bison Quinoa Hash",
        "description": "Bison Hash L",
        "longDescription": "Lean ground bison, organic red quinoa, organic brown rice, smashed kidney beans, red onions, and grated cheddar cheese.",
        "imageUrl": "https://snapkitchendevelopment.azurewebsites.net/api/product/355/image",
        "imageTimestamp": "2014-12-01T07:42:00.437",
        "tags": [
            "Gluten Free"
        ],
        "price": 13.5,
        "categoryId": 10003,
        "category": "Lunch",
        "isIngredient": false,
        "ingredients": [
            "Ground Bison",
            "Organic Red Quinoa",
            "Red Kidney Bean",
            "Organic Brown Rice",
            "White Onion",
            "Green & Red Bell Peppers",
            "Red Onion",
            "Reduced Fat Cheddar Cheese",
            "Green Onion",
            "Paprika",
            "Sea Salt",
            "Ground Black Pepper",
            "Cayenne",
            "Cumin"
        ],
        "isActive": true,
        "caloriecount": 620,
        "recipe": "",
        "size": "Large",
        "nutrition": {
            "servingsize": "471.29g",
            "servingsPerContainer": "1",
            "kcals": 620,
            "caloriesFromFat": 170,
            "protein": 60,
            "carbs": 53,
            "percentDailyCarbs": 18,
            "fats": 19,
            "percentDailyFat": 29,
            "satfat": 8,
            "percentDailySatFat": 40,
            "cholestrol": 130,
            "percentCholestrol": 43,
            "sugar": 6,
            "fiber": 12,
            "percentDailyFiber": 48,
            "sodium": 660,
            "percentDailySodium": 28,
            "vitaminA": 40,
            "vitaminC": 80,
            "calcium": 20,
            "iron": 60
        },
        "timestamp": "2015-08-21T11:04:18.487"
    }

]

List products at location

GET /location/2/products

Expected Success Response

200 OK

[
    {
        "id": 355,
        "plu": 355,
        "location": 2,
        "price": 8.49,
        "quantity": -2,
        "taxRatePickup": 8.25,
        "warningThreshold": 5,
        "displayThreshold": 3,
        "timestamp": "2015-08-20T19:00:15.723"
    },
    {
        "id": 356,
        "plu": 356,
        "location": 2,
        "price": 10.99,
        "quantity": -3,
        "taxRatePickup": 8.25,
        "warningThreshold": 5,
        "displayThreshold": 3,
        "timestamp": "2015-08-20T19:00:15.7"
    },
    {
        "id": 357,
        "plu": 357,
        "location": 2,
        "price": 14.99,
        "quantity": 0,
        "taxRatePickup": 8.25,
        "warningThreshold": 5,
        "displayThreshold": 3,
        "timestamp": "2015-08-20T18:59:33.003"
    }
]

Get loyalty account by phone

GET /loyalty-account/phone/5129444222

Expected Success Response

200 OK

{
    "id": 356917,
    "memberCardNumber": 40000010,
    "points": 0,
    "balance": 0,
    "groupid": 0,
    "email": "uncletammy@gmail.com",
    "phone": "5129444222"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment