Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Streak Club API #1

Open
7 of 9 tasks
catherinemarvin opened this issue Jan 15, 2015 · 12 comments
Open
7 of 9 tasks

Streak Club API #1

catherinemarvin opened this issue Jan 15, 2015 · 12 comments

Comments

@catherinemarvin
Copy link

Need an API for:

  • Login (POST users/login)
  • Register (POST users/register)
  • Browsing streaks (GET /streaks)
  • Viewing streak information (GET /streaks/:id)
  • Creating a streak (POST /streaks)
  • Submitting a new submission
  • Viewing homepage, list of participating streaks, list of streaks created (GET /my-streaks)
  • Joining and leaving a streak
  • list submissions in a streak

The API endpoints are just suggestions

@leafo leafo mentioned this issue Feb 22, 2015
@charles-l
Copy link

👍

leafo added a commit that referenced this issue Mar 9, 2015
leafo added a commit that referenced this issue Mar 9, 2015
leafo added a commit that referenced this issue Mar 9, 2015
leafo added a commit that referenced this issue Mar 9, 2015
leafo added a commit that referenced this issue Mar 9, 2015
leafo added a commit that referenced this issue Mar 9, 2015
@catherinemarvin
Copy link
Author

Can you expose the streak title in /my-streaks ? It looks like it's missing.

@catherinemarvin
Copy link
Author

As well as the "number of participants in the streak"/"number of submissions" and the frequency (ex. daily)

leafo added a commit that referenced this issue May 11, 2015
@leafo
Copy link
Owner

leafo commented May 11, 2015

Deployed

@catherinemarvin
Copy link
Author

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.

leafo added a commit that referenced this issue May 12, 2015
@catherinemarvin
Copy link
Author

Still need "number of participants in the streak" and "number of submissions" to get the home page to parity with .com

@qaisjp
Copy link

qaisjp commented Jun 26, 2015

um

@catherinemarvin
Copy link
Author

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";
}
);
};

@leafo
Copy link
Owner

leafo commented Jul 15, 2015

sorry, forgot to deploy. Should be there now @khwang

@leafo
Copy link
Owner

leafo commented Jul 15, 2015

also fixed that isseu @qaisjp thanks

@leafo
Copy link
Owner

leafo commented Jul 15, 2015

/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"
  }
}

leafo added a commit that referenced this issue Jul 16, 2015
@leafo
Copy link
Owner

leafo commented Jul 16, 2015

/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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants