EC Backend

EC Backend API Documentation

Communities

Communities | Add an event

Adds an event to a community

post
https://api.engineerscradle.com/community/addEvent
{
    "community": "6227adbcc6598b5bbc62e506",
    "Event": "61bf9256a4bbf025ec8a4624"
}

Request Body

Field Type Description
community   id

The Community id.

Event   id

The Event id

Error 4xx

Name Description
Unauthorized

The user is not authorized or authenticated to use the endpoint.

HTTP/1.1 401 Unauthorized
 {
     "error": "Please authenticate",
     "message": "invalid signature"
 }

Communities | Creates a community

post
https://api.engineerscradle.com/community/create
{
    "ProfileImage": "https://s3.ap-northeast-2.wasabisys.com/store.engineerscradle/static/default%20pic.png",
    "Title": "Career Guidance",
    "Description": "Confused about your career after your studies? Don’t be. Introducing our Career Guidance community through which you will get a clear idea of what type of career you want to pursue. The community will guide you based on your academics, interests, and skills. They will make sure you don’t end up selecting the wrong path in the future."
}

Request Body

Field Type Description
ProfileImage   string

community image ur;.

Title   string

Community Title

Description   string

Community Description

    HTTP/1.1 200 OK
{
    "success": true,
    "community": {
        "ProfileImage": "https://s3.ap-northeast-2.wasabisys.com/store.engineerscradle/static/default%20pic.png",
        "Posts": [],
        "Tags": [],
        "Events": [],
        "Members": [],
        "visible": true,
        "_id": "6227adbcc6598b5bbc62e506",
        "Title": "Career Guidance",
        "Description": "Confused about your career after your studies? Don’t be. Introducing our Career Guidance community through which you will get a clear idea of what type of career you want to pursue. The community will guide you based on your academics, interests, and skills. They will make sure you don’t end up selecting the wrong path in the future.",
        "createdAt": "2022-03-08T19:25:48.510Z",
        "updatedAt": "2022-03-08T19:25:48.510Z",
        "__v": 0
    }
}

Error 4xx

Name Description
Unauthorized

The user is not authorized or authenticated to use the endpoint.

HTTP/1.1 401 Unauthorized
 {
     "error": "Please authenticate",
     "message": "invalid signature"
 }

Communities | Delete a community

Deletes a community

delete
https://api.engineerscradle.com/community/
{
    "community": "6227adbcc6598b5bbc62e506"
}

Request Body

Field Type Description
community   id

The Community id.

Error 4xx

Name Description
Unauthorized

The user is not authorized or authenticated to use the endpoint.

HTTP/1.1 401 Unauthorized
 {
     "error": "Please authenticate",
     "message": "invalid signature"
 }

Communities | Join a community

Adds a user to a community

post
https://api.engineerscradle.com/community/join
{
  'community': '6227adbcc6598b5bbc62e506'
}

Request Body

Field Type Description
community   id

community id.

Error 4xx

Name Description
Unauthorized

The user is not authorized or authenticated to use the endpoint.

HTTP/1.1 401 Unauthorized
 {
     "error": "Please authenticate",
     "message": "invalid signature"
 }

Communities | Leave a community

Removes a user to a community

post
https://api.engineerscradle.com/community/leave
{
  'community': '6227adbcc6598b5bbc62e506'
}

Request Body

Field Type Description
community   id

community id.

Error 4xx

Name Description
Unauthorized

The user is not authorized or authenticated to use the endpoint.

HTTP/1.1 401 Unauthorized
 {
     "error": "Please authenticate",
     "message": "invalid signature"
 }

Communities | Remove an event

Removes an event from a community

post
https://api.engineerscradle.com/community/removeEvent
{
    "community": "6227adbcc6598b5bbc62e506",
    "Event": "61bf9256a4bbf025ec8a4624"
}

Request Body

Field Type Description
community   id

The Community id.

Event   id

The Event id

Error 4xx

Name Description
Unauthorized

The user is not authorized or authenticated to use the endpoint.

HTTP/1.1 401 Unauthorized
 {
     "error": "Please authenticate",
     "message": "invalid signature"
 }

Communities | Request Community Data by Id

get
https://api.engineerscradle.com/community/:id

Parameter

Field Type Description
id string

community id.

   HTTP/1.1 200 OK
   {
   "success": true,
   "communities": {
       "ProfileImage": "https://s3.ap-northeast-2.wasabisys.com/store.engineerscradle/static/default%20pic.png",
       "Posts": [],
       "Tags": [],
       "Events": [],
       "Members": [
           {
               "ProfileUrl": "https://i.ibb.co/R74JSvc/ec-default.png",
               "Role": "Student",
               "_id": "62230a17ba962f4dc8c88734",
               "UserName": "cjnkjebc"
            }
         ],
         "visible": true,
         "_id": "6227adbcc6598b5bbc62e506",
         "Title": "Career Guidance",
         "Description": "Confused about your career after your studies? Don’t be. Introducing our Career Guidance community through which you will get a clear idea of what type of career you want to pursue. The community will guide you based on your academics, interests, and skills. They will make sure you don’t end up selecting the wrong path in the future.",
         "createdAt": "2022-03-08T19:25:48.510Z",
        "updatedAt": "2022-03-08T19:50:32.572Z",
        "__v": 0
    }
}

Error 4xx

Name Description
Unauthorized

The user is not authorized or authenticated to use the endpoint.

HTTP/1.1 401 Unauthorized
 {
     "error": "Please authenticate",
     "message": "invalid signature"
 }
HTTP/1.1 404 Not Found
 {
     "success": false,
     "error": "community not found"
 }

Communities | Request List of Communities

get
https://api.engineerscradle.com/community/

Query Parameter(s)

Field Type Description
page   int

page number.

limit   int

number of items in one page.

    HTTP/1.1 200 OK
    {
    "success": true,
    "communities": [
        {
            "ProfileImage": "https://example.com",
            "Posts": [],
            "Tags": [],
            "Events": [],
            "Members": [],
            "visible": true,
            "_id": "6227adbcc6598b5bbc62e506",
            "Title": "Career Guidance",
            "Description": "Confused about your career after your studies? Don’t be. Introducing our Career Guidance community through which you will get a clear idea of what type of career you want to pursue. The community will guide you based on your academics, interests, and skills. They will make sure you don’t end up selecting the wrong path in the future.",
            "createdAt": "2022-03-08T19:25:48.510Z",
            "updatedAt": "2022-03-08T19:25:48.510Z",
            "__v": 0
        }
    ]
}

