Jump to:

10994 Posts in 2728 Topics by 1819 members

All other Modules

SilverStripe Forums » All other Modules » Restful Server in Silverstrip 3

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 898 Views
  • SS_Learner
    Avatar
    Community Member
    18 Posts

    Restful Server in Silverstrip 3 Link to this post

    Hello Friends,

    I am using Silverstripe 3 and fount Restful server class is missing in SS3,So i installed the Restful server module for SS3,

    In my DataObject class i have enabled the Resetful service like
    static $api_access = array(
    'view' => array('data'),
    );

    But when i try to use the link domain.com/api/v1/tablename/?xyz=123 ,it returns
    <DataList totalSize="5">
    </DataList> ,bu not the recoreds which i want i.e data form the tablename.
    Any help appriciated....
    Thank You

  • Willr
    Avatar
    Forum Moderator
    5508 Posts

    Re: Restful Server in Silverstrip 3 Link to this post

    Make sure you have defined a canView() function on your DataObject and that it returns true (or does whatever permission checking you need)

  • SS_Learner
    Avatar
    Community Member
    18 Posts

    Re: Restful Server in Silverstrip 3 Link to this post

    Thanks Willr it worked,
    But one thng is if i am using date in the url like
    domain.com/api/v1/tablename/?xyz=2012-01-12

    I am getting all the records from database instead of only one corresponding to that date.
    I have only one record for xyz=2012-01-12,but i get all.
    What can be the reason for this?

  • Stef87
    Avatar
    Community Member
    66 Posts

    Re: Restful Server in Silverstrip 3 Link to this post

    I know this is a little away from what you were discussing but I am having trouble with the RESTful Server API in 2.4.7 but it asks me to log in when I put this in http://localhost:8888/2.4.7/api/v1/ArticlePage/1

    It then says my name and password are wrong. I've checked and rechecked and it is definitely right because it is the one I gave when installing SilverStripe. I know it must be something obvious but I'm stuck.

    Thanks in advance.

    898 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.