tumblr / docs

Tumblr's public platform documentation.
Apache License 2.0
109 stars 27 forks source link

How to create/draft posts from the mega editor? #74

Open blackjackkent opened 2 years ago

blackjackkent commented 2 years ago

Hello!

I've been asked to try my hand at cleaning up an old abandoned extension which allowed users to create or draft posts from an interface that extended the mega-editor/mass posts editor. (It stopped working after some of the Tumblr updates that have come down the pike.)

The issue I'm running into is that whatever strategy the original author was using to submit posts is no longer working, but it doesn't appear that the mega editor (yet, at least) supports the tumblr.apiFetch functionality described at https://github.com/tumblr/docs/blob/master/web-platform.md#apifetch.

Is there a recommended solution for extension developers wanting to interact with the API from the mega editor? I would prefer not to throw out the extension's code wholesale and would appreciate any advice! :)

(Happy to provide further info if it would help!)

nightpool commented 2 years ago

apiFetch is part of the new React codebase, while as I understand it the mega editor is still on the old Backbone codebase, no? so any of the old XKit SVC techniques should still work, but apiFetch won't.

cyle commented 2 years ago

@nightpool is correct that the web platform docs are referencing pages that are a part of the "new web experience" which is our way of saying that they're powered by React instead of our older web frontend. The Mass Post Editor / mega editor is not powered by React yet, so those helper functions won't work there, and we don't support a public interface in the legacy web frontend.

My suggestion would be to write an extension with its own application credentials that leverages the API directly instead of going "through" apiFetch, if possible.

AprilSylph commented 2 years ago

@cyle Is there even a way to mass-edit posts via the v2 API? The Mass Post Editor uses its own endpoints which I don't see any equivalent for. Naturally, everything the mega editor does can be achieved per post with individual v2 API calls, but the mega editor can reduce what would be 100 requests down to just 1.

cyle commented 2 years ago

Is there even a way to mass-edit posts via the v2 API?

There isn't right now, no. We'd have to build out these new API endpoints when we tackle migrating the Mass Post Editor to React. I don't have an ETA for that work, unfortunately.