Open tareshsethi opened 3 years ago
@tareshsethi hi, do you mean when using private projects in readthedocs.com? If you are using readthedocs.org everything is public, so you can download files without a token.
@stsewd thanks! Yes, for private projects on readthedocs.com.
More generally, I was hoping to create an oauth 2.0 client for private projects in readthedocs.com so that I could programmatically download the html zip on every build on behalf of a user (for example: gdrive has https://developers.google.com/identity/protocols/oauth2 and confluence has https://developer.atlassian.com/cloud/confluence/oauth-2-3lo-apps/). It seems like there's no way of doing so yet for readthedocs.com with apiv3. If I could download with a personal access token, that would suffice for now. Let me know if there's any way to authenticate as a user and download the htmlzip
Quick follow up question to that - will every project (both public on readthedocs.org and private on readthedocs.com) have downloadable html zips? Can a company or host choose to disable the download feature? If so, would there be a way to access the htmlzip in some other way?
@tareshsethi htmlzips are optional, they aren't included by default when using a v2 config file https://docs.readthedocs.io/en/stable/config-file/v2.html#formats. You can check if a project has a zip file with the API v3 https://docs.readthedocs.io/en/stable/api/v3.html#version-detail (downloads).
Since downloads are served from the same domain as docs, you can use a sharing token https://docs.readthedocs.io/en/stable/commercial/sharing.html#http-authorization-header. A sharing token is a per-project token, so a user would need to create one for each project.
But yeah, I think would be useful to have this feature under API v3.
that helps a ton - thanks so much!
Is there a way to programmatically download an htmlzip of a version, say given the personal access token (apiv3)? Hoping to do something like this in python ...
Thanks!