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

Can't remove header image from profile #345

Open
jeancf opened this issue Jun 16, 2023 · 6 comments
Open

Can't remove header image from profile #345

jeancf opened this issue Jun 16, 2023 · 6 comments

Comments

@jeancf
Copy link

jeancf commented Jun 16, 2023

I can't figure out out to remove the header image from a profile. I could not find anything in the documentation about it.

I tried using

Mastodon.account_update_credentials(header=None)

but it does nothing (BTW, ChatGPT is positive that this is the way to do it).

I also tried

Mastodon.account_update_credentials(header="")

But this throws an exception "Could not determine mime type or data passed directly without mime type"

@halcy
Copy link
Owner

halcy commented Jun 16, 2023

Honestly: Really good question. I don't know offhand how to do it. I'm at work right now, but I'll have a look at this once I get back home. Could be an oversight on my part, or an oversight on the mastodon side. The web UI uses an internal endpoint to delete the header that is not part of the API proper, POST-ing to "/settings/profile/pictures/header", the API docs for https://docs.joinmastodon.org/methods/accounts/#update_credentials don't specify a value that you might send as the new header to delete it.

I will mess around a bit later today to see if I can figure it out. Maybe it is possible to send a null value as multipart/form-data and that will make Mastodon do the intended thing, in which case I'd have to update the method to allow that type of thing, probably with a new parameter like "delete_header" / "delete_avatar".

@jeancf
Copy link
Author

jeancf commented Jun 27, 2023

Hi there. Any luck with your attempt?

@halcy
Copy link
Owner

halcy commented Jun 28, 2023

Hey - sorry, I got distracted working on other parts of the codebase, and now I am busy with working on something else entirely. I will look at this again when I get back to trying to build the next release of Mastodon.py, but probably it will take at least a month before i get back to this.

Anyone else is welcome to have a look in the meantime, obviously.

@codl
Copy link
Contributor

codl commented Jun 28, 2023

This isn't currently possible, mastodon bug: mastodon/mastodon#18921

@codl
Copy link
Contributor

codl commented Sep 22, 2023

mastodon 4.2.0 now has DELETE /api/v1/profile/avatar and DELETE /api/v1/profile/header
https://docs.joinmastodon.org/methods/profile/

@jeancf
Copy link
Author

jeancf commented Sep 24, 2023

Excellent news! Thanks a lot.

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

No branches or pull requests

3 participants