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

read-only API access #538

Closed
erstwhile opened this issue Mar 4, 2012 · 4 comments
Closed

read-only API access #538

erstwhile opened this issue Mar 4, 2012 · 4 comments

Comments

@erstwhile
Copy link

I'd like to be able to embed content from a pad into an html page hosted on a remote domain - essentially use the jquery api to turn etherpad-lite into a platform for serving widgets. I don't want to expose the pad name in the code or ajax request - so I'd like to be able to do API methods like /getText or /getHTML but they would /getReadOnlyText /getReadOnlyHtml or have a "readOnly" flag in the getText and getHTML requests, so I can pass the read-only ID to a pad and retrieve the text or html thru cross-domain ajax.

@yadutaf
Copy link

yadutaf commented Mar 4, 2012

Maybe you can simply do a request on the RO link and then extract the body ?

For instance, http://notes.jtlebi.fr/p/test becomes http://notes.jtlebi.fr/ro/r.x8JVADIpJqVO2btN

@JohnMcLear
Copy link
Member

https://github.com/Pita/etherpad-lite/wiki/HTTP-API

getReadOnlyID(padID) returns the read only link of a pad

Example returns:

{code: 0, message:"ok", data: {readOnlyID: "r.s8oes9dhwrvt0zif"}}
{code: 1, message:"padID does not exist", data: null}

@erstwhile
Copy link
Author

johnyma22 - what I want is the inverse of what you posted. I want to say

/api/1/getFromReadOnlyId?readOnlyID=r.oG8HIIx43VIiRqmc

and get back

{code: 0, message:"ok", data: {padID: "test"}}

either that or some way to pass a readOnlyID through the API and get back the text of that pad, without having to expose the padID in the API call.

@JohnMcLear JohnMcLear reopened this Mar 4, 2012
@marcelklehr
Copy link
Contributor

closing in favor of #321

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

4 participants