Add an image to a dataset

This API call adds a reference image to a dataset and associates it with a value

URL http://api.mobileacuity.net/v1/data//datasets//images?value=
Message body contains the reference image (colour jpeg format)
Header "Content-Type: image/jpeg"
The value associated with the image is passed in the “value” parameter URL encoded as
appropriate
On success returns a HTTP 200 with the unique id for this reference image in the body
On failure returns a HTTP 400

Example use of the API is provided by the following curl command. Brave.jpg is the reference
image, “ma” is the client, “test” is the dataset, “brave” is the value. “1” is the returned ID.

$ curl -H "Content-Type: image/jpeg" --data-binary @./Brave.jpghttp://api.mobileacuity.net/v1/data/ma/datasets/test/images?value=brave
URL http://api.mobileacuity.net/v1/data/ma/datasets/test/images?value=brave
1

Note that the API does not rescale the reference image. It is recommended that the largest dimension of the reference image is between 640 and 1280 pixels. The system will fail with any image with more than 1,300,000 total pixels.

List the images in the dataset

This API call lists the ids of all reference images in a dataset

HTTP GET
URL http://api.mobileacuity.net/v1/data//datasets//images
Message body is empty
No required headers
On success returns a HTTP 200 with a text/csv list of ids for the reference images in the dataset
On failure returns a HTTP 400

Example use of the API is provided by the following curl command. “ma” is the client and “test” is the dataset. “1” is the ID of the single image in the dataset.

$ curl http://api.mobileacuity.net/v1/data/ma/datasets/test/images
1

Remove an image from a dataset

This API call removes a reference image from a dataset

HTTP DELETE
URL http://api.mobileacuity.net/v1/data//datasets//images/
Message body is empty
No required headers
The id of the reference image to remove is the last element of the URL
On success returns HTTP 200 with “OK” in the body
On failure returns a HTTP 400

Example use of the API is provided by the following curl command. “ma” is the client, “test” is the dataset and “1” is the ID of the reference image to remove

$ curl –X DELETE
URL http://api.mobileacuity.net/v1/data/ma/datasets/test/images/1
OK