Please help me understand REST API code (Corey Maynards tut)
Posted: Thu Aug 03, 2017 11:49 am
Hi,
I tried following Corey Maynards tutorial for RESTful API located at http://coreymaynard.com/blog/creating-a ... -with-php/
Im running the script at my page and after changing:
to
I got it to work but I do not know how to supply the APIKey "Test" to the script in my call so I only get the error {"error":"No API Key provided"}
I run my script on http://fairdea.com/api/barcode/
So anything I write after barcode/ is sent to the script.. like /../barcode/GET/1234/Test where I assume the script gets the "GET/1234/Test" part..
I would also appreciate if someone could give some ideas of how the part
is supposed to work?
Thanks
I tried following Corey Maynards tutorial for RESTful API located at http://coreymaynard.com/blog/creating-a ... -with-php/
Im running the script at my page and after changing:
Code: Select all
// Abstracted out for example
$APIKey = new Models\APIKey();
$User = new Models\User();
Code: Select all
// Abstracted out for example
$APIKey = "Test";
$User = "Testuser";
I run my script on http://fairdea.com/api/barcode/
So anything I write after barcode/ is sent to the script.. like /../barcode/GET/1234/Test where I assume the script gets the "GET/1234/Test" part..
I would also appreciate if someone could give some ideas of how the part
Code: Select all
// Abstracted out for example
$APIKey = new Models\APIKey();
$User = new Models\User();
Thanks