API Module : Generating Token / Extending Routes
kiltedup - 8 months ago
Hi, I have started to play around with the API Module. Stuck with a couple of things. Generating a token: I followed some comments on Slack re using 'tinker' to generate a token, however now looking to see how to do it properly. Assume the missing image in github holds they key to what needs to be done. Anyone know how to generate a token? Extending routes: I would like to add my own routes. Primarily because I have a stream that has a bunch of relationship fields so rather than just seeing the id of in the API entry response, would like to return a custom response for certain routes. Struggling to find documentation on how to extend the routes - probably not just for API module but any core module in general. Any cunning tips out there?
ryanthompson - 8 months ago
Ah I remember something here :-/
So if you route
foo/bar the resulting route will be
api/foo/bar so if you are prefixing with
api you are looking at
api/api. I think that's what's going on.
I should pry remove that? Idk.. thoughts? It's quite misleading and pretty intrusive. Let me know what you think and I can remove it right now.