Error 4xx

Name Description
Unauthorized

The user is not authorized or authenticated to use the endpoint.

HTTP/1.1 401 Unauthorized
 {
     "error": "Please authenticate",
     "message": "invalid signature"
 }

Communities | Request List of suggested Communities for a user

get
https://api.engineerscradle.com/community/suggest

Query Parameter(s)

Field Type Description
page   int

page number.

limit   int

number of items in one page.

HTTP/1.1 200 OK
{
 "success": true,
 "totalSuggestions": 1,
 "community": [
     {
         "ProfileImage": "https://s3.ap-northeast-2.wasabisys.com/store.engineerscradle/static/default%20pic.png",
         "Posts": [],
         "Tags": [],
         "Events": [],
         "Members": [],
         "visible": true,
         "_id": "6227adbcc6598b5bbc62e506",
         "Title": "Career Guidance",
         "Description": "Confused about your career after your studies? Don’t be. Introducing our Career Guidance community through which you will get a clear idea of what type of career you want to pursue. The community will guide you based on your academics, interests, and skills. They will make sure you don’t end up selecting the wrong path in the future.",
         "createdAt": "2022-03-08T19:25:48.510Z",
         "updatedAt": "2022-03-08T19:25:48.510Z",
         "__v": 0
         }
     ]
 }

Error 4xx

Name Description
Unauthorized

The user is not authorized or authenticated to use the endpoint.

HTTP/1.1 401 Unauthorized
 {
     "error": "Please authenticate",
     "message": "invalid signature"
 }

Communities | Request List of users present in a community

get
https://api.engineerscradle.com/community/users

Query Parameter(s)

Field Type Description
community   id

the community id

page   int

page number.

limit   int

number of items in one page.

    HTTP/1.1 200 OK
    {
    "success": true,
    "community": {
        "Members": [
            {
                "Contact": {
                    "SocialUrl": [],
                    "PhoneNumber": []
                },
                "Chats": {
                    "Community": [],
                    "Personal": []
                },
                "Goals": {
                    "Technical": [],
                    "NonTechnical": [],
                    "Other": []
                },
                "Name": {
                    "First": "GK",
                    "Last": "Ram"
                },
                "Professional": {
                    "MyEvents": [],
                    "MyCourses": []
                },
                "EmailVerified": false,
                "AboutMe": "",
                "Badges": [],
                "Posts": [],
                "RegisteredEvents": [],
                "ConnectedCommunities": [
                    "6227adbcc6598b5bbc62e506"
                ],
                "RegisteredCourses": [],
                "DateOfBirth": "",
                "Points": 0,
                "MembersConnection": [],
                "SendRequest": [],
                "ReceivedRequest": [],
                "Gender": "",
                "ProfileUrl": "https://i.ibb.co/R74JSvc/ec-default.png",
                "Interest": [
                    "Javascript",
                    "Web Development",
                    "Node.js"
                ],
                "Role": "Student",
                "RoleTag": [
                    "Admin",
                    ""
                ],
                "Verified": false,
                "SecurityActions": [],
                "_id": "62230a17ba962f4dc8c88734",
                "Email": "chiragbhalotia0412@gmail.com",
                "Password": "$2a$10$U0NmjBmRjg2DJ9yXAbWXTuViRymAW0G/FvDqpglLIbjRELXkrTMFO",
                "UserName": "cjnkjebc",
                "WorkExperience": [],
                "Projects": [],
                "Certificates": [],
                "VolunteerExperience": [],
                "Education": [
                    {
                        "visibility": true,
                        "Verified": false,
                        "_id": "622312dc8412e35b30077fae",
                        "InstituteName": "Dps Megacity",
                        "TypeOfEducation": "B.Tech",
                        "FieldOfStudy": "Computer Science Engineering",
                        "StartDate": "10-2022",
                        "EndDate": "11-2023"
                    }
                ],
                "tokens": [],
                "createdAt": "2022-03-05T06:58:31.195Z",
                "updatedAt": "2022-03-08T19:50:32.585Z",
                "__v": 0
            }
        ],
        "_id": "6227adbcc6598b5bbc62e506"
    }
}

Error 4xx

Name Description
Unauthorized

The user is not authorized or authenticated to use the endpoint.

Not

Found The community Id is not passed or not found

HTTP/1.1 401 Unauthorized
 {
     "error": "Please authenticate",
     "message": "invalid signature"
 }
HTTP/1.1 404 Not Found
 {
     "success": false,
     "error": "community not found"
 }

Communities | Updates a community

Updates fields of the community passed in the body

put
https://api.engineerscradle.com/community/:id

Parameter

Field Type Description
id id

community id

{
    "ProfileImage": "https://s3.ap-northeast-2.wasabisys.com/store.engineerscradle/static/default%20pic.png",
    "Title": "Career Guidance",
    "Description": "Confused about your career after your studies? Don’t be. Introducing our Career Guidance community through which you will get a clear idea of what type of career you want to pursue. The community will guide you based on your academics, interests, and skills. They will make sure you don’t end up selecting the wrong path in the future."
}

Request Body

Field Type Description
ProfileImage   string

community image url.

Title   string

Community Title

Description   string

Community Description

    HTTP/1.1 200 OK
{
    "success": true,
    "community": {
        "ProfileImage": "https://s3.ap-northeast-2.wasabisys.com/store.engineerscradle/static/default%20pic.png",
        "Posts": [],
        "Tags": [],
        "Events": [],
        "Members": [],
        "visible": true,
        "_id": "6227adbcc6598b5bbc62e506",
        "Title": "Career Guidance",
        "Description": "Confused about your career after your studies? Don’t be. Introducing our Career Guidance community through which you will get a clear idea of what type of career you want to pursue. The community will guide you based on your academics, interests, and skills. They will make sure you don’t end up selecting the wrong path in the future.",
        "createdAt": "2022-03-08T19:25:48.510Z",
        "updatedAt": "2022-03-08T19:25:48.510Z",
        "__v": 0
    }
}

Error 4xx

Name Description
Unauthorized

The user is not authorized or authenticated to use the endpoint.

HTTP/1.1 401 Unauthorized
 {
     "error": "Please authenticate",
     "message": "invalid signature"
 }

DoubtBoard

DoubtBoard | Creates a Doubt

