Order Ahead .: Show a Menu Item Image

API Reference / v15

Show a Menu Item Image

This endpoint redirects the client, using an HTTP 302 response and Location header, to a menu item image of the requested dimensions, if one exists.

Please note that menu item images only exist in a very small subset of menus. All merchants, and associated locations, will have an image, but very few menus have images for each item. A base URL for the request is included in the “Show Menu” endpoint’s response as item[image_url]. The client should add appropriate query parameters.

The following dimensions (width x height) are available at 1x, 1.5x, 2x, and 3x:

  • 420 x 300
  • 320 x 180
  • 133 x 92

Note that an Accept header with the value image/jpg is required for the request.

Request Endpoint

GET /v15/order_ahead/menus/:menu_id/items/:item_id/image?density=1&height=300&width=420

Authorization

No authorization is required for this request.

Query Parameters

Name Type Description
density Integer, decimal The desired pixel density ratio.
height Integer The desired image height in pixels.
width Integer The desired image width in pixels.

cURL Example

curl -X GET -H "Accept: image/jpeg" "https://api.thelevelup.com/v15/order_ahead/menus/23916/items/2576694/image?density=1&height=300&width=420"

Response

If an image with the requested dimensions exists, the server will respond with HTTP 302 Found and a Location header bearing the URL to the image file, e.g.

Location: https://s3.amazonaws.com/levelup-order-ahead-menus-production/98f9674aad29300660d32177a32c5ba969f4b5fb.jpg?1477725544

Example Image

Rice Bowl

Errors

HTTP/1.1 error 404 Not Found - No image with that ID exists