Queue Stats

Request

To get a count of the number of messages in each of your hub queues, make the following request:

GET https://spreeecommerce.com/api/stores/YOUR_STORE_ID/queues

Response

Status: 200 OK
{
  "incoming": 2,
  "archived": 10000,
  "pending": 1,
  "failing": 5,
  "scheduled": 0,
  "parked": 0
}

Incoming Queue

Note that the results returned are limited to 25 per page, you can specify which page to return by passing the page parameter in your request.

Request

To view messages in the incoming queue, make the following request:

GET https://spreeecommerce.com/api/stores/YOUR_STORE_ID/queues/incoming

Response

Status: 201 Created
[
  {
    "id": "52811a8584a8169f7a000002",
    "message": "stock:change",
    "state": "pending",
    "consumer": "",
    "created_at": "2013-11-11T17:57:25Z",
    "completed_at": null,
    "attempt_at": "2013-11-13T15:51:26Z",
    "is_consumer_remote": false,
    "destination_name": "",
    "integration_icon_url": null,
    "locked_at": null,
    "source": null,
    "queue_name": "incoming"
  }
]

Accepted Queue

Note that the results returned are limited to 25 per page, you can specify which page to return by passing the page parameter in your request.

Request

To view messages in the accepted queue, make the following request:

GET https://spreeecommerce.com/api/stores/YOUR_STORE_ID/queues/accepted

Response

Status: 201 Created
[
  {
    "id": "52811a8584a8169f7a000002",
    "message": "stock:change",
    "state": "parked",
    "consumer": "",
    "created_at": "2013-11-11T17:57:25Z",
    "completed_at": null,
    "attempt_at": "2013-11-13T15:51:26Z",
    "is_consumer_remote": false,
    "destination_name": "",
    "integration_icon_url": null,
    "locked_at": null,
    "source": null,
    "queue_name": "accepted"
  }
]

Archived Queue

Note that the results returned are limited to 25 per page, you can specify which page to return by passing the page parameter in your request.

Request

To view messages in the archived queue, make the following request:

GET https://spreeecommerce.com/api/stores/YOUR_STORE_ID/queues/archived

By default, the above request will only return completed messages that are in the archived queue. To return messages that were not completed, set the source parameter when making the request.

Response

Status: 201 Created
[
  {
    "id": "52811a8584a8169f7a000002",
    "message": "stock:change",
    "state": "completed",
    "consumer": "",
    "created_at": "2013-11-11T17:57:25Z",
    "completed_at": null,
    "attempt_at": "2013-11-13T15:51:26Z",
    "is_consumer_remote": false,
    "destination_name": "",
    "integration_icon_url": null,
    "locked_at": null,
    "source": null,
    "queue_name": "archived"
  }
]

Filter Queues

It is possible to list messages in queues that only match certain filters.

You can filter queues by passing one or more of the following attributes as a parameter in the request:

  • message - The message type to filter by, for example order:persist, spree:order:poll, etc.

  • state - The current state of the message. This can be completed, pending, failing, scheduled, never_processed, or parked.

  • start_date - Filter messages created after a date. For example, 2013-11-10T17:17:34+00:00

  • end_date - Filter messages created before a date. For example, 2013-11-10T17:17:34+00:00

  • message_id - The id of the message

  • mapping_id - The id of the mapping

Example

To get all spree:order:poll messaqges from the accepted queue with a state of completed, make the following request:

GET https://spreeecommerce.com/api/stores/YOUR_STORE_ID/queues/accepted
    ?message=spree:order:poll&state=completed
x Spree Conf NYC 2014

Want to learn more about Spree?

Early Bird is 50% Off (Ends 12/31)

Learn More