libindic / Silpa-Flask

SILPA rewritten using Flask Microframework
http://silpa.org.in
17 stars 19 forks source link

Implement REST API #16

Open jishnu7 opened 10 years ago

jishnu7 commented 10 years ago

We should have a REST (or REST like) api for the ease of API usage in other languages. Existing JSON-RPC, need to be present to allow backward compatibility.

I propose an API similar to what twitter has

Sample API calls:

POST api.silpa.org.in/payyans/ASCII2Unicode
Paramets: text, font
Response: JSON data

POST api.silpa.org.in/payyans/Unicode2ASCII
Paramets: text, font
Response: JSON data

Generic:

GET/POST (http://api.silpa.org.in/module/function_name or http://silpa.org.in/api/module/function_name)
Parameters: function parameters
Response: JSON encoded return value from function

shashisp commented 10 years ago

so, for Silpa-Flask REST API's we need to write all silpa modules as flask views and using Flask-RESTful , we can convert output in to json, is that a right approach?

jishnu7 commented 10 years ago

Since we already have a module structure and everything in place, I think we don't need to use an external library like Restful.

Regards, Jishnu

http://blog.thecodecracker.com http://twitter.com/jishnu7 On Mar 2, 2014 4:27 AM, "Shashi Kumar P" notifications@github.com wrote:

so, for Silpa-Flask REST API's we need to write all silpa modules as flask views and using Flask-RESTful , we can convert output in to json, is that a right approach?

Reply to this email directly or view it on GitHubhttps://github.com/Project-SILPA/Silpa-Flask/issues/16#issuecomment-36439635 .

copyninja commented 10 years ago

I agree with @jishnu7 We might not need external library like Flask-Restful, we are not looking for pure REST api instead we need some http api's in the format described by @jishnu7 above

aashay201297 commented 7 years ago

What is the current status on this? If nobody is working, I would like to work on this. Please respond.

copyninja commented 7 years ago

I think work is partially done by @balasankarc or @jerinphilip . You can work on this if you are interested. @jerinphilip @balasankarc Please provide what is done and what is pending status.

balasankarc commented 7 years ago

@aashay201297 In the current situation, this requires namespacing of modules to be completed, which is only partially done. I'll check which all modules are completed and update (or you can check the modules' and see if namespacing is implemented).

@jerinphilip may comment on how to proceed after that, as he did the initial work on REST API last year.

aashay201297 commented 7 years ago

@balasankarc i will try to find out about the implemented namespacing but it would be good if you or @jerinphilip can give more details as you have already worked on this issue. Thanks