Skip to content
Robert Lin edited this page Aug 19, 2020 · 6 revisions

Rittr Endpoints


Authenticated REST GET API

Get all edicts for a user:

http://localhost:5000/v1/user/1/edicts?otp=mock_otp_for_tests_good_until_2021

{
   status: 1,
   edicts: [
      {
         id: 1,
         user_id: 1,
         otp_id: 1,
         law: "Robert Edict Seed #1.",
         created_on: "2020-07-31T05:13:26.702Z"
      },
      {
         id: 2,
         user_id: 1,
         otp_id: 1,
         law: "Robert Edict Seed #2.",
         created_on: "2020-07-31T05:13:26.706Z"
      },
      {
         id: 5,
         user_id: 1,
         otp_id: 1,
         law: "This is a unit-test-created edict.",
         created_on: "2020-07-31T05:13:26.879Z"
      }
   ]
}

Get all users in the system (deprecated):

http://localhost:5000/v1/users?uid=1&otp=mock_otp_for_tests_good_until_2021

Get all alphas for a user:

http://localhost:5000/v1/user/1/alphas?otp=mock_otp_for_tests_good_until_2021

{
   status: 1,
   alphas: [
      {
         id: 2,
         name: "Alice",
         sovereignty: "Alicetown",
         created_on: "2020-08-01T04:10:02.374Z"
      },
      {
         id: 3,
         name: "Bob",
         sovereignty: "Bobville",
         created_on: "2020-08-01T04:10:02.374Z"
      }
   ]
}

Get all others (non-followed users) for a user:

http://localhost:5000/v1/user/1/others?otp=mock_otp_for_tests_good_until_2021

{
   status: 1,
   others: [
      {
         id: 4,
         name: "Charlie",
         sovereignty: "Charlie Island",
         email: "charlie@example.com",
         created_on: "2020-07-31T05:13:26.682Z",
         last_login: null
      },
      {
         id: 5,
         name: "Mr. Duplicate",
         sovereignty: "Duplicate Land",
         email: "duplicate@example.com",
         created_on: "2020-07-31T05:13:26.682Z",
         last_login: null
      }
   ]
}

Get unified EdictStream for a user:

http://localhost:5000/v1/user/1/edictstream?otp=mock_otp_for_tests_good_until_2021

{
   status: 1,
   edictstream: [
      {
         id: 6,
         user_id: 3,
         name: "Bob",
         law: "Bob Edict Seed #2.",
         created_on: "2020-07-31T05:27:17.768Z"
      },
      {
         id: 5,
         user_id: 3,
         name: "Bob",
         law: "Bob Edict Seed #1.",
         created_on: "2020-07-31T05:27:17.767Z"
      },
      {
         id: 4,
         user_id: 2,
         name: "Alice",
         law: "Alice Edict Seed #2.",
         created_on: "2020-07-31T05:13:26.707Z"
      },
      {
         id: 3,
         user_id: 2,
         name: "Alice",
         law: "Alice Edict Seed #1.",
         created_on: "2020-07-31T05:13:26.706Z"
      }
   ]
}

Clone this wiki locally