streak.club
streak.club copied to clipboard
Streak Club API
Need an API for:
- [x] Login (POST users/login)
- [x] Register (POST users/register)
- [x] Browsing streaks (GET /streaks)
- [x] Viewing streak information (GET /streaks/:id)
- [ ] Creating a streak (POST /streaks)
- [ ] Submitting a new submission
- [x] Viewing homepage, list of participating streaks, list of streaks created (GET /my-streaks)
- [x] Joining and leaving a streak
- [x] list submissions in a streak
The API endpoints are just suggestions
:+1:
Can you expose the streak title in /my-streaks ? It looks like it's missing.
As well as the "number of participants in the streak"/"number of submissions" and the frequency (ex. daily)
Deployed
Did you change something? I'm getting back Code=-1011 "Request failed: internal server error (500)" UserInfo=0x7f90c8c99610 {NSUnderlyingError=0x7f90c924f930 "Request failed: unacceptable content-type: text/html", when making a call to my-streaks.
Still need "number of participants in the streak" and "number of submissions" to get the home page to parity with .com
Still seems to be missing submissions count and users count:
hosted = { completed = ( { category = other; "end_date" = "2015-05-07"; host = { id = 11; username = khwang; }; "hour_offset" = "-7"; id = 549; "publish_status" = draft; rate = daily; "short_description" = "Testing 1 2 3"; "start_date" = "2015-04-30"; title = "Sample Streak"; } ); };
sorry, forgot to deploy. Should be there now @khwang
also fixed that isseu @qaisjp thanks
/streak/:id/ -- get information about a streak by id
The streak_user field is present if the current logged in user is in this streak.
{
streak_user = {
pending = false,
created_at = "2015-07-15 03:23:56",
submissions_count = 0,
longest_streak = 0, -- can be nil
current_streak = 0 -- can be nil
},
streak = {
rate = "daily",
category = "other",
id = 291,
publish_status = "published",
host = {
username = "user-20",
id = 827
},
hour_offset = 0,
title = "streak-11",
end_date = "2015-08-04",
short_description = "short description for 11",
users_count = 0,
submissions_count = 0,
start_date = "2015-07-15"
}
}
/streak/:id/submissions?page=1 -- list submissions for streak, most recent first. page param is optional
{
page = 1,
submissions = {
{
uploads = {
{
type = "image",
url = "/img/Mix1c2VyX2NvbnRlbnQvdXBsb2Fkcy9pbWFnZS80LnBuZw==/original/Ghfao%2B.png",
id = 4
}
},
allow_comments = true,
user = {
username = "user-3",
id = 1172
},
streaks = {
{
title = "streak-1",
id = 447
}
},
created_at = "2015-07-16 03:31:30",
likes_count = 1,
title = "Submission 1",
published = true,
streak_submission = {
submit_time = "2015-07-16 03:31:30",
late_submit = false
},
comments_count = 0,
submission_like = {
Submissions can be submitted to multiple streaks at once, so each submission has a streaks field with a list of them.
submission_like is only there if the current user has liked that submission