post
https://api.engineerscradle.com/doubtBoard/createDoubt
{
    "Images": "https://s3.ap-northeast-2.wasabisys.com/store.engineerscradle/static/default%20pic.png",
    "Title": "Study Doubt",
    "Description": "Have an doubt in your studies? Don’t Wait. Introducing our Doubtboard through which you will get answers and clear idea of your questions."
}

Request Body

Field Type Description
Images   string

Doubt image url.

Title   string

Doubt Title

Description   string

Doubt Description

    HTTP/1.1 201 CREATED
{
    "Tags": [],
    "LikedUsers": [],
    "Likes": 0,
    "Images": [],
    "Answers": [],
    "_id": "622b48bd4444284448ff123c",
    "Title": "Study Doubt",
    "Description": "Have an doubt in your studies? Don’t Wait. Introducing our Doubtboard through which you will get answers and clear idea of your questions.",
    "CreatedBy": "621d147d9584b95f343047a5",
    "createdAt": "2022-03-11T13:03:57.632Z",
    "updatedAt": "2022-03-11T13:03:57.632Z",
    "__v": 0
}

Error 4xx

Name Description
Unauthorized

The user is not authorized or authenticated to use the endpoint.

HTTP/1.1 401 Unauthorized
 {
     "error": "Please authenticate",
     "message": "invalid signature"
 }

DoubtBoard | Delete a Doubt

Deletes a Doubt

delete
https://api.engineerscradle.com/doubtBoard/deleteByID/:id

Parameter

Field Type Description
id id

doubtBoard id

    HTTP/1.1 200 OK
{
    "success": true,
    "doubtByID": {
        "Tags": [],
        "LikedUsers": [],
        "Likes": 0,
        "Images": [],
        "Answers": [],
        "_id": "622b48bd4444284448ff123c",
        "Title": "Study Doubt",
        "Description": "Have an doubt in your studies? Don’t Wait. Introducing our Doubtboard through which you will get answers and clear idea of your questions.",
        "CreatedBy": "621d147d9584b95f343047a5",
        "createdAt": "2022-03-11T13:03:57.632Z",
        "updatedAt": "2022-03-11T13:03:57.632Z",
        "__v": 0
    }
}

Error 4xx

Name Description
Unauthorized

The user is not authorized or authenticated to use the endpoint.

HTTP/1.1 401 Unauthorized
 {
     "error": "Please authenticate",
     "message": "invalid signature"
 }

DoubtBoard | Likes a Doubt

patch
https://api.engineerscradle.com/doubtBoard/like/:id

Parameter

Field Type Description
id id

doubtBoard id

    HTTP/1.1 200 OK
{
    "success": true,
    "doubt": {
        "Tags": [
            "study"
        ],
        "LikedUsers": [
            "621d147d9584b95f343047a5"
        ],
        "Likes": 1,
        "Images": [
            "https://s3.ap-northeast-2.wasabisys.com/store.engineerscradle/static/default%20pic.png"
        ],
        "Answers": [],
        "_id": "622a0e485468702f74e4eb01",
        "Title": "Study Doubt",
        "Description": "Have an doubt in your studies? Don’t Wait. Introducing our Doubtboard through which you will get answers and clear idea of your questions.",
        "CreatedBy": "621d147d9584b95f343047a5",
        "createdAt": "2022-03-10T14:42:16.752Z",
        "updatedAt": "2022-03-10T15:52:10.744Z",
        "__v": 0
    }
}

Error 4xx

Name Description
Unauthorized

The user is not authorized or authenticated to use the endpoint.

HTTP/1.1 400 Bad Request
{
    success: false,
    message: "Error in fetching data",
    error: {},
}

DoubtBoard | Request Doubt Data by Id

get
https://api.engineerscradle.com/doubtBoard/:id

Parameter

Field Type Description
id string

doubtBoard id.

   HTTP/1.1 200 OK
   {
    "success": true,
    "editDoubt": [
        {
            "Tags": [],
            "LikedUsers": [],
            "Likes": 0,
            "Images": [],
            "Answers": [],
            "_id": "6208c56c4840b00db4c613ab",
            "Title": "Doubt Title",
            "Description": "Doubt Description",
            "CreatedBy": "6207f8a5d7e82a24b4a39f8e",
            "createdAt": "2022-02-13T08:46:36.369Z",
            "updatedAt": "2022-02-13T08:46:36.369Z",
            "__v": 0
         }
     ]
}

Error 4xx

Name Description
Unauthorized

The user is not authorized or authenticated to use the endpoint.

HTTP/1.1 401 Unauthorized
 {
     "error": "Please authenticate",
     "message": "Unauthorized"
 }
HTTP/1.1 404 Not Found
 {
     "success": false,
     "error": "Doubt not found"
 }

DoubtBoard | Request List Of Doubt Data

get
https://api.engineerscradle.com/doubtBoard/view/all
    HTTP/1.1 200 OK
    {
    "success": true,
    "doubts": [
        {
            "Tags": [
                "a"
             ],
             "LikedUsers": [],
             "Likes": 0,
             "Images": [
                 "https://s3.ap-northeast-2.wasabisys.com/store.engineerscradle/static/default%20pic.png"
             ],
             "Answers": [],
             "_id": "622a0e485468702f74e4eb01",
             "Title": "Study Doubt",
             "Description": "Have an doubt in your studies? Don’t Wait. Introducing our Doubtboard through which you will get answers and clear idea of your questions.",
             "CreatedBy": {
                 "Name": {
                     "First": "Sayan",
                     "Last": "Dey"
                 },
                 "Professional": {
                     "MyEvents": [],
                     "MyCourses": []
                 },
                 "ProfileUrl": "https://i.ibb.co/R74JSvc/ec-default.png",
                 "Role": "none",
                 "_id": "621d147d9584b95f343047a5",
                 "UserName": "corvus_141"
             },
             "createdAt": "2022-03-10T14:42:16.752Z",
             "updatedAt": "2022-03-10T16:20:42.825Z",
             "__v": 0
        }
    ]
}

DoubtBoard | Request List Of Doubts By User

