Orglr API: Documentation
On this page you will find some examples, how to use the orglr api. Some requests will need a sessionId. Before you can use those requests, you need to authenticate yourself with the login request in order to retrieve a session key. If you need support using the api, you can write us an email to mail@orglr.com
Example requests
Check if video exists in orglr database
List tags from a specific user
Searching for user, tags and videos
Reading orglr stream with specific filters
Delete one of your stream items
Login
Method: POST
URL: /api/account/login
Parameters: username, password
Response: success, token, accountId
Example request
http://admin.orglr.com/api/account/login?username=clarrat&password=xxx
Example response
{"success":true,"token":"534eae4190c8b","accountId":"2"}
Logout
Method: POST
URL: /api/account/logout
Parameters: sessionId
Response: success
Example request
http://admin.orglr.com/api/account/logout?sessionId=52ec046d48590
Example response
{"success":true}
Register
Method: POST
URL: /api/account/register
Parameters: none
Response: success
Example request
http://admin.orglr.com/api/account/register
Request data
"{username: 'clarrat', email: 'cedric.larrat@orglr.com', password: 'xxx'}"
Example response
{"success":true}
Video voting
Method: POST
URL: /api/vote/vote
Parameters: sessionId, streamId
Response: none
Example request
http://admin.orglr.com/api/vote/vote?sessionId=52ec046d48590&streamId=3
Adding a video
Method: POST
URL: /api/video/create
Parameters: sessionId
Response: success, message
Example request
http://admin.orglr.com/api/video/create?sessionId=52ec048e41ba6
Request data
"{URL: 'http://www.youtube.com/watch?v=kbRre6rlYEo', title: 'Video title', tags: 'funny, fun'}"
Example response
{"success":true,"message":[]}
Check if video exists
Method: POST
URL: /api/video/exists
Parameters: url
Response: success, exists
Example request
http://admin.orglr.com/api/video/exists?url=http://www.youtube.com/watch?v=kbRre6rlYEo
Example response
{"success":true,"exists":true}
Method: GET
URL: /api/tag/user
Parameters: userId
Response: success, tags
Example request
http://admin.orglr.com/api/tag/user?userId=2
Example response
{"success":true,"tags":[{"id":"4","name":"funny","insertTimestamp":"2014-01-31 21:41:17"},{"id":"5","name":"fun","insertTimestamp":"2014-01-31 21:41:17"}]}
Method: GET
URL: /api/tag/top
Parameters: limit
Response: count, results
Example request
http://admin.orglr.com/orglr/api/tag/top?limit=20
Example response
{"count":2,"results":[{"name":"fun","count":"1","url":"..."},{"name":"funny","count":"1","url":"..."}]}
Searching content
Method: GET
URL: /api/search/advancedsearch
Parameters: term
Response: list of videos, users, tags
Example request
http://admin.orglr.com/api/search/advancedsearch?term=clarr
Example response
[{"id":"2","type":"user","value":"clarrat","label":"@clarrat","url":"..."}]
Getting a list of stream items
If id is set, no list will be returned. Use parameter tag and user to filter your result. Direction can be 0 or 1. Zero will sort item list in ascending and value one in descending order. If no limit value is set, 10 will be set by default.
Method: GET
URL: /stream/list
Parameters: id (optional), limit (optional), direction (optional), tag (optional), user (optional)
Response: count, list of stream items
Example request
http://admin.orglr.com/stream/list?user=clarrat
Example response
{"count":"2","results":[{"id":"539","title":"Test","insertTimestamp":"2014-03-25 14:57:14","updateTimestamp":null,"account":{"id":"1","username":"orglr"},"video":{"id":"133","source":"Youtube","insertTimestamp":"2014-03-25 14:56:42","url":"510120"},"votes":[{"streamId":"539","accountId":"2","value":"1","insertTimestamp":"2014-04-16 18:41:35"}],"tags":[]}]}
Delete stream item
Method: POST
URL: /api/stream/delete
Parameters: sessionId, streamId
Response: none
Example request
http://admin.orglr.com/stream/delete?sessionId=52ec046d48590&streamId=3
If no limit is set, value 100 will be used
Method: GET
URL: /api/tag/usertop
Parameters: userId, limit (optional)
Response: none
Example request
http://admin.orglr.com/api/tag/usertop?userId=1
Example response
{"count": 14,"results": [{"name": "electric feel","count": "2","url": "..."}]}
Update the title of a stream-video
Method: POST
URL: /api/stream/updatetitle
Parameters: seassionId, streamId,
Response: none
Example request
http://admin.orglr.com/api/stream/updatetitle/?sessionId=43f23c9534966&streamId=6157&newtitle=Woodkid / I Love You (Feat. Angel Haze)
Method: POST
URL: /api/stream/updatetags
Parameters: seassionId, streamId, tags
Response: none
Example request
http://admin.orglr.com/api/stream/updatetags/?sessionId=43f23c9534966+&streamId=6157