[Building Sakai] Access Sakai Tool Data via Entity Broker

Aaron Zeckoski azeckoski at unicon.net
Wed Apr 3 10:32:06 PDT 2013


That or pass the session id just like with the SOAP webservices.
(sakai.session or sessionId should both work I think, though that's
off the top of my head).
-AZ


On Wed, Apr 3, 2013 at 12:55 PM, Matthew Jones <matthew at longsight.com> wrote:
> I think if you use the cookie jar (usually some tmp file in a regular
> script) to keep track of the session id then this would work for you?
>
> #Login, save cookie
> curl -c cookies.txt -b cookies.txt -i -X POST -F "_username=instructor" -F
> "_password=sakai" http://nightly2.sakaiproject.org:8082/direct/session
> #Should show logged in
> curl -c cookies.txt -b cookies.txt
> http://nightly2.sakaiproject.org:8082/direct/session.json
> #Should show sites
> curl -c cookies.txt -b cookies.txt
> http://nightly2.sakaiproject.org:8082/direct/site.json
>
>
>
> On Wed, Apr 3, 2013 at 12:23 PM, Thomas Amsler <tpamsler at ucdavis.edu> wrote:
>>
>> Thank you for all the information.
>>
>> So I can create a new session via:
>>
>> e.g.
>> curl -i -X POST -F "_username=<user name>" -F "_password=<pasword>"
>> http://nightly2.sakaiproject.org:8082/direct/session
>>
>> ..., which returns the Sakai session in the header and the response body.
>>
>> e.g. 1be83d58-76a9-4a64-82b3-6aed8794e588
>>
>> Now if I want to access all the announements for a user, what is the
>> correct sakai session header that I need to add to the request?
>>
>> e.g.
>>
>> curl -i -X GET -H "<some key ?>: 1be83d58-76a9-4a64-82b3-6aed8794e588"
>> "http://nightly2.sakaiproject.org:8082/direct/announcement/user.json"
>>
>> Best,
>> -- Thomas
>>
>>
>>
>>
>> On Mon, Apr 1, 2013 at 3:01 PM, Matthew Jones <matthew at longsight.com>
>> wrote:
>>>
>>> This info was about authentication.
>>> http://permalink.gmane.org/gmane.comp.cms.sakai.devel/51298
>>>
>>> It looks like there's announcements feeds in 2.9
>>> https://jira.sakaiproject.org/browse/SAK-21051
>>> https://jira.sakaiproject.org/browse/SAK-20633
>>>
>>>
>>> On Mon, Apr 1, 2013 at 5:51 PM, Thomas Amsler <tpamsler at ucdavis.edu>
>>> wrote:
>>>>
>>>> Hello,
>>>>
>>>> Is it possible to access Sakai tool data (e.g. Announcements, etc.)
>>>> externally, using the Entity Broker (EB) REST API? Are there examples using
>>>> curl to access EB REST APIs? How does authentication work accessing EB REST
>>>> APIs that way?
>>>>
>>>> I have found the following information:
>>>>
>>>> http://collab.sakaiproject.org/pipermail/sakai-dev/2012-September/018816.html
>>>>
>>>> ..., but I don't know if this applies to all tools that have an EB REST
>>>> API.
>>>>
>>>> Best,
>>>> Thomas Amsler
>>>>
>>>>
>>>>
>>>> _______________________________________________
>>>> sakai-dev mailing list
>>>> sakai-dev at collab.sakaiproject.org
>>>> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>>>>
>>>> TO UNSUBSCRIBE: send email to
>>>> sakai-dev-unsubscribe at collab.sakaiproject.org with a subject of
>>>> "unsubscribe"
>>>
>>>
>>
>
>
> _______________________________________________
> sakai-dev mailing list
> sakai-dev at collab.sakaiproject.org
> http://collab.sakaiproject.org/mailman/listinfo/sakai-dev
>
> TO UNSUBSCRIBE: send email to sakai-dev-unsubscribe at collab.sakaiproject.org
> with a subject of "unsubscribe"



-- 
Aaron Zeckoski - Software Architect - http://tinyurl.com/azprofile


More information about the sakai-dev mailing list