Skip to content

Instantly share code, notes, and snippets.

@eshea
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eshea/9913049 to your computer and use it in GitHub Desktop.
Save eshea/9913049 to your computer and use it in GitHub Desktop.
DSG Locker API

DSG Locker API

Get Locker Campaign

  • Finds a Locker Campaign by slug, includes all attached curated lockers
GET http://www.dsg.com/giftlocker/api/v1/locker_campaigns/<campaign_slug>

Example:

http://www.dsg.com/giftlocker/api/v1/locker_campaigns/pittsburgh-marathon

Get Curated Locker

  • Finds a Curated Locker by slug.
  • Includes all items by PID and model.
GET http://www.dsg.com/giftlocker/api/v1/curated_lockers/<curated_locker_slug>

Example:

http://www.dsg.com/giftlocker/api/v1/curated_lockers/2014-resolutions

Create Anonymous Locker (non-authenticated user)

  • Parameters
    • Name (optional)
  • Returns {"id": 1234, "name": "My Locker"}
GET http://www.dsg.com/giftlocker/api/v1/anon_lockers/add

Get Anonymous Locker (non-authenticated user)

  • Parameters
  • Returns {"id": 1234, "name": "My Locker", "items": [ << array is as returned from {locker_id}/items >> ] }
GET http://www.dsg.com/giftlocker/api/v1/anon_lockers/<locker_id>

Add Anonymous Locker Item (non-authenticated user)

  • Parameters
    • { pid: "30237046", model: "17674248", quantity: 1 }
  • Returns
    • { id: 123, anon_locker_id: 1, pid: "30237046", model: "17674248", quantity: 1 }
GET http://www.dsg.com/giftlocker/api/v1/anon_lockers/<locker_id>/items/add

Update Anonymous Locker Item (non-authenticated user)

  • Parameters
    • { pid: "30237046", model: "17674248", quantity: 1 }
  • Returns
    • { id: 123, anon_locker_id: 1, pid: "30237046", model: "17674248", quantity: 1 }
GET http://www.dsg.com/giftlocker/api/v1/anon_lockers/<locker_id>/items/<item_id>/update

Remove Anonymous Locker Item (non-authenticated user)

  • Parameters
  • Returns
    • Status 200 on success
GET http://www.dsg.com/giftlocker/api/v1/anon_lockers/<locker_id>/items/<item_id>/remove

Clear Anonymous Locker Items (non-authenticated user)

  • Parameters
  • Returns
    • Status 200 on success
GET http://www.dsg.com/giftlocker/api/v1/anon_lockers/<locker_id>/items/clear

Generate Anonymous Locker Action Link

Generates a shortlink or QR code for buying an anonymous locker or merging into a new authenticated gift locker

  • Parameters
    • action_type: 'buy' or 'merge'
    • link_type: 'qr' or 'kiosk'
  • Returns
    • Action URL
GET http://www.dsg.com/giftlocker/api/v1/anon_lockers/<locker_id>/create_link

Move To User Locker

CURRENTLY UNUSED

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment