I have a Google Docs document which contains one image. I found images's objectId
as stated here https://developers.google.com/docs/api/reference/rest/v1/InlineObject but I can't understand how to get an url to that image.
I tried searching for this objectId
in Drive but it returns File not found.
Any ideas ?
Update
As noted by @Tanaike the image info is contained in the result.inlineObjects
and
not directly in the paragraph.
If my understanding is correct, how about this answer?
I think that the property of inlineObjectElement
that you are checking is in the paragraph. The information of the inserted images can be seen at the property of inlineObjects
. And the URL can be seen at the property of ImageProperties
.
The endpoint is as follows.
GET https://docs.googleapis.com/v1/documents/{documentId}?fields=inlineObjects
inlineObjects
is used as fields
. You can also use *
as fields
.The URL can be retrieved as follows. It supposes that response
is the returned value from above endpoint.
url = response.inlineObjects["kix.###"].inlineObjectProperties.embeddedObject.imageProperties.sourceUri
kix.###
is inlineObjectId
in your question.https://lh3.google.com/u/0/d/{fileId}=w###-h###
{fileId}
is the file ID of the image. You can retrieve the original file using this file ID.If I misunderstood your question and this was not the result you want, I apologize.