The current version of the API is v1. This is also the default version if no version is specified. A
specific version should be specified using the x-img-api-version
HTTP header.
As new versions of the API are released, the default version will change. So it is recommended to specify the
desired version using the x-img-api-version
HTTP header.
All API access is over HTTPS. The base URL for all request is http://img.local:2001
.
Unsecure requests made to http://
(note the missing s
) will be dropped. These unsecure
requests will not be redirected to https://
.
All dates are represented in ISO 8601 format e.g. 2011-07-10T18:35:16-0800
.
Requests are authorized using your API key. API keys can be specified in the following ways:
api-key
e.g. http://img.local:2001?api-key=${your-api-key}
img
x-img-api-key
Every image has an ID assigned by Img. These IDs are 16 character strings made up of lowercase ASCII letters and digits e.g. 7hci0z8txgvzkgkl
.
In the future, assigned IDs may be as long as 48 characters.
You can optionally assign an image a custom ID. Custom IDs must be unique across all images in your account and must contain only
-
(minus sign/hyphen)_
(underscore)Custom IDs can be up to 64 characters in length.
There are three considerations when creating images:
Uploading images can take a long time. Because of this, we offer an option where one can begin serving images even before an image is completely uploaded (of course, the request will block until the image is completely uploaded). To do this, one must
/image/new-id
will return an assigned ID. the second endpoint /image/new-id/{custom-id}
will allow one to use a custom ID.
{id}
or {custom-id}
must be an pre-allocated ID received from one of the GET /image/new-id
or GET /image/new-id
endpoints.Images are served using a URL generated from the image's ID (assigned or custom). To generate an image URL, use the following patterns
https://img.local:2000/image/{id}
http://img.local:2000/image/{id}
https://img.local:2000/image/{domain}/{custom-id}
http://img.local:2000/image/{domain}/{custom-id}
Name | Required? | Type | Description |
---|---|---|---|
url | Yes | String | Publicly accessible URL of image. |
my-id | No | String | User specified ID |