42

Product support

Get help in the plugin support forum.

Categories

API Generator is plugin to build RESTful APIs. See the demo here https://youtu.be/WketEhx-xSQ

Features

  • Auto generate routes
  • Auto Generate Controller (CRUD)
  • Support relationship restful API

Demo Video

form create data

Requirement

Form

  • API Name : Name of your API module
  • Base Endpoint : Base endpoint of your API, ex : api/v1/modulename
  • Short Description : Describe your API
  • Model : select model that will be created API
  • Custom Condition : Build customer response using JSON modeling

Custom Condition Example

{
    'fillable': 'id,title,content',
    'relation': [{
        'name': 'user',
        'fillable': 'id,first_name'
    }, {
        'name': 'categories',
        'fillable': 'id,name
    }]
}

* please replace single quote with quote

  • Found the plugin useful on 5 Oct, 2020

    I am using RainLab.Blog plugin. Created an API at api/v1/posts. Now I am getting all posts. How can I get a post for example with id 2?

  • author

    Replied on 28 Jun, 2023

    Thanks for your feedback, We can user api/v1/posts/{id} to get detail data, in your case you can use api/v1/posts/2

  • Found the plugin useful on 21 Nov, 2019

    Nice plugin ! It's possible to choose an middleware for an endpoint ?

    Or can we securise this by the json field ? Thanks !

  • author

    Replied on 28 Jun, 2023

    Thanks for your feedback, Currently this plugin not supported middleware

  • Found the plugin useful on 6 May, 2019

    Nice work! I have a question. Is this compatible with Translate plugin?

  • author

    Replied on 18 Jul, 2019

    I am sorry, this plugin does not support translate plugin.

  • Found the plugin useful on 12 Mar, 2019

    Can We Update Record using put method?

  • author

    Replied on 18 Jul, 2019

    should we change to put method?

  • Found the plugin useful on 22 Dec, 2018

    @Ahmad Fatoni, When I create 2 or more endpoints of 2 or more different models, they stop working except the last one. The first return a 404 error. Any fix for this issue?

  • author

    Replied on 18 Jul, 2019

    I have tried 4 endpoints, it works well. Do you use same name or same endpoint?

  • Found the plugin useful on 23 Jun, 2018

    Great plugin ! Will you add permissions ? It may configure which backend user can use this plugin.

  • author

    Replied on 3 Nov, 2018

    Great idea, I will add this feature to "to do list", feel free to contribute to this plugin, thanks :)

  • Found the plugin useful on 18 Jun, 2018

    hi, what a great plugin I think I'm going to love this plugin... But unfortunately I got following error when showing specified blog post thru following url:

    http://mylocalwebsite.com:8181/api/v1/posts/1

    Error We're sorry, but an unhandled error occurred. Please see the details below.

    count(): Parameter must be an array or an object that implements Countable /var/www/plugins/ahmadfatoni/apigenerator/controllers/api/PostListController.php line 34

    Could you please let me know about how to fix that error please ?

    Thank in advance

  • author

    Replied on 18 Jul, 2019

    May I know the PHP version you are using?

  • Found the plugin useful on 26 Feb, 2018

    I can't believe how nice October CMS is these days.

  • author

    Replied on 18 Jul, 2019

    Hopefully better

  • Found the plugin useful on 4 Dec, 2017

    @Gonzalo, on the last version of the plugin I've the same problem, I thinks there is a something with on router.php, when a new endpoint is created the prefix "api/v1/" is stripped from previous routes listed in route.php. The controller is not generated neither. Fix this by hand will resolve your problem.

  • Found the plugin useful on 17 Oct, 2017

    Hi!

    When I create 2 or more endpoints of 2 or more different models, they stop working except the last one. The first return a 404 error. Do you know why?

    Regards

  • Found the plugin not useful on 5 Oct, 2017

    Hi,

    Could you please help me how to send POST or DELETE request to the API generated by this plugin?
    GET request works fine but when I try to post or delete data I receive 404 error message.

    Thank you,
    Cb

  • author

    Replied on 5 Oct, 2017

    Hello, thanks for review

    Please check your routes list in CLI, you can use php artisan route:list and try to request to available route. Careful with the method you are using when requesting. If you found error when delete data, please update your plugin to latest version. Hope you enjoying this plugin.

  • Found the plugin useful on 30 Aug, 2017

    Nice plugin, one question, what would be the best way to implement JWT or some other kind of authentication before API usage?

  • author

    Replied on 31 Aug, 2017

    I have never tried it, but you can try this one : https://luketowers.ca/blog/how-to-use-laravel-packages-in-october-cms-plugins/

    You can try to use JWT auth in API Generator. Thank you

  • Found the plugin useful on 28 Aug, 2017

    I installed and created an api endpoint, but always get this error:

    Class AhmadFatoni\ApiGenerator\Controllers\API\booksController does not exist /var/www/html/vendor/laravel/framework/src/Illuminate/Container/Container.php line 741

    I checked the generated source code there is such file: ubuntu@ip-172-31-0-101:/data/webroot/october/src/plugins/ahmadfatoni/apigenerator$ ls controllers/API/ booksController.php readme.txt

  • author

    Replied on 28 Aug, 2017

    Please update your API Generator. Thanks

  • Found the plugin useful on 4 Jun, 2017

    how can you make it without Set-Cookie in the header? Thanks

  • author

    Replied on 6 Jun, 2017

    What do you mean "Set-Cookie in the header" ?

  • Found the plugin useful on 27 Mar, 2017

    Just started to use it. Nice plugin! Simple and effective. Thanks Ahmad. BTW, please check pull request I sent you with some fix for custom backend url.

  • author

    Replied on 29 Mar, 2017

    Thanks, I has been approved your pull request

  • Found the plugin useful on 31 Jan, 2017

    Thanks for very useful plugin. How to combine two models.

  • author

    Replied on 1 Feb, 2017

    Thanks, You can use "custom condition" feature. You can see an example in the documentation.

  • Found the plugin useful on 29 Jan, 2017

    does it support POST methods?

  • author

    Replied on 29 Jan, 2017

    Yes, its support post method

  • Found the plugin useful on 26 Dec, 2016

    Very useful plugin :*

1.0.8

fixing bug on October CMS v3

Jun 28, 2023

1.0.7

fixing bug on October CMS v1.0.456

Jul 18, 2019

1.0.6

fixing bug on generate endpoint

Nov 03, 2018

1.0.5

fixing bug on request delete data

Oct 05, 2017

1.0.4

fixing bug on PHP 7

Aug 28, 2017

1.0.3

add builder plugin on requirements

Apr 10, 2017

1.0.2

Created table ahmadfatoni_apigenerator_data

Nov 30, 2016

1.0.1

Initialize plugin.

Nov 30, 2016