Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Access avatars and photos through API #5861

Open
akn101 opened this issue Jan 9, 2022 · 4 comments
Open

Access avatars and photos through API #5861

akn101 opened this issue Jan 9, 2022 · 4 comments

Comments

@akn101
Copy link
Contributor

akn101 commented Jan 9, 2022

Is your feature request related to a problem? Please describe.
The API is already able to provide links and information about photos related to a contact and also provide a link to their avatar, yet it doesn't seem possible yet to access these links and download the images through the API.

Describe the solution you'd like
I'd like to be able to download avatars and images through the API.
So far when accessing an image (i.e through https://monica.instance/store/photos/photo.jpeg) with a Bearer token, you're redirected to the login page. I'd like to have access to the image with a Bearer token.

@justjulian
Copy link

Same issue here. Trying to use https://www.davx5.com/ to sync my contacts. However, the images can't be downloaded due to the redirect to the login page.

@sebastian-c
Copy link

There' already an API endpoint to upload an avatar (PUT /contacts/{contact}/avatar) as detailed in an issue here.

It would make sense to add a GET option to that endpoint.

I think a base64 representation of the image would be the easiest way to obtain the information.

@sebastian-c
Copy link

This has been a bit of a showstopper for one of my projects to create a relationship graph between my contacts and have pictures on all of the nodes. One of the more requested features of Monica is the creation of such a graph. This feature would ease the pressure by allowing third party developers to do it.

@ramon-dejesus
Copy link

Same issue found for a project I'm working on, in which if I try to pull an image to which I have the url as provided by the rest call it doesnt load the image as it does not identify my call as an authenticated one.
Interestingly if I pass Network Headers to my image before I attempt to pull it it works. Specifically if I set the following cookie header before attempting to load the image:

headers: {
'Cookie': 'remember_web_'+(USER_WEB_LOGIN_ID_SESSION)+ '=' + (USER_WEB_LOGIN_TOKEN),
}

Is there away to get these values through REST, or a better Cookie Name and Value pair to use when trying to get images after a rest pull of the urls?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants