LISBON 10-12
APRIL 2014
LISBON 10-12
APRIL 2014

API

This is the list of public available API endpoints.

We don't feel that you need this (most of you are already scraping the website anyway) but there's been some demand so here's a list of structured calls that you can use to extract information from this website.

Also, there's no documentation (or official support, or guarantees). We think that if you've applied to Codebits you should be smart enough to understand these calls just by looking at them. All you need to know is:

  • They return JSON structures (default) or a well known form of structured data (ie: XML).
  • Some of the methods require authentication. To use them, get a token first with /api/gettoken. The credentials are the same as the website's.
  • We support both GET and POST.
  • If you prefer XML instead of JSON, just add &format=xml to any API call
  • We also support JSONP, just add &callback=funcName to any API call (JSON output only).
  • Using HTTPS is advised.
  • New methods will be added over time. If you need one, ask us.

Now go on, code those apps and let us know about them.

RSS and other feeds

Proposed talks' comments

https://codebits.eu/rss/proposal/96
96 is the example talk ID. Change it, get another feed.

Calendar.ics

https://codebits.eu/s/calendar.ics
iCalendar file of the Codebits schedule

Authentication and users

Auth token

https://services.sapo.pt/Codebits/gettoken?user=wookiee@sapo.pt&password=grumph
Get the auth token. Will be used as a &token= argument with all the methods that require authentication. Please be aware that tokens may expire (due to timeout, IP change or others). The correct procedure for an app is to ask for a new token if the one it has fails in any of the methods that require authentication.

User's info

https://services.sapo.pt/Codebits/user/1
Returns basic user information. 1 is the user ID, you can change it.

requires authentication

User's info by nick

https://services.sapo.pt/Codebits/nick/celso
Same as above, uses nick instead of ID.

requires authentication

User's friends

https://services.sapo.pt/Codebits/foaf/1
Returns the list of the user's friends. 1 is the user ID, you can change it. A word about the status: accepted is accepted by both friends, requested is awaiting acceptance on your side, pending is pending acceptance on your friend's side.

requires authentication

Add another user as a friend

https://services.sapo.pt/Codebits/foafadd/1
Adds or confirms a user as your friend. 1 is the user ID you wish to add, you can change it. Requires confirmation at the other end.

requires authentication

Reject another user as a friend

https://services.sapo.pt/Codebits/foafreject/1
Rejects a user as your friend. 1 is the user ID you wish to reject, you can change it. Deletes the pending request at the other end, if it exists.

requires authentication

List accepted users

https://services.sapo.pt/Codebits/users[/skill]
Returns the list of accepted users for this year's Codebits. You can filter the list by an optional 'skill'. The list of skills is: php perl ruby python erlang cc cocoa dotnet java javascript css api web embbeded mobile hardware microformats security sysadmin network desktop scala clojure design dbdesign nosql cooking processing max

requires authentication

List of favorite sessions for a user

https://services.sapo.pt/Codebits/usersessions/1
Returns the list of favorite calendar sessions for a user. 1 is the user ID, you can change it.

requires authentication

Bots

Body parts

https://services.sapo.pt/Codebits/botparts
Returns the body parts you can play with to build your bot.

User bot

https://services.sapo.pt/Codebits/botuser/1
Returns the bot structure for a certain user. 1 is the user ID, you can change it.

Make bot

https://services.sapo.pt/Codebits/botmake/01,02,03,04,05,06,07,08,I%20Rule!
Returns the bot image. Format as follows body,bgcolor,grad,eyes,mouth,legs,head,arms,balloon. Each field has the exact ID (with leading zeros) from /botparts. If don't want a certain body part to be rendered, use 0 for the ID. The balloon is optional but if you use it, you must urlencode the text first.

Set bot for user

https://services.sapo.pt/Codebits/botset/01,02,03,04,05,06,07,08,I%20Rule!
Sets the bot of the authenticated user. Format as follows body,bgcolor,grad,eyes,mouth,legs,head,arms,balloon. Each field has the exact ID (with leading zeros) from /botparts. If don't want a certain body part to be rendered, use 0 for the ID. The balloon is optional but if you use it, you must urlencode the text first.

requires authentication

Search

Search by name

https://services.sapo.pt/Codebits/search/celso
Search this year's edition registered users database for name celso.

requires authentication

Comments

Post comment

https://services.sapo.pt/Codebits/comment/75f0e78c6abdbe9222d41950bee59155ccc19292
Posts a new comment on a certain thread identified by the comment_token. 75f0e78c6abdbe9222d41950bee59155ccc19292 is the user comment_token, you can change it. Some calls (ie: /calltalks) will provide you with a comments_token field you can use here. You need to POST the comment's data using the comment and the (optional) subject variables in your request.

requires authentication

Sessions and calendar

Session information

https://services.sapo.pt/Codebits/session/110
Return the information about a session/talk, including the list of speakers. 110 is the session ID, you can change it.

Calendar

https://services.sapo.pt/Codebits/calendar
Returns this year's codebits calendar with detailed information.

Call for talks

List submissions

https://services.sapo.pt/Codebits/calltalks
Returns the list of the call for talks submissions for this year.
authentication is optional. returns the user thumb option under 'rated', if provided.

Vote talk up

https://services.sapo.pt/Codebits/calluptalk/100
Vote up a proposed talk. 100 is the talk ID, you can change it.

requires authentication

Vote talk down

https://services.sapo.pt/Codebits/calldowntalk/100
Vote down a proposed talk. 100 is the talk ID, you can change it.

requires authentication

Badges

List badges

https://services.sapo.pt/Codebits/listbadges
Returns the list of available badges and their user count.

Badges users

https://services.sapo.pt/Codebits/badgesusers/1
Returns the list of users for a given badge. 1 is the badge ID, you can change it.

Redeem badge

https://services.sapo.pt/Codebits/redeem/1-7aa59a4a117-12
Redeems a badge code.

requires authentication

Projects

List projects

https://services.sapo.pt/Codebits/projects
Returns the list of submitted projects for this year's competition.

requires authentication

Project information

https://services.sapo.pt/Codebits/project/114
Returns information about a specfic project. 114 is the ID, you can change it.

requires authentication

Current votes

https://services.sapo.pt/Codebits/votes
Returns information about the number of votes for the project being voted at the project's presentation session

Vote project

https://services.sapo.pt/Codebits/vote/1
Votes for the current project being presented. 1 for yes (liked it), 0 for no.

requires authentication

Examples

This is a list of shell based dirty examples. We're using POST with curl but you can use any framework you wish

getting the token
      curl -F "user=wookiee@sapo.pt" \
      -F "password=grumph" \
      "https://services.sapo.pt/Codebits/gettoken"
    
Getting info on user 666
      curl -F "token=MSNj...OGIyZmY=" \
      "https://services.sapo.pt/Codebits/user/666"
    
Getting the calendar in XML
      curl "https://services.sapo.pt/Codebits/calendar?format=xml"
    

Changelog

24 of August, 2012

  • Added /comment method
  • Added user info by nick under /nick
  • Added badges list to /user /nick and /foaf information
  • Added a /search method

2 of September, 2012

  • Added comments_token to /userbot/

6 of November, 2012

  • JSON mimetype changed to application/json