GET /items/:id/images
Retrieve the images for a GitFax item

Examples

curl -X GET -H "Authorization: XXXXX" "https://api.gitfax.com/items/24/images"

Response:

{
  "items": [
    {
      "id": 1988,
      "created_at": "2017-07-07T05:27:18.092Z",
      "thumb": "https://api.gitfax.com/images/files/000/001/987/thumb/C0JuVkTUAAAT9J3.jpg?1499405225",
      "small": "https://api.gitfax.com/images/files/000/001/987/small/C0JuVkTUAAAT9J3.jpg?1499405225",
      "medium": "https://api.gitfax.com/images/files/000/001/987/medium/C0JuVkTUAAAT9J3.jpg?1499405225",
      "large": "https://api.gitfax.com/images/files/000/001/987/large/C0JuVkTUAAAT9J3.jpg?1499405225",
      "original": "https://api.gitfax.com/images/files/000/001/987/original/C0JuVkTUAAAT9J3.jpg?1499405225",
      "role": "front"
    },
    {
      "id": 1987,
      "created_at": "2017-07-07T05:27:06.703Z",
      "thumb": "https://api.gitfax.com/images/files/000/001/987/thumb/C0JuVkTUAAAT9J3.jpg?1499405225",
      "small": "https://api.gitfax.com/images/files/000/001/987/small/C0JuVkTUAAAT9J3.jpg?1499405225",
      "medium": "https://api.gitfax.com/images/files/000/001/987/medium/C0JuVkTUAAAT9J3.jpg?1499405225",
      "large": "https://api.gitfax.com/images/files/000/001/987/large/C0JuVkTUAAAT9J3.jpg?1499405225",
      "original": "https://api.gitfax.com/images/files/000/001/987/original/C0JuVkTUAAAT9J3.jpg?1499405225",
      "role": null
    }
  ]
}
      

GET /items/:id/images/:image_id
Retrieve an individual image from a GitFax item

Examples

curl -X GET -H "Authorization: XXXXX" "https://api.gitfax.com/items/24/images/121"

// Returns image JSON
      

POST /items/:id/images
Add a PNG or JPG image to a GitFax item

Examples

curl -X POST -F "role=front" -F "file=@/Users/bengotow/C0JuVkTUAAAT9J3.jpg" -H "Authorization: XXXXX" "https://api.gitfax.com/items/24/images"

Unlike other GitFax API endpoints, this endpoint requires a form/multipart-data POST.

Response:

{
  "id": 1987,
  "created_at": "2017-07-07T05:27:06.703Z",
  "thumb": "https://api.gitfax.com/images/files/000/001/987/thumb/C0JuVkTUAAAT9J3.jpg?1499405225",
  "small": "https://api.gitfax.com/images/files/000/001/987/small/C0JuVkTUAAAT9J3.jpg?1499405225",
  "medium": "https://api.gitfax.com/images/files/000/001/987/medium/C0JuVkTUAAAT9J3.jpg?1499405225",
  "large": "https://api.gitfax.com/images/files/000/001/987/large/C0JuVkTUAAAT9J3.jpg?1499405225",
  "original": "https://api.gitfax.com/images/files/000/001/987/original/C0JuVkTUAAAT9J3.jpg?1499405225",
  "role": null
}
      

Params

Param name Description
role
optional

Optional: Pass `front` or `back` to use this image as the official front or back photo for the instrument.


Value:

Must be String

file
required

A PNG or JPG and less than 5MB in size


Value:

Must be File


DELETE /items/:id/images/:image_id
Remove an image from a GitFax item

Examples

curl -X DELETE -H "Authorization: XXXXX" "https://api.gitfax.com/items/24/images/121"

// Returns status code 204