Executing this API call. Sending json as parameter?

Wednesday, November 4, 2015

I am working with API called "Active Collab", I am trying to build a custom report.



API::get('/users/3/time-records/filtered-by-date')



Query Parameters:
{
"from": "2014-12-01",
"to": "2014-12-31"
}


I don't know how to do this...



I tried API::get('/users/3/time-records/'.$filtered-by-date)



$filter-by-date = {
"from": "2014-12-01",
"to": "2014-12-31"
}

and

$filter-by-date = json_encode({
"from": "2014-12-01",
"to": "2014-12-31"
});


it just never works.. I must be doing the filter-by-date wrong, however I just don't know what to do here.



Thanks



EDITED:



Tried this as well



$filter_by_date = json_encode(["from"=>"2014-12-01","to"=> "2014-12-31"]);



API::get('/users/'.$request->get('employee').'/time-records/filter_by_date')


Still nothing..



Top of my post is how API doc shows it I just have no idea how to execute that...

0 comments:

Post a Comment