21281 Posts in 5729 Topics by 2600 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1466 Views |
-
RESTfulServer (SilverStripe book)

15 January 2010 at 4:53am
I'm trying to use RESTfulServer as described in the Silverstripe book (from page 221 onwards).
Even when using the code example
static $api_access = array(
'view' => array(
'FirstName',
'Surname',
'Region',
'Introduction',
'References',
),
'edit' => array(
'FirstName',
'Surname',
'Region',
'Introduction',
)
);I only get this message:
You don't have access to this item through the API.
I also tried using the code and URLs described here: http://doc.silverstripe.org/doku.php?id=restfulserver
I don't really know how to get this working. Any tips on debugging this?
-
Re: RESTfulServer (SilverStripe book)

28 May 2010 at 11:20am
This probably comes rather late to be a useful reply.
I assume you were accessing /api/v1/Developer.xml via GET and getting this message?
Perhaps you can provide more information?Cheers,
- Luke -
Re: RESTfulServer (SilverStripe book)

28 May 2010 at 5:39pm
Hi.
RestfulServer gives that error when one of these conditions is not met (on a GET anyway):
- the DataObject class must have the static $api_access set to true.
- the DataObject instance must return true for canView()Mark
-
Re: RESTfulServer (SilverStripe book)

24 January 2011 at 10:39am
Another requirement of being able to GET results using field filters is that the fields that you are searching by must be set as searchable using the object's searchable_fields array.
| 1466 Views | ||
|
Page:
1
|
Go to Top |




