Git Product home page Git Product logo

website-api-contracts's Introduction

website-api-contracts's People

Contributors

adnan1308 avatar ajeyakrishna-k avatar akshay1502 avatar ankurnarkhede avatar ankushdharkar avatar bajajcodes avatar bharati-21 avatar bhk31 avatar dashdeipayan avatar gauravsinhaweb avatar harshith-venkatesh avatar heyrandhir avatar iamitprakash avatar irahulp avatar ivinayakg avatar kratika0907 avatar muralidhar22 avatar pavangbhat avatar prerana1821 avatar pronoyb07 avatar rohan09-raj avatar rucha1499 avatar shivampandey0 avatar shreya-mishra avatar shubham-y avatar shubhamsinghbundela avatar sumitd94 avatar swarajpure avatar vinayak-trivedi avatar whydonti avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

website-api-contracts's Issues

[FeatureFlags] Create API contracts for the feature Flag entity.

Schema for this entity is as follows:

- featureFlag
  + name [String] <Unique>
  + title [String]
  + id [String] <Unique>
  + created_at [Timestamp]
  + updated_at [Timestamp]
  + config [Object]
    - enabled [Boolean]
  + owner [String] (Unique identifier for user)
  + launched_at [Timestamp]
  • Add the schema in the data-models repo.

These are the routes required for CRUD over this entity.

  • Write Create featureFlag route.
  • Write Update featureFlag route.
  • Write Delete featureFlag route.
  • Write a GET featureFlag route.
    • This returns all the feature flags for now.

The dashboard work is blocked on the create route and GET route, so we should finalize that part and the rest can be done async.

API contract for GET /tasks to get tasks based status

Right now when we try to get tasks through the GET /tasks API we get all of them regardless of what is the status of them.
So we need to add a query param status to our endpoint so that we can filter the data based on the status of the tasks on the backend only and then use it in any manner we would like to do so.

Setting up the APIs

  • User Login API
  • User Details API
  • User Update Details API
  • Send SMS API
  • Send WhatsApp messages API

[RFC] Modify "Archive users not In discord" API endpoint name

Summary

The API that deals with updating the Archived role to true if the user is not in our discord was put under the PATCH /users endpoint with a request body differentiating it from the previous API that exists for the same route.

But, this API is not following the best API naming convention as it is not representing the resources it is modifying correctly.

This RFC aims at finding the API name that follows a better API naming convention.

Description

We have created a new API that will mark all the users Archived that are not in our discord i.e. set the archived=true for users that have in_discord=false.

Initially, the API name was PATCH /users/update-archived. As this is not correct because the verb is defined by the action PATCH so adding update in the endpoint is not correct.

Then, possible route names are proposed.

  1. PATCH /users/archived
  2. PATCH /users/archivedUsers

As in these routes archived is not representing a resource another solution proposed was,

Put the API under PATCH /users by defining the proper body. This is the current implementation.

Here is the API contact: https://github.com/Real-Dev-Squad/website-api-contracts/tree/main/users#patch-users

API contract to GET /tasks (with query)

This is to extend the ability of the GET /tasks API from the backend to also support filtering by parameters passed as queries.
The functioning would be as follows:-

  1. If no query parameters passed i.e limit or offset then the response will get all the tasks there are in the database or default to a no. of documents to return.
  2. If query parameters limit and offset is passed then it would return all the documents which are created after the created time of the <task_object> whose id = offset, plus would only return n no. of documents where n = limit and therefore would also work as a paginated API.

Take forward crypto contract PR

remove POST/save, POST/purchase api contracts

POST/send / POST/request ->

  1. take params as body
  2. make params as none
  3. have meaningful success message (eg. ${amout} credited/debited to ${user})

GET/transactions ->

  1. make userid as param and limit as query
  2. make body as the success response

GET/userinfo ->

  1. make userid as param
  2. body as success response

[Live-Site] Update API contracts for Events model

Parent Story

Real-Dev-Squad/website-www#343

Detailed requirements

Requirement document

Overview

Below APIs require documentation as per the 2nd release cycle of live site with moderator controls & kickout feature.

New APIs:

Route Description
POST /events/:id/peers Add a peer to a specific event.
PATCH /events/:id/peers/kickout Kick out a peer from a specific event.
POST /events/:id/codes Generate event codes for a specific event.
GET /events/:id/codes Get event codes for a specific event.

README.md needs to be updated

Currently the README.md is missing some of the links of the API contracts. There are more folders (contracts) than there are number of links/titles in the README

The ones marked in red are missing from the main README.md of this repo:
image

We need to add those missing links in the README.md

Contract for `GET users/self` returning `phone` and `email`

Since the signup form is now taking phone number and email address, we should not send them as response for every API. No user should be able to see other user's phone number and email address.

No route other than GET users/self should return phone and email and that too only if query private is set to true