get
https://api.engineerscradle.com/doubtBoard/view/byAuthor
HTTP/1.1 200 OK
{
"success": true,
"doubts": [
    {
        "Tags": [
           "a"
        ],
        "LikedUsers": [],
        "Likes": 0,
        "Images": [
            "https://s3.ap-northeast-2.wasabisys.com/store.engineerscradle/static/default%20pic.png"
        ],
        "Answers": [],
        "_id": "622a0e485468702f74e4eb01",
        "Title": "Study Doubt",
        "Description": "Have an doubt in your studies? Don’t Wait. Introducing our Doubtboard through which you will get answers and clear idea of your questions.",
        "CreatedBy": {
            "Name": {
                "First": "Sayan",
                "Last": "Dey"
            },
            "Professional": {
                "MyEvents": [],
                "MyCourses": []
            },
            "ProfileUrl": "https://i.ibb.co/R74JSvc/ec-default.png",
            "Role": "none",
            "_id": "621d147d9584b95f343047a5",
            "UserName": "corvus_141"
        },
        "createdAt": "2022-03-10T14:42:16.752Z",
        "updatedAt": "2022-03-10T16:20:42.825Z",
        "__v": 0
        }
    ]
}

Error 4xx

Name Description
Unauthorized

The user is not authorized or authenticated to use the endpoint.

HTTP/1.1 401 Unauthorized
{
    "error": "Please authenticate",
    "message": "invalid signature"
}

DoubtBoard | Unikes a Doubt

patch
https://api.engineerscradle.com/doubtBoard/unlike/:id

Parameter

Field Type Description
id id

doubtBoard id

    HTTP/1.1 200 OK
{
    "success": true,
    "doubt": {
        "Tags": [
            "study"
        ],
        "LikedUsers": [],
        "Likes": 0,
        "Images": [
            "https://s3.ap-northeast-2.wasabisys.com/store.engineerscradle/static/default%20pic.png"
        ],
        "Answers": [],
        "_id": "622a0e485468702f74e4eb01",
        "Title": "Study Doubt",
        "Description": "Have an doubt in your studies? Don’t Wait. Introducing our Doubtboard through which you will get answers and clear idea of your questions.",
        "CreatedBy": "621d147d9584b95f343047a5",
        "createdAt": "2022-03-10T14:42:16.752Z",
        "updatedAt": "2022-03-10T15:52:10.744Z",
        "__v": 0
    }
}

Error 4xx

Name Description
Unauthorized

The user is not authorized or authenticated to use the endpoint.

HTTP/1.1 400 Bad Request
{
    success: false,
    message: "Error in fetching data",
    error: {},
}

DoubtBoard | Updates a Doubt

Updates fields of the doubt passed in the body

patch
https://api.engineerscradle.com/doubtBoard/edit/:id

Parameter

Field Type Description
id id

doubtBoard id

{
    "Images": "https://s3.ap-northeast-2.wasabisys.com/store.engineerscradle/static/default%20pic.png",
    "Title": "Study Doubt",
    "Description": "Have an doubt in your studies? Don’t Wait. Introducing our Doubtboard through which you will get answers and clear idea of your questions."
}

Request Body

Field Type Description
Images   string

Doubt image url.

Title   string

Doubt Title

Description   string

Doubt Description

    HTTP/1.1 200 OK
{
     "success": true,
     "editDoubt": [
         {
             "Tags": [
                 "study"
              ],
             "LikedUsers": [],
             "Likes": 0,
             "Images": [
                 "https://s3.ap-northeast-2.wasabisys.com/store.engineerscradle/static/default%20pic.png"
             ],
             "Answers": [],
             "_id": "622a0e485468702f74e4eb01",
             "Title": "Study Doubt",
             "Description": "Have an doubt in your studies? Don’t Wait. Introducing our Doubtboard through which you will get answers and clear idea of your questions.",
             "CreatedBy": "621d147d9584b95f343047a5",
             "createdAt": "2022-03-10T14:42:16.752Z",
             "updatedAt": "2022-03-10T14:53:16.574Z",
             "__v": 0
         }
    ]
}

Error 4xx

Name Description
Unauthorized

The user is not authorized or authenticated to use the endpoint.

HTTP/1.1 401 Unauthorized
 {
     "error": "Please authenticate",
     "message": "Doubt Not from this user"
 }
HTTP/1.1 404 Not Found
 {
     "success": false,
     "error": "Doubt not found"
 }

Doubt Answers

Doubt Answers | Create an answer for the given doubt

Create an answer

post
https://api.engineerscradle.com/doubtAnswers/createAnswer

Query Parameter(s)

Field Type Description
DoubtBoardId   string

Id for the Doubt which is being answered

Request Body

Field Type Description
Description   string

Answer for the given doubt

  HTTP/1.1 200 OK
{
  "success": true,
  "message": "Answer Successfully Added",
  "Answer": {
    "Upvotes": 0,
    "UpvotesUsers": [],
    "Downvotes": 0,
    "DownvotesUsers": [],
    "_id": "622b8491a4f4e512846d2930",
    "DoubtBoardId": "6208c5cf209246345454ae9c",
    "AnsweredBy": "620a11cfefa3f76d8ccd1735",
    "Description": "This is the Doubt",
    "AnsweredAt": "2022-03-11T17:19:13.045Z",
    "createdAt": "2022-03-11T17:19:13.047Z",
    "updatedAt": "2022-03-11T17:19:13.047Z",
    "__v": 0
  }
}

Error 4xx

Name Description
Error

Path Description is required

    HTTP/1.1 401 Unauthorized
    {
  "errors": {
    "Description": {
      "name": "ValidatorError",
      "message": "Path `Description` is required.",
      "properties": {
        "message": "Path `Description` is required.",
        "type": "required",
        "path": "Description"
      },
      "kind": "required",
      "path": "Description"
    }
  },
  "_message": "Answer validation failed",
  "name": "ValidationError",
  "message": "Answer validation failed: Description: Path `Description` is required."
}

Doubt Answers | Delete Answer by using the Answer Id

Delete Answer by using the Answer Id

delete
https://api.engineerscradle.com/delete/:answerId

Parameter

Field Type Description
Answer string

