#1
I have been trying mu hands on Trongate v2 and I love it. I wanted to try to build some basic API endpoints with it and it has not been successful. I have tried searching through the docs but I can not find resources on how to build APIs.
#2
In Trongate v1, the API Explorer was an incredible built-in tool. I recall it being handled by an Api.php file within the engine folder.

I just checked and it looks like it's not there anymore in v2. It might have been stripped from the framework along with other modules that used to come pre-installed in Trongate v1.

Does that mean we have to implement this functionality manually or will there be an official API module based on the v1 API Explorer later on?

Any insight into the roadmap for API tools in v2 would be greatly appreciated!
#3
I was actually very happy with the API Explorer when I built it. Indeed, it was arguably the framework's best feature. At the time, I was hoping it might help attract more JavaScript developers to the framework and make it easier for people to experiment with APIs directly from within Trongate.

In practice, though, it didn’t seem to gain much traction. I don’t recall seeing any tutorials or reviews around it, and there wasn’t much feedback from the community. Because of that, it didn’t make the cut for v2 and was removed along with several other built-in modules that were included in v1.

That said, the idea certainly isn’t gone for good. If there's a demand then it could very well return as a separate, downloadable module.

And of course, if someone in the community ever feels inspired to build or revive something along those lines, I’d be very happy to see it.
#4
Im creating an API for my current main framework and am creating a subdomain endpoint to keep things separate (main system not in trongate), I really don't want to use lumen which i have used before, Is there any pointers I can get from past work, Im curretly doing stuff like this:-


The valdate_token method gets a valid trongate token from the header
any help is appreciated
Keith
#5
Hello Keith,

Your approach is spot on for handling manual endpoints in Trongate v2. Since the API Explorer was removed to keep the core lightweight, this "Controller-first" method is exactly how it should be done.

Before validating the token I would also make sure that the request type is correct:
#6
I have built an api module. If you want it I can post it here for you to try.
Dan
#7
Hi Dan,
Would you mind sharing your module with all of us?
I had a go at something like it after v2 was published as I was working on my kickstart module. That module was half-baked so I had to retract it.
I am very eager to see how you managed and I hope to learn from it.
Thank you, kind regards
#8
Hello Koolmees,

Please send an email to [email protected] and I will send it to you

Dan
#9
Here's a video that popped up on my stream on the topic:

https://youtu.be/Z3uFzUCedpU?si=o5JNZ2KaPkTbfnQS

Dan, you should make a YT tutorial on it 👍