[Members Skills] API Contract

  • Should have a Skills collection which will have 4 fields
    • Name
    • Awarded on
    • Awarded by
    • Why it was awarded
  • Each user object will have a Skills property, which will be an array and contain the skills document id

[RFC] Modify API contract and route GET /users/isUsernameAvailable/:username

Task

Proposed Solution (Flow-Chart)

Before Change

GET /users/isUsernameAvailable/:username

Returns the availability of username.

  • Params
    Required: username=[string]
  • Body
    None
  • Headers
    Content-Type: application/json
  • Cookie
    rds-session: <JWT>
  • Success Response:
    • Code: 200
      • Content: { 'isUsernameAvailable': <boolean> }
  • Error Response:
    • Code: 401
      • Content:
        { 'statusCode': 401, 'error': 'Unauthorized', 'message': 'Unauthenticated User' }
    • Code: 500
      • Content:
        { 'statusCode': 500, 'error': 'Internal Server Error', 'message': 'An internal server error occurred' }

After Change

GET /users/isUsernameAvailable

Returns the availability of username.

  • Params
    None
  • Query
    Required: firstname=[string] (The first name of the user)
    Required: lastname=[string] (The last name of the user)
    Optional: dev=[boolean] (dev is passed to get username in the developer mode with the feature that are flagged)
  • Body
    None
  • Headers
    Content-Type: application/json
  • Cookie
    rds-session: <JWT>
  • Success Response:
    • Code: 200
      • Content: { 'username': <string> }
  • Error Response:
    • Code: 401
      • Content:
        { 'statusCode': 401, 'error': 'Unauthorized', 'message': 'Unauthenticated User' }
    • Code: 500
      • Content:
        { 'statusCode': 500, 'error': 'Internal Server Error', 'message': 'An internal server error occurred' }

Create API Contract for `/request` Route

Title: Create API Contract for /request Route

Issue Description

Develop and document the API contract for the unified /request endpoint. The API contract should clearly define the request and response structures, including all required and optional fields for task creation requests.

Expected Behavior

A documented and approved API contract that includes all necessary fields and validation rules for the /request endpoint.

Current Behavior

No existing API contract for the /request endpoint.

Screenshots

N/A

Reproducibility

  • This issue is reproducible
  • This issue is not reproducible

Steps to Reproduce

N/A

Severity/Priority

  • Critical
  • High
  • Medium
  • Low

Additional Information

Ensure the API contract is reviewed with the team for feedback and approval.

Checklist

  • I have read and followed the project's code of conduct.
  • I have searched for similar issues before creating this one.
  • I have provided all the necessary information to understand and reproduce the issue.
  • I am willing to contribute to the resolution of this issue.

Create API contract for Discord Bot API

What to do?

  • Create a APi contract for discord bot which adds the data whenever a /link or /verify command is being run.
  • The request to the backend from Cloudflare worker (Discord Bot) has to be verified by a JWT token
  • If the token is expired, the request is invalid
  • If the payload is incorrect then also the request is invalid

[Story Card] API Contract

  • It is a collection of Tasks
  • Containing the following data
{
  title: String,
  description: String,
  status: Enum,
  tasks: [
    <TaskId>
    <TaskId>
  ],
  featureOwner: <UserId>,
  backendEngineer: <UserId>, 
  frontendEngineer: <UserId>,
  StartedOn: Epoch,
  EndsOn: Epoch, // Due date 
}

Update the API contract for GET users/status

The API contract needs to be changed to

{
   "id": "String",
  "userId": "String",
  "first_name": "String",
  "Last_name": "String",
  "picture": {
            "publicId": "String",
            "url": "String"
        },
  "status": {
          "until":"TimeStamp",
          "updatedAt": "TimeStamp",
          "state": "String",
          "message": "String",
          "from": "TimeStamp"
       },
  "monthlyHours": {
        "committed": "Integer",
        "updatedAt": "TimeStamp"
      }
  }

Creating subfolders for logical separation

If we make each API as a main folder under the repo, it would be difficult to navigate and understand the hierarchy.
For example, we would now have an auction page and investment page under crypto-site, so
crypto-site

crypto-site
|---- README.md
|---- auction
|      |---- README.md
|---- investment
       |---- README.md

instead of

.
|---- README.md
|---- auction
|      |---- README.md
|---- investment
       |---- README.md

Add API Contacts for /requests API

Description:
Create comprehensive API Contracts for the /requests API to ensure clarity and consistency in request and response structures.

Details:

  • API Endpoint: /requests
  • Methods: POST, UPDATE, GET
  • Feature Flag: dev (for development environment)

Requirements:

  1. Define the request payload structure for the POST and UPDATE methods.
  2. Specify the response structure for each method, including success and error scenarios.
  3. Include data types, required fields, and possible values where applicable.
  4. Ensure the schema adheres to established API design standards.

Purpose:
Facilitate clear communication between frontend and backend teams, ensuring a smooth integration process.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.