Answer ID

 HTTP/1.1 200 OK
{
  "success": true,
  "doubtAnswer": {
    "Upvotes": 0,
    "UpvotesUsers": [],
    "Downvotes": 0,
    "DownvotesUsers": [],
    "_id": "622b8491a4f4e512846d2930",
    "DoubtBoardId": {
      "Tags": [],
      "LikedUsers": [],
      "Likes": 0,
      "Images": [],
      "Answers": [
        "622b8491a4f4e512846d2930"
      ],
      "_id": "6208c5cf209246345454ae9c",
      "Title": "Doubt Title",
      "Description": "Doubt Description",
      "CreatedBy": "6207f8a5d7e82a24b4a39f8e",
      "createdAt": "2022-02-13T08:48:15.533Z",
      "updatedAt": "2022-03-11T17:19:13.135Z",
      "__v": 0
    },
    "AnsweredBy": {
      "Name": {
        "First": "Deepanshu",
        "Last": "g"
      },
      "Professional": {
        "MyEvents": [],
        "MyCourses": []
      },
      "ProfileUrl": "https://i.ibb.co/R74JSvc/ec-default.png",
      "Role": "none",
      "_id": "620a11cfefa3f76d8ccd1735",
      "UserName": "deepanshug"
    },
    "Description": "This is the Doubt",
    "AnsweredAt": "2022-03-11T17:19:13.045Z",
    "createdAt": "2022-03-11T17:19:13.047Z",
    "updatedAt": "2022-03-11T17:19:13.047Z",
    "__v": 0
  }
}

Error 4xx

Name Description
Error

Success:False

 HTTP/1.1 404 Not Found
{
  "success": false
}

Doubt Answers | Edit an existing answer

patch
https://api.engineerscradle.com/editAnswer/:answerId

Parameter

Field Type Description
AnswerId string

Answer to be edited

{
    "Description": "The edited answer"
}

Request Body

Field Type Description
Answer   string

Edited answer

 HTTP/1.1 200 OK
   {
  "success": true,
  "answer": {
    "Upvotes": 0,
    "UpvotesUsers": [],
    "Downvotes": 0,
    "DownvotesUsers": [],
    "_id": "620a2e9ce3b14760f49c44e5",
    "DoubtBoardId": "620a2a33a70cf94d5c6d83ae",
    "AnsweredBy": "620a11cfefa3f76d8ccd1735",
    "Description": "This is the new answer",
    "AnsweredAt": "2022-02-14T10:27:40.734Z",
    "createdAt": "2022-02-14T10:27:40.739Z",
    "updatedAt": "2022-03-11T13:31:48.507Z",
    "__v": 0
  }
}

Error 4xx

Name Description
Error

Success :False

 HTTP/1.1 400 Bad Request
{
  "success": false
}

Doubt Answers | Get the answer by Id

Get a particular Answer by Id

get
https://api.engineerscradle.com/view/:answerId

Parameter

Field Type Description
AnswerID string

Answer Id

 HTTP/1.1 200 OK
{
  "success": true,
  "doubtAnswer": {
    "Upvotes": 0,
    "UpvotesUsers": [],
    "Downvotes": 1,
    "DownvotesUsers": [
      "620a11cfefa3f76d8ccd1735"
    ],
    "_id": "620a2e315caa165d38c79f7f",
    "DoubtBoardId": {
      "Tags": [
        "a"
      ],
      "LikedUsers": [],
      "Likes": 0,
      "Images": [],
      "Answers": [
        "620b92ab482b9d6754513690",
        "620b92f82dd39d47b8ee4cfc",
        "620b93082dd39d47b8ee4d00",
        "620ba8469b6da15f94c73b4f",
        "620bbe3668e41e3ef89240d9",
        "620bc11ecc4c3c43e0d5deb6",
        "620bc26ecc4c3c43e0d5ded4",
        "6229d8a45151ae36d0c80b8c",
        "6229daa61712c15d78bf62ed",
        "6229dc269abc6473c80ae24b",
        "622b571ab324a72cd433eaef"
      ],
      "_id": "620a2a33a70cf94d5c6d83ae",
      "Title": "Try out",
      "Description": "Third doubt creating",
      "CreatedBy": "620a11cfefa3f76d8ccd1735",
      "createdAt": "2022-02-14T10:08:51.112Z",
      "updatedAt": "2022-03-11T14:05:14.312Z",
      "__v": 0
    },
    "AnsweredBy": {
      "Name": {
        "First": "Jyoti",
        "Last": "Dev"
      },
      "Professional": {
        "MyEvents": [],
        "MyCourses": []
      },
      "ProfileUrl": "https://i.ibb.co/R74JSvc/ec-default.png",
      "Role": "none",
      "_id": "6207d33c27880c03dc0fa05d",
      "UserName": "bravo68web"
    },
    "Description": "Answer 1",
    "AnsweredAt": "2022-02-14T10:25:53.532Z",
    "createdAt": "2022-02-14T10:25:53.533Z",
    "updatedAt": "2022-03-11T13:17:10.560Z",
    "__v": 0
  }
}

Error 4xx

Name Description
Error

Cast to ObjectId failed for value

 HTTP/1.1 400 Bad Request

{
  "success": false,
  "err": {
    "stringValue": "\"620a2e5caa165d38c79f7f\"",
    "valueType": "string",
    "kind": "ObjectId",
    "value": "620a2e5caa165d38c79f7f",
    "path": "_id",
    "reason": {},
    "name": "CastError",
    "message": "Cast to ObjectId failed for value \"620a2e5caa165d38c79f7f\" (type string) at path \"_id\" for model \"Answer\""
  }
}

Doubt Answers | Giving Vote to a given Poll

Voting a Poll

post
https://api.engineerscradle.com/poll/vote/:id

Parameter

Field Type Description
id id

poll id

Request Body

Field Type Description
Answer   string

for the given doubt

  HTTP/1.1 200 OK
{
"success": true,
"message": "Answer Successfully Added",
"Answer": {
  "Upvotes": 0,
  "UpvotesUsers": [],
  "Downvotes": 0,
  "DownvotesUsers": [],
  "_id": "622b8491a4f4e512846d2930",
  "DoubtBoardId": "6208c5cf209246345454ae9c",
  "AnsweredBy": "620a11cfefa3f76d8ccd1735",
  "Description": "This is the Doubt",
  "AnsweredAt": "2022-03-11T17:19:13.045Z",
  "createdAt": "2022-03-11T17:19:13.047Z",
  "updatedAt": "2022-03-11T17:19:13.047Z",
  "__v": 0
  }
}

Error 4xx

Name Description
Error

Path Answer is required

    HTTP/1.1 401 Unauthorized
{
    "success": false,
    "message": "You have not chosen any answer"
}

Doubt Answers | To downvote the given answer id

To downvote the given answer

patch
https://api.engineerscradle.com/downVote/:answerId

Parameter

