Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6694325
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:05:19+00:00 2026-05-26T06:05:19+00:00

Just started fumbling with ATK4. I’d like to use it both as a backend

  • 0

Just started fumbling with ATK4. I’d like to use it both as a backend API (if possible) as well as to create a small CMS based on the same data the API will work with. The API will be accessed by browser plugins so no rendering will be done by ATK4.

So basically my question is, does ATK4 come with support for creating your own REST API or would I basically have to create this functionality myself? I’ve found the API docs but they seem focused on making API methods in service of the rendering “engine”.

In case I should make this myself, what’s the best way of implementing this on ATK4? (in terms of future compatibility).

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T06:05:19+00:00Added an answer on May 26, 2026 at 6:05 am

    There is a straightforward way to solve that and a generic way.

    The straightforward way is as simple as this:

    class page_api_article_add extends Page {
        function init(){
             parent::init();
             try {
                 $this->add('Model_Article')->set($_POST)->update();
                 echo json_encode("OK");
                 exit;
             }catch (BaseException $e){
                 echo json_encode($e->getMessage());
                 exit;
             }
        }
    }
    

    The more sophisticated solution consists of building the following items:

    • You’ll need a custom API on top of ApiCLI.
    • You’ll need a separate page routing
    • Inside API you’ll need to define which models are accessible through API and which controller should be used
    • Controller will implement argument validation and operations on the models, such as create, update, delete, duplicate, etc
    • Support for key-authentication
    • Custom exceptions

    I have implemented this on one occasion, but I’ll need to negotiate with my client to make sure I can donate the code to atk4-addons.

    Currently I would suggest you to go the “straightforward” route until the generic API is released.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just started prepping AWS ec2 account for small grails app deploy and would like
Just started my first WCF rest project and would like some help on what
Just started working with android and ran into a small problem. I am have
Just started something related to video. It would really help if we can use
Just started to experiment with HTML5 features and really like the localStorage. And now
Just started to develop for Android, the idea is to create an app available
Just started playing with knockout.Js which is a fantastic framework Steve's really done well
Just started learning to use the grid so please excuse me for the possibly
Just started learning how to use paper_clip. I installed everything according the instructions and
Just started getting a bunch of errors on our C# .Net app that seemed

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.