A
A
Artem Nanavov2020-01-09 10:05:59
Vue.js
Artem Nanavov, 2020-01-09 10:05:59

How to set the path to the photo through api?

I have api - gallery.dev.webant.ru/api/photos and there is json 5e16d05a5709c322229827.png
and I have a question how to write the path to the photo? i wrote gallery.dev.webant.ru/api/photos/data/image/contentUrl - error,
gallery.dev.webant.ru/api/photos/data/image.contentUrl - error
error - Cannot find modul

Answer the question

In order to leave comments, you need to log in

1 answer(s)
L
litvinenkow, 2020-01-10
@litvinenkow

everything is simple, we have an image, for example ID 123
request gallery.dev.webant.ru/api/photos/123
at the output

{
  "id": 123,
  "name": "string",
  "description": "string",
  "new": true,
  "popular": true,
  "image": {
    "id": 260,
    "contentUrl": "5c6bc632bd4b5807895102.jpeg"
  }
}

Accordingly, you need to request a media object with ID 260
request gallery.dev.webant.ru/api/media_objects/260
in the json response - base64 encoded file 5c6bc632bd4b5807895102.jpeg

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question