Field Type Description
AnswerID string

Answer ID to downvote

 HTTP/1.1 200 OK
  {
  "success": true,
  "answer": {
    "Upvotes": 0,
    "UpvotesUsers": [],
    "Downvotes": 0,
    "DownvotesUsers": [],
    "_id": "620a2e315caa165d38c79f7f",
    "DoubtBoardId": "620a2a33a70cf94d5c6d83ae",
    "AnsweredBy": "6207d33c27880c03dc0fa05d",
    "Description": "Answer 1",
    "AnsweredAt": "2022-02-14T10:25:53.532Z",
    "createdAt": "2022-02-14T10:25:53.533Z",
    "updatedAt": "2022-02-14T10:25:53.533Z",
    "__v": 0
  }
}

Error 4xx

Name Description
Error

Cast to ObjectId failed for value

 HTTP/1.1 401 Unauthorized
 {
  "success": false,
  "err": {
    "stringValue": "\"60a2e315caa165d38c79f7f\"",
    "valueType": "string",
    "kind": "ObjectId",
    "value": "60a2e315caa165d38c79f7f",
    "path": "_id",
    "reason": {},
    "name": "CastError",
    "message": "Cast to ObjectId failed for value \"60a2e315caa165d38c79f7f\" (type string) at path \"_id\" for model \"Answer\""
  }
}

Doubt Answers | To upvote the given answer id

To upvote the given answer

patch
https://api.engineerscradle.com/upVote/:answerId

Parameter

Field Type Description
AnswerID string

