Skip to content
Aaron Tribou edited this page Aug 11, 2015 · 4 revisions

iQueue API

Contents

Guest Status

Possible options:

new
notified
called
completed
cancelled

Create Guest

curl -X POST https://api.example.com/guests     \
     -H 'Content-Type: application/json'        \
     -d '{ "guest": { "name": "John Smith", "phone": "5551234567", "estimate": 15 } }'
Response
Status: 201
{
  "guest": {
    "id": 1,
    "estimate": 15,
    "name": "John Smith",
    "phone": "5551234567",
    "status": "new",
    "createdAt": "2014-11-14T16:29:21Z",
    "updatedAt": "2014-11-14T16:29:21Z",
    "estimatedAt": "2014-11-14T16:29:21Z"
  }
}

Get One Guest

curl -X GET https://api.example.com/guests/1     \
     -H 'Content-Type: application/json'
Response
Status: 200
{
  "guest": {
    "id": 1,
    "estimate": 15,
    "name": "John Smith",
    "phone": "5551234567",
    "status": "new",
    "createdAt": "2014-11-14T16:29:21Z",
    "updatedAt": "2014-11-14T16:29:21Z",
    "estimatedAt": "2014-11-14T16:29:21Z"
  }
}

Get Current Guests

curl -X GET https://api.example.com/guests     \
     -H 'Content-Type: application/json'
Response
Status: 200
{
  "guests": [
    {
      "id": 1,
      "estimate": 15,
      "name": "John Smith",
      "phone": "5551234567",
      "status": "new",
      "createdAt": "2014-11-14T16:29:21Z",
      "updatedAt": "2014-11-14T16:29:21Z",
      "estimatedAt": "2014-11-14T16:29:21Z"
    }, {
      "id": 2,
      "estimate": 15,
      "name": "Adam Smith",
      "phone": "5551235555",
      "status": "notified",
      "createdAt": "2014-11-14T16:29:21Z",
      "updatedAt": "2014-11-14T16:29:21Z",
      "estimatedAt": "2014-11-14T16:29:21Z"
    }
  ]
}

Notify Guest

curl -X PATCH https://api.example.com/guests/1/notify     \
     -H 'Content-Type: application/json'
Response
Status: 200
{
  "guest": {
    "id": 1,
    "estimate": 15,
    "name": "John Smith",
    "phone": "5551234567",
    "status": "notified",
    "createdAt": "2014-11-14T16:29:21Z",
    "updatedAt": "2014-11-14T16:29:21Z",
    "estimatedAt": "2014-11-14T16:29:21Z"
  }
}

Complete Guest

curl -X PATCH https://api.example.com/guests/1/complete     \
     -H 'Content-Type: application/json'
Response
Status: 200
{
  "guest": {
    "id": 1,
    "estimate": 15,
    "name": "John Smith",
    "phone": "5551234567",
    "status": "completed",
    "createdAt": "2014-11-14T16:29:21Z",
    "updatedAt": "2014-11-14T16:29:21Z",
    "estimatedAt": "2014-11-14T16:29:21Z"
  }
}

Update Estimate

curl -X PATCH https://api.example.com/guests/1/estimate     \
     -H 'Content-Type: application/json'        \
     -d '{ "guest": { "estimate": 20 } }'
Response
Status: 200
{
  "guest": {
    "id": 1,
    "estimate": 20,
    "name": "John Smith",
    "phone": "5551234567",
    "status": "completed",
    "createdAt": "2014-11-14T16:29:21Z",
    "updatedAt": "2014-11-14T16:45:43Z",
    "estimatedAt": "2014-11-14T16:45:43Z"
  }
}