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

How to access the REST API? #385

Closed
axtscz opened this issue Aug 5, 2015 · 8 comments
Closed

How to access the REST API? #385

axtscz opened this issue Aug 5, 2015 · 8 comments
Labels
core feature request Feature request REST API API standard up-for-grabs Not assigned yet wontfix This will not be worked on

Comments

@axtscz
Copy link

axtscz commented Aug 5, 2015

How do I access the REST API? Let us say that I have UF installed at HTTP://mywebsite.com/userfrosting.

@alexweissman
Copy link
Member

Could you be more specific? What sort of data do you want to access?

@axtscz
Copy link
Author

axtscz commented Aug 5, 2015

How do I return a list of users or a specific users? I'm trying to call it from an AJAX function.

@alexweissman
Copy link
Member

As structured data? We discontinued the JSON API in 0.3.0, but it shouldn't be too hard to implement. Basically, you just need to add a few controller routes (e.g. api/user/u/:user_id), and then use the model (UserLoader::fetch($user_id)) along with json_encode. Oh, and of course, be sure to check for authorization before dispensing that data ;-)

@axtscz
Copy link
Author

axtscz commented Aug 5, 2015

Thanks, Alex. Do you have any sort of REST API in the 0.3.0 release?

@alexweissman
Copy link
Member

Well, the route structure as a whole is more or less RESTful, see http://www.userfrosting.com/components/#url-structure. It doesn't have a built-in API for structured data, but like I said, that is pretty easy to implement.

@alexweissman
Copy link
Member

We've been getting a lot of requests for a true REST (so, stateless, sessionless?) API in chat. So, maybe this is something we should consider implementing in a future version.

@harding13
Copy link

Could be an answer? https://github.com/entomb/slim-json-api

@stale
Copy link

stale bot commented Apr 24, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix This will not be worked on label Apr 24, 2019
@stale stale bot closed this as completed May 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core feature request Feature request REST API API standard up-for-grabs Not assigned yet wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

3 participants