Internships manager

Internships manager

  • Docs
  • API
  • Tuto
  • Help
  • GitHub

›REST API

Introduction

  • Internships manager API

REST API

  • Businesses
  • Campaigns
  • Files
  • Internships
  • InternshipTypes
  • Mentors
  • Mentoring propositions
  • Statistics
  • Students

Services API

  • Emails
  • Statistics

Mentoring propositions

Details of routes to handle mentoringPropositions

List of all mentoring propositions

GET /api/v1/mentoringPropositions

Params

KeyTypeOptionalDescription
limitNumbernoPage expected (By default 1)
pageNumbernoNumber of row expected (By default 20)

200 - List of mentoring propositions

{
    "page": "1",
    "data": [
        {
            "id": 1,
            "comment": "Human Directives Administrator",
            "createdAt": "2019-10-13T16:24:13.000Z",
            "updatedAt": "2019-10-13T16:24:13.000Z"
        },
    ],
    "length": 1,
    "max": 1
}

204 - Not content

If the API doesn't have any mentoring proposition in his database, we return a status 204 - No content

Create a new mentoring propostion

POST /api/v1/mentoringPropositions

Headers

KeyValueDescription
Content-Typeapplication/x-www-form-urlencodedBody encoding

Body

KeyTypeOptionalDescription
commentStringnoMentoring proposition comment

200 - Created

Return created mentoring proposition

{
    "id": 1,
    "comment": "Human Directives Administrator",
    "createdAt": "2019-10-13T16:24:13.000Z",
    "updatedAt": "2019-10-13T16:24:13.000Z"
}

400 - Bad request

API return Bad Request status with 400 code when request validation fail.

{
  "code": 11103,
  "status": 400,
  "errors": [
    {
      "msg": "Comment must be of type string",
      "param": "city",
      "location": "body"
    },
    {
      "msg": "Comment must be defined",
      "param": "city",
      "location": "body"
    }
  ],
  "name": "BAD REQUEST"
}

Get a mentoring proposition by ID

GET /api/v1/mentoringPropositions/:id

Paths variables

KeyTypeDescription
idStringMentoring proposition ID

200 - Mentoring proposition

{
    "id": 1,
    "comment": "Human Directives Administrator",
    "campaign": null,
    "createdAt": "2019-10-13T16:24:13.000Z",
    "updatedAt": "2019-10-13T16:24:13.000Z"
}

204 - No content

If the API doesn't have any mentoring proposition in his database, we return a status 204 - No content

400 - Bad request

API return Bad Request status with 400 code when request validation fail.

{
  "code": 11103,
  "status": 400,
  "errors": [
    {
      "msg": "Identifier must be an integer",
      "param": "city",
      "location": "body"
    },
    {
      "msg": "Identifier must be defined",
      "param": "city",
      "location": "body"
    }
  ],
  "name": "BAD REQUEST"
}

Update a mentoring proposition by ID

PUT /api/v1/mentoringPropositions/:id

Paths variables

KeyTypeDescription
idStringMentoring proposition ID

Headers

KeyValueDescription
Content-Typeapplication/x-www-form-urlencodedBody encoding

Body

KeyTypeOptionalDescription
commentStringyesMentoring proposition comment

200 - Updated mentoring proposition

{
    "id": 1,
    "comment": "Human Directives Administrator",
    "createdAt": "2019-10-13T16:24:13.000Z",
    "updatedAt": "2019-10-13T16:24:13.000Z"
}

204 - No content

If the API doesn't have any mentoring proposition in his database, we return a status 204 - No content

400 - Bad request

API return Bad Request status with 400 code when request validation fail.

{
  "code": 11103,
  "status": 400,
  "errors": [
    {
      "msg": "Comment must be of type string",
      "param": "city",
      "location": "body"
    }
  ],
  "name": "BAD REQUEST"
}

Remove a mentoring proposition by ID

DELETE /api/v1/mentoringPropositions/:id

Paths variables

KeyTypeDescription
idStringMentoring proposition ID

200 - Removed

Return a status 200 without data when delete succeed

204 - No content

If the API doesn't have any mentoring proposition in his database, we return a status 204 - No content

Get campaign related to an proposition by giving his ID

GET /api/v1/mentoringPropositions/:id/campaigns

Paths variables

KeyTypeDescription
idStringMentoring propostion ID

200 - Campaigns list

If a campaign is linked to given proposition, return this struct

{
  "id": 1,
  "maxProposition": 2,
  "name": "test",
  "semester": "S5",
  "isPublish": false,
  "startAt": 0,
  "endAt": 0,
  "updatedAt": "2019-09-19T22:21:24.365Z",
  "createdAt": "2019-09-19T22:21:24.365Z"
},

If not any campaign is linked to given propostion, return this struct

{}

204 - No content

If the API doesn't have any proposition in database link to given ID, we return a status 204 - No content

400 - Bad request

API return Bad Request status with 400 code when request validation fail.

{
  "code": 11103,
  "status": 400,
  "errors": [
    {
      "msg": "Identifier must be an integer",
      "param": "city",
      "location": "body"
    },
    {
      "msg": "Identifier must be defined",
      "param": "city",
      "location": "body"
    }
  ],
  "name": "BAD REQUEST"
}

Link campaign to proposition

GET /api/v1/mentoringPropositions/:id/campaigns/:campaign_id/link

Paths variables

KeyTypeDescription
idStringMentoring proposition ID
campaign_idStringCampaign ID

200 - OK

Data are linked

204 - No content

If the API doesn't have requested campaign or proposition in his database, we return a status 204 - No content

400 - Bad request

API return Bad Request status with 400 code when request validation fail.

{
  "code": 11103,
  "status": 400,
  "errors": [
    {
      "msg": "Identifier must be an integer",
      "param": "city",
      "location": "body"
    },
    {
      "msg": "Identifier must be defined",
      "param": "city",
      "location": "body"
    }
  ],
  "name": "BAD REQUEST"
}
← MentorsStatistics →
  • List of all mentoring propositions
    • Params
    • 200 - List of mentoring propositions
    • 204 - Not content
  • Create a new mentoring propostion
    • Headers
    • Body
    • 200 - Created
    • 400 - Bad request
  • Get a mentoring proposition by ID
    • Paths variables
    • 200 - Mentoring proposition
    • 204 - No content
    • 400 - Bad request
  • Update a mentoring proposition by ID
    • Paths variables
    • Headers
    • Body
    • 200 - Updated mentoring proposition
    • 204 - No content
    • 400 - Bad request
  • Remove a mentoring proposition by ID
    • Paths variables
    • 200 - Removed
    • 204 - No content
  • Get campaign related to an proposition by giving his ID
    • Paths variables
    • 200 - Campaigns list
    • 204 - No content
    • 400 - Bad request
  • Link campaign to proposition
    • Paths variables
    • 200 - OK
    • 204 - No content
    • 400 - Bad request
Copyright © 2019 ENIB