Answer ID to upvote

 HTTP/1.1 200 OK
{
  "success": true,
  "answer": {
    "Upvotes": 0,
    "UpvotesUsers": [],
    "Downvotes": 0,
    "DownvotesUsers": [],
    "_id": "620bc26ecc4c3c43e0d5ded4",
    "DoubtBoardId": "620a2a33a70cf94d5c6d83ae",
    "AnsweredBy": "620a11cfefa3f76d8ccd1735",
    "Description": "Testing connection final",
    "AnsweredAt": "2022-02-15T15:10:38.298Z",
    "createdAt": "2022-02-15T15:10:38.299Z",
    "updatedAt": "2022-02-15T15:15:59.644Z",
    "__v": 0,
    "DownvotessUsers": []
  }

Error 4xx

Name Description
Error

Cast to ObjectId failed for value

 HTTP/1.1 400 Bad Request
{
  "success": false,
  "err": {
    "stringValue": "\"620b6ecc4c3c43e0d5ded4\"",
    "valueType": "string",
    "kind": "ObjectId",
    "value": "620b6ecc4c3c43e0d5ded4",
    "path": "_id",
    "reason": {},
    "name": "CastError",
    "message": "Cast to ObjectId failed for value \"620b6ecc4c3c43e0d5ded4\" (type string) at path \"_id\" for model \"Answer\""
  }
}

Doubt Answers | View all the answers

get
https://api.engineerscradle.com/viewAll

Query Parameter(s)

Field Type Description
Page   int

Page number

Limit   int

Number of items in page

HTTP/1.1 200 OK

Error 4xx

Name Description
Error

Unauthorized

 HTTP/1.1 401 Unauthorized 
{
  "error": "Auth-key Not found"
}

Events

Events | Creates an Event

post
https://api.engineerscradle.com/events
{
    "ProfileImage": "https://s3.ap-northeast-2.wasabisys.com/store.engineerscradle/static/default%20pic.png",
    "Title": "Career Guidance",
    "Description": "Confused about your career after your studies? Don’t be. Introducing our Career Guidance community through which you will get a clear idea of what type of career you want to pursue. The community will guide you based on your academics, interests, and skills. They will make sure you don’t end up selecting the wrong path in the future."
}

Request Body

Field Type Description
bannerImage   Image

Event Banner Image.

coverImage   Image

Event Cover Image

instructorImage   Image

Event Instructor Image

Description   String

Event Description

Title   String

Event Title

    HTTP/1.1 200 OK
{
    "success": true,
    "message": "Event created successfully",
    "event": {
        "Domain": "Engineering",
        "Tags": [],
        "Rating": 3,
        "SalePrice": 0,
        "StartsAt": "Fri Mar 11 2022 04:38:17 GMT+0530 (India Standard Time)",
        "Registration": [],
        "CreatedBy": "EC_Admin",
        "_id": "622a84f63464fb24342b53c4",
        "Description": "hello",
        "Title": "new event",
        "Prizes": [],
        "createdAt": "2022-03-10T23:08:38.877Z",
        "updatedAt": "2022-03-10T23:08:38.877Z",
        "__v": 0
    }
}

Error 4xx

Name Description
Unauthorized

The user is not authorized or authenticated to use the endpoint.

HTTP/1.1 401 Unauthorized
 {
     "error": "Please authenticate",
     "message": "invalid signature"
 }

Events | Get all Events

get
https://api.engineerscradle.com/events/

Query Parameter(s)

Field Type Description
page   int

page number.

limit   int

number of items in one page.

    HTTP/1.1 200 OK
{
    "success": true,
    "events": [
        {
            "Domain": "Engineering",
            "Tags": [],
            "Rating": 3,
            "SalePrice": 0,
            "StartsAt": "Fri Mar 11 2022 04:38:17 GMT+0530 (India Standard Time)",
            "Registration": [],
            "CreatedBy": "EC_Admin",
            "_id": "622a84f63464fb24342b53c4",
            "Description": "hello",
            "Title": "hmm",
            "Prizes": [],
            "createdAt": "2022-03-10T23:08:38.877Z",
            "updatedAt": "2022-03-10T23:12:45.190Z",
            "__v": 0
        }
    ],
    "page": 0,
    "pageSize": 50,
    "totalPages": 1,
    "total": 1
}

Error 4xx

Name Description
Unauthorized

The user is not authorized or authenticated to use the endpoint.

HTTP/1.1 401 Unauthorized
 {
     "error": "Please authenticate",
     "message": "invalid signature"
 }

Events | Get Suggested Events

get
https://api.engineerscradle.com/events/suggest

Query Parameter(s)

Field Type Description
page   int

page number.

limit   int

number of items in one page.

Error 4xx

Name Description
Unauthorized

The user is not authorized or authenticated to use the endpoint.

HTTP/1.1 401 Unauthorized
 {
     "error": "Please authenticate",
     "message": "invalid signature"
 }

Posts

Posts | Check if the post is liked

get
https://api.engineerscradle.com/posts/isLiked/:postId

Parameter

Field Type Description
postId String

The id of the post

    HTTP/1.1 200 OK
{
  "success": true,
  "isLiked": false
}
 HTTP/1.1 400 Bad Request
{
  "success": false
}

Posts | Create a new post

post
https://api.engineerscradle.com/posts/newpost

Request Body

Field Type Description
Title   string

Title of the new post

Description   string

Description of the new post

Image   string

Image for the post

    HTTP/1.1 200 OK
{
  "success": true,
  "message": "Post saved successfully",
  "post": {
    "PollId": null,
    "Tags": [],
    "LikedUsers": [],
    "Likes": 0,
    "Shares": 0,
    "Images": [],
    "_id": "626ccf177c962b2f9cf1a569",
    "Description": "New Description",
    "CreatedBy": {
      "Name": {
        "First": "Deepanshu",
        "Last": "g"
      },
      "Professional": {
        "MyEvents": [],
        "MyCourses": []
      },
      "ProfileUrl": "https://i.ibb.co/R74JSvc/ec-default.png",
      "Role": "none",
      "_id": "620a11cfefa3f76d8ccd1735",
      "UserName": "deepanshug"
    },
    "Comments": [],
    "createdAt": "2022-04-30T05:54:32.010Z",
    "updatedAt": "2022-04-30T05:54:32.010Z",
    "__v": 0
  }
}

Error 4xx

Name Description
Unauthorized

Unexpected Token.

  HTTP/1.1 401 Unauthorized
{
  "error": "Please authenticate",
  "message": "Unexpected token \b in JSON at position 33"
}

Posts | Deleting a post by Admin

delete
https://api.engineerscradle.com/posts/admin/:postId

Parameter

Field Type Description
postId String

PostID for the post to be deleted

    HTTP/1.1 200 OK
{
  "success": true,
  "message": "Successfully deleted post",
  "post": {
    "PollId": null,
    "Tags": [],
    "LikedUsers": [],
    "Likes": 0,
    "Shares": 0,
    "Images": [],
    "_id": "626ccf177c962b2f9cf1a569",
    "Description": "New Description",
    "CreatedBy": "620a11cfefa3f76d8ccd1735",
    "Comments": [],
    "createdAt": "2022-04-30T05:54:32.010Z",
    "updatedAt": "2022-04-30T06:15:39.804Z",
    "__v": 0
  }
}
 HTTP/1.1 401 Unauthorized
{
  "error": "Access Denied"
}

Posts | Deleting a post

delete
https://api.engineerscradle.com/posts/delete/:postId

Parameter

Field Type Description
postId String

PostID for the post to be deleted

    HTTP/1.1 200 OK
{
  "success": true,
  "message": "Successfully deleted post",
  "post": {
    "PollId": null,
    "Tags": [],
    "LikedUsers": [],
    "Likes": 0,
    "Shares": 0,
    "Images": [],
    "_id": "626cd53f9079885324a58b87",
    "Description": "New Description",
    "CreatedBy": "620a11cfefa3f76d8ccd1735",
    "Comments": [],
    "createdAt": "2022-04-30T06:20:47.106Z",
    "updatedAt": "2022-04-30T06:20:47.106Z",
    "__v": 0
  }
}
 HTTP/1.1 401 Unauthorized
{
  "error": "Please authenticate",
  "message": "invalid signature"
}

Posts | Edit a post using postId

patch
https://api.engineerscradle.com/posts/edit/:postId

Parameter

Field Type Description
postId String

PostId to edit

Request Body

Field Type Description
Title   string

New Title.

Description   string

New Description.

Images   string

New Images

 HTTP/1.1 200 OK
{
  "success": true,
  "editedPost": {
    "PollId": null,
    "Tags": [],
    "LikedUsers": [],
    "Likes": 0,
    "Shares": 0,
    "Images": [],
    "_id": "626cd0884aff965a00cad744",
    "Description": "New Description",
    "CreatedBy": "620a11cfefa3f76d8ccd1735",
    "Comments": [],
    "createdAt": "2022-04-30T06:00:40.439Z",
    "updatedAt": "2022-04-30T06:07:07.837Z",
    "__v": 0
  }
}

Error 4xx

Name Description
Casterror

Cast to ObjectId failed for value

 HTTP/1.1 400 Bad Request
{
  "success": false,
  "message": "Error in fetching data",
  "error": {
    "stringValue": "\"626cd0884aff965a0cad744\"",
    "valueType": "string",
    "kind": "ObjectId",
    "value": "626cd0884aff965a0cad744",
    "path": "_id",
    "reason": {},
    "name": "CastError",
    "message": "Cast to ObjectId failed for value \"626cd0884aff965a0cad744\" (type string) at path \"_id\" for model \"Post\""
  }
}

Posts | Get a Post by community

get
https://api.engineerscradle.com/posts/post/:community

Parameter

Field Type Description
CommunityID String

Community ID

 HTTP/1.1 200 OK
{
  "success": true,
  "foundPost": []
}
HTTP /1.1 400 Bad Request

{
  "success": false,
  "message": "Error in fetching post by community",
  "error": {
    "stringValue": "\"61e6bc8a567bcf12cb37ba4\"",
    "valueType": "string",
    "kind": "ObjectId",
    "value": "61e6bc8a567bcf12cb37ba4",
    "path": "CommunityTags",
    "reason": {},
    "name": "CastError",
    "message": "Cast to ObjectId failed for value \"61e6bc8a567bcf12cb37ba4\" (type string) at path \"CommunityTags\" for model \"Post\""
  }
}

Posts | Get a post by Id

get
https://api.engineerscradle.com/posts/:postId

Parameter

Field Type Description
postId String

postId

    HTTP/1.1 200 OK
{
  "success": true,
  "foundPost": {
    "PollId": null,
    "Tags": [],
    "LikedUsers": [],
    "Likes": 0,
    "Shares": 0,
    "Images": [],
    "_id": "626cd0884aff965a00cad744",
    "Description": "New Description",
    "CreatedBy": {
      "Name": {
        "First": "Deepanshu",
        "Last": "g"
      },
      "Professional": {
        "MyEvents": [],
        "MyCourses": []
      },
      "ProfileUrl": "https://i.ibb.co/R74JSvc/ec-default.png",
      "Role": "none",
      "_id": "620a11cfefa3f76d8ccd1735",
      "UserName": "deepanshug"
    },
    "Comments": [],
    "createdAt": "2022-04-30T06:00:40.439Z",
    "updatedAt": "2022-04-30T06:00:40.439Z",
    "__v": 0
  }
}

Error 4xx

Name Description
Unauthorized

Unexpected Token.

  HTTP/1.1 401 Unauthorized
{
  "error": "Please authenticate",
  "message": "Unexpected token \b in JSON at position 33"

Posts | Get all the posts

get
https://api.engineerscradle.com/posts/
  HTTP/1.1 200 OK
{
 "success": true,
 "posts": [
   {
     "PollId": {
       "Voted": [
         "621d147d9584b95f343047a5"
       ],
       "_id": "623018cee03a093a5c322f9e",
       "Question": "What should I do after Graduation",
       "Options": [
         {
           "votes": 0,
           "_id": "623018cee03a093a5c322f9f",
           "option": "Higher Studies"
         },
         {
           "votes": 1,
           "_id": "623018cee03a093a5c322fa0",
           "option": "Corporate Job"
         },
         {
           "votes": 0,
           "_id": "623018cee03a093a5c322fa1",
           "option": "Study for Government Job"
         }
       ],
       "createdAt": "2022-03-15T04:40:46.569Z",
       "updatedAt": "2022-03-15T04:42:54.629Z",
       "__v": 1
     },
     "Tags": [],
     "LikedUsers": [],
     "Likes": 0,
     "Shares": 0,
     "Images": [],
     "_id": "623018cee03a093a5c322fa3",
     "Description": "As I am in 3rd year in college, what should I do next ?",
     "CreatedBy": {
       "Name": {
         "First": "Sayan",
         "Last": "Dey"
       },
       "Professional": {
         "MyEvents": [],
         "MyCourses": []
       },
       "ProfileUrl": "https://i.ibb.co/R74JSvc/ec-default.png",
       "Role": "none",
       "_id": "621d147d9584b95f343047a5",
       "UserName": "corvus_141"
     },
     "Comments": [],
     "createdAt": "2022-03-15T04:40:46.647Z",
     "updatedAt": "2022-03-15T04:40:46.647Z",
     "__v": 0
   },

Posts | Like a post using PostId

patch
https://api.engineerscradle.com/posts/like/:postId

Parameter

Field Type Description
postId string

PostId to be liked

    HTTP/1.1 200 OK
{
  "success": true,
  "post": {
    "PollId": null,
    "Tags": [],
    "LikedUsers": [
      "620a11cfefa3f76d8ccd1735"
    ],
    "Likes": 1,
    "Shares": 0,
    "Images": [],
    "_id": "626ccf177c962b2f9cf1a569",
    "Description": "New Description",
    "CreatedBy": "620a11cfefa3f76d8ccd1735",
    "Comments": [],
    "createdAt": "2022-04-30T05:54:32.010Z",
    "updatedAt": "2022-04-30T06:13:11.482Z",
    "__v": 0
  }
}

Error 4xx

Name Description
Casterror

Cast to ObjectId failed for value

 HTTP/1.1 400 Bad Request
{
  "success": false,
  "message": "Error in fetching data",
  "error": {
    "stringValue": "\"626cd0884aff965a0cad744\"",
    "valueType": "string",
    "kind": "ObjectId",
    "value": "626cd0884aff965a0cad744",
    "path": "_id",
    "reason": {},
    "name": "CastError",
    "message": "Cast to ObjectId failed for value \"626cd0884aff965a0cad744\" (type string) at path \"_id\" for model \"Post\""
  }
}

Posts | Unlike a post using PostId

patch
https://api.engineerscradle.com/posts/unlike/:postId

Parameter

Field Type Description
postId string

PostId to be unliked

    HTTP/1.1 200 OK
{
  {
  "success": true,
  "post": {
    "PollId": null,
    "Tags": [],
    "LikedUsers": [],
    "Likes": 0,
    "Shares": 0,
    "Images": [],
    "_id": "626ccf177c962b2f9cf1a569",
    "Description": "New Description",
    "CreatedBy": "620a11cfefa3f76d8ccd1735",
    "Comments": [],
    "createdAt": "2022-04-30T05:54:32.010Z",
    "updatedAt": "2022-04-30T06:15:39.804Z",
    "__v": 0
  }
}
  }
}

Error 4xx

Name Description
Casterror

Cast to ObjectId failed for value

 HTTP/1.1 400 Bad Request
{
  "success": false,
  "message": "Error in fetching data",
  "error": {
    "stringValue": "\"626cd0884aff965a0cad744\"",
    "valueType": "string",
    "kind": "ObjectId",
    "value": "626cd0884aff965a0cad744",
    "path": "_id",
    "reason": {},
    "name": "CastError",
    "message": "Cast to ObjectId failed for value \"626cd0884aff965a0cad744\" (type string) at path \"_id\" for model \"Post\""
  }
}

notifications

notifications | Request notifications of users

get
https://api.engineerscradle.com/notifications
    HTTP/1.1 200 OK
{
 "success": true,
 "notifications": [
     {
         "Read": false,
         "Type": "LikeToPost",
         "ReferenceId": "620e2a052c224a2d940e1f35",
         "_id": "621df179a978e95b6a5f2616",
         "Sender": {
             "Name": {
                 "First": "prajal",
                 "Last": "patidar"
             },
             "Professional": {
                 "MyEvents": [],
                 "MyCourses": []
             },
             "ProfileUrl": "https://i.ibb.co/R74JSvc/ec-default.png",
             "Role": "none",
             "_id": "620e1d001c69992f84e3e704",
             "UserName": "prajal0604"
         },
         "Reciever": "6207f8a5d7e82a24b4a39f8e",
         "createdAt": "2022-02-17T10:57:31.256Z",
         "updatedAt": "2022-02-17T10:57:31.256Z",
         "__v": 0
     }
 ]
}

Error 4xx

Name Description
Unauthorized

The user is not authorized or authenticated to use the endpoint.

HTTP/1.1 401 Unauthorized
 {
     "error": "Please authenticate",
     "message": "Unauthorized"
 }
HTTP/1.1 404 Not Found
 {
     "success": false,
     "error": "Error while fetching notifications"
 }

Generated with apidoc 0.50.4 - Mon May 02 2022 10:39:06 GMT+0000 (Coordinated Universal Time)