Giter Club home page Giter Club logo

Comments (6)

rapgithub avatar rapgithub commented on June 26, 2024

I think I found the Issue the API.php installed with composer it is old version I have to replace it with the download and it works now!!!

composer installation must be updated!!!
thanks

from api.

DarkSide666 avatar DarkSide666 commented on June 26, 2024

Do you use develop branch in your composer.json file?
"atk4/api": "dev-develop",

from api.

rapgithub avatar rapgithub commented on June 26, 2024

yes I do, It was installed with the installation of the api using composer

from api.

rapgithub avatar rapgithub commented on June 26, 2024

I am trying to use the optional args

Like explained here:

Optional Arguments

Agile API supports various get arguments.

?sort=name,-age specify columns to sort by.
?q=search, will attempt to perform full-text search by phrase. (if supported by persistence)
?condition[name]=value, conditioning, but can also use ?name=value
?limit=20, return only 20 results at a time.
?skip=20, skip first 20 results.
?only=name,surname specify onlyFields
?ad={transformation}, apply Agile Data transformation

but it does not work!!! gives me an empty array!!! nothing... any option return the same empty array if I use optional args..

any tip what am I doing wrong?

I am trying to add this, to see if this is missing in my php file but if I include it or not the optional args does not return anything...

function args(\atk4\data\Model $m) {
if ($_GET['sort']) {
$m->sortBy($_GET['sort']);
}

if ($_GET['condition']) {
	foreach($_GET['condition'] as $key=>$val) {
        $m->addCondition($key, $val);
    }
}

if ($_GET['limit'] || $_GET['skip']) {
    $m->setLimit($_GET['limit']?:null, $_GET['skip']?:null);
}

// etc. etc...

}

any tips?
In the sample files of the API there is no examples for optional arguments or auth... I am planning to use it to feed a mobile app this api and I need first test that all working fine...

most important things are...

to be able to filter or sort or show only some fields
limit the api to get and post request...
and auth for users that are authorised are only able to use the api for making get request...

thanks

from api.

DarkSide666 avatar DarkSide666 commented on June 26, 2024

Sometimes Composer doesn't update github repos. This shit happens. @romaninsh will check that when he will return from vacation.

Speaking about some aspects which are described in readme - yes, not everything is implemented yet and some things could be implemented different than in readme. This repo still is under construction. We use it in few our projects, but only in simple way - for quickly setting up simple REST interface.

Anyway - it's all in our ToDo list and will be developed in near future. Also you can help us and send in some PRs :)

from api.

rapgithub avatar rapgithub commented on June 26, 2024

Great :) of course!

from api.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.