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

Internships

Details of routes to handle internships

List of all internships

GET /api/v1/internships

Params

KeyTypeOptionalDescription
limitNumbernoPage expected (By default 1)
pageNumbernoNumber of row expected (By default 20)
contriesString[]noList of reached countries
typesNumber[]noList of reached types
subjectStringnoPart of subject to filter in database
modeStringnopublished or propositions or self
isAbroadNumbernoFilter to get only abroad internships
isValidatedNumbernoFilter to get only validated internships

200 - List of internships

{
    "page": "1",
    "data": [
        {
            "id": 1,
            "subject": "Sed quaerat culpa saepe fuga velit distinctio ea deleniti.",
            "description": "Atque officia consectetur. Eum molestiae rerum qui et. Nostrum fuga molestiae voluptate. Eius omnis nihil non eveniet sed ut. Voluptate provident et voluptate provident illo voluptatem enim ea et. Voluptatem qui reiciendis molestiae rerum blanditiis rem. Ut qui dolor nostrum consequatur accusantium ex esse mollitia atque.",
            "country": "Russian Federation",
            "city": "New Rocky",
            "postalCode": "30636-9003",
            "address": "15486 Genoveva Isle",
            "additional": "Suite 755",
            "isInternshipAbroad": false,
            "isValidated": false,
            "createdAt": "2019-10-13T16:21:25.000Z",
            "updatedAt": "2019-10-13T16:21:25.000Z"
        },
    ],
    "length": 1,
    "max": 1
}

204 - Not content

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

Create a new internship

POST /api/v1/internships

Headers

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

Body

KeyTypeOptionalDescriptionAccess
subjectStringnoInternship subject*
descriptionStringnoInternship description*
categoryStringnoInternship category*
countryStringnoInternship country*
cityStringnoInternship city*
postalCodeStringnoInternship postalCode*
addressStringnoInternship address*
additionalStringnoAddress additional detail*
isInternshipAbroadBooleanyesInternship is abroad*
isValidatedBooleanyesInternship is validatedadmin
isPublishBooleanyesInternship is publishadmin
isPropositionBooleanyesInternship is proposition
startAtNumber(timestamp)yesInternship start at*
endAtNumber(timestamp)yesInternship end at*
publishAtNumber(timestamp)yesInternship publish atadmin

200 - Created

Return created internship

{
    "id": 1,
    "subject": "Sed quaerat culpa saepe fuga velit distinctio ea deleniti.",
    "description": "Atque officia consectetur. Eum molestiae rerum qui et. Nostrum fuga molestiae voluptate. Eius omnis nihil non eveniet sed ut. Voluptate provident et voluptate provident illo voluptatem enim ea et. Voluptatem qui reiciendis molestiae rerum blanditiis rem. Ut qui dolor nostrum consequatur accusantium ex esse mollitia atque.",
    "country": "Russian Federation",
    "city": "New Rocky",
    "postalCode": "30636-9003",
    "address": "15486 Genoveva Isle",
    "additional": "Suite 755",
    "isInternshipAbroad": false,
    "isValidated": false,
    "isProposition": true,
    "isPublish": false,
    "state": "waiting",
    "publishAt": "2019-10-13T16:21:25.000Z",
    "createdAt": "2019-10-13T16:21:25.000Z",
    "updatedAt": "2019-10-13T16:21:25.000Z"
}

400 - Bad request

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

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

Get a internship by ID

GET /api/v1/internships/:id

Paths variables

KeyTypeDescription
idStringInternship ID

200 - Internship

{
    "id": 1,
    "subject": "Sed quaerat culpa saepe fuga velit distinctio ea deleniti.",
    "description": "Atque officia consectetur. Eum molestiae rerum qui et. Nostrum fuga molestiae voluptate. Eius omnis nihil non eveniet sed ut. Voluptate provident et voluptate provident illo voluptatem enim ea et. Voluptatem qui reiciendis molestiae rerum blanditiis rem. Ut qui dolor nostrum consequatur accusantium ex esse mollitia atque.",
    "country": "Russian Federation",
    "city": "New Rocky",
    "business": null,
    "category": null,
    "postalCode": "30636-9003",
    "address": "15486 Genoveva Isle",
    "additional": "Suite 755",
    "isInternshipAbroad": false,
    "isValidated": false,
    "isProposition": true,
    "isPublish": false,
    "state": "waiting",
    "publishAt": "2019-10-13T16:21:25.000Z",
    "createdAt": "2019-10-13T16:21:25.000Z",
    "updatedAt": "2019-10-13T16:21:25.000Z"
}

204 - No content

If the API doesn't have any internship 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 internship by ID

PUT /api/v1/internships/:id

Paths variables

KeyTypeDescription
idStringInternship ID

Headers

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

Body

KeyTypeOptionalDescriptionAccess
subjectStringyesInternship subject*
descriptionStringyesInternship description*
categoryStringyesInternship category*
countryStringyesInternship country*
cityStringyesInternship city*
postalCodeStringyesInternship postalCode*
addressStringyesInternship address*
additionalStringyesAddress additional detail*
isInternshipAbroadBooleanyesInternship is abroad*
isValidatedBooleanyesInternship is validatedadmin
isPublishBooleanyesInternship is publishadmin
isPropositionBooleanyesInternship is propositionadmin
startAtNumber(timestamp)yesInternship start at*
endAtNumber(timestamp)yesInternship end at*
publishAtNumber(timestamp)yesInternship publish atadmin

200 - Updated internship

{
    "id": 1,
    "subject": "Sed quaerat culpa saepe fuga velit distinctio ea deleniti.",
    "description": "Atque officia consectetur. Eum molestiae rerum qui et. Nostrum fuga molestiae voluptate. Eius omnis nihil non eveniet sed ut. Voluptate provident et voluptate provident illo voluptatem enim ea et. Voluptatem qui reiciendis molestiae rerum blanditiis rem. Ut qui dolor nostrum consequatur accusantium ex esse mollitia atque.",
    "country": "Russian Federation",
    "city": "New Rocky",
    "postalCode": "30636-9003",
    "address": "15486 Genoveva Isle",
    "additional": "Suite 755",
    "isInternshipAbroad": false,
    "isValidated": false,
    "isProposition": true,
    "isPublish": false,
    "state": "waiting",
    "publishAt": "2019-10-13T16:21:25.000Z",
    "createdAt": "2019-10-13T16:21:25.000Z",
    "updatedAt": "2019-10-13T16:21:25.000Z"
}

204 - No content

If the API doesn't have any internship 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": "Subject must be of type string",
      "param": "city",
      "location": "body"
    }
  ],
  "name": "BAD REQUEST"
}

Remove a internship by ID

DELETE /api/v1/internships/:id

Paths variables

KeyTypeDescription
idStringInternship ID

200 - Removed

Return a status 200 without data when delete succeed

204 - No content

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

Get businesses related to an internship by giving his ID

GET /api/v1/internships/:id/businesses

Paths variables

KeyTypeDescription
idStringInternship ID

200 - Business

If a business is linked to given internship, return this struct

{
  "id": 1,
  "name": "Thales Group",
  "country": "France",
  "city": "Courbevoie",
  "postalCode": "92400",
  "address": "31 Place des Corolles",
  "updatedAt": "2019-09-19T22:21:24.365Z",
  "createdAt": "2019-09-19T22:21:24.365Z"
},

If not any business is linked to given internship, return this struct

{}

204 - No content

If the API doesn't have any internship 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 business to internship

GET /api/v1/internships/:id/businesses/:business_id/link

Paths variables

KeyTypeDescription
idStringInternship ID
business_idStringBusiness ID

200 - OK

Data are linked

204 - No content

If the API doesn't have requested business or internship 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"
}

Get category related to an internship by giving his ID

GET /api/v1/internships/:id/internshipTypes

Paths variables

KeyTypeDescription
idStringInternship ID

200 - Category

If a internshipType is linked to given internship, return this struct

{
  "id": 1,
  "label": "Thales Group",
  "updatedAt": "2019-09-19T22:21:24.365Z",
  "createdAt": "2019-09-19T22:21:24.365Z"
},

If not any internshipType is linked to given internship, return this struct

{}

204 - No content

If the API doesn't have any internship in his 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 category to internship

GET /api/v1/internships/:id/internshipTypes/:internship_type_id/link

Paths variables

KeyTypeDescription
idStringInternship ID
internship_type_idStringInternshipType ID

200 - OK

Data are linked

204 - No content

If the API doesn't have any internshipType 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"
}

Get files related to an internship by giving his ID

GET /api/v1/internships/:id/files

Paths variables

KeyTypeDescription
idStringInternship ID

Params

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

200 - Files list

{
    "page": "1",
    "data": [
        {
            "id": 1,
            "name": "Human Directives Administrator",
            "size": 13583,
            "type": "png",
            "path": "http://maxine.biz",
            "createdAt": "2019-10-13T16:24:13.000Z",
            "updatedAt": "2019-10-13T16:24:13.000Z"
        },
    ],
    "length": 1,
    "max": 1
}

204 - No content

If the API doesn't have any internship in his 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 file to internship

GET /api/v1/internships/:id/files/:file_id/link

Paths variables

KeyTypeDescription
idStringInternship ID
file_idStringFile ID

200 - OK

Data are linked

204 - No content

If the API doesn't have any file 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"
}

Get campaign related to an available internship by giving his ID

GET /api/v1/internships/:id/availableCampaigns

Paths variables

KeyTypeDescription
idStringInternship ID

200 - Campaign

{
    "id": 1,
    "name": "test",
    "maxProposition": 2,
    "description": "Sed quaerat culpa saepe fuga velit distinctio ea deleniti.",
    "category": {
      "id": 1,
      "label": "Stage ouvrier"
    },
    "semester": "S5",
    "isPublish": false,
    "startAt": 0,
    "endAt": 0,
    "updatedAt": "2019-09-19T22:21:24.365Z",
    "createdAt": "2019-09-19T22:21:24.365Z"
}

204 - No content

If the API doesn't have any internship in his 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 an available internship

GET /api/v1/internships/:id/availableCampaigns/:campaign_id/link

Paths variables

KeyTypeDescription
idStringInternship ID
campaign_idStringCampaign ID

200 - OK

Data are linked

204 - No content

If the API doesn't have any file 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"
}

Get campaign related to a validated internship by giving his ID

GET /api/v1/internships/:id/validatedCampaigns

Paths variables

KeyTypeDescription
idStringInternship ID

200 - Campaign

{
    "id": 1,
    "name": "test",
    "maxProposition": 2,
    "description": "Sed quaerat culpa saepe fuga velit distinctio ea deleniti.",
    "category": {
      "id": 1,
      "label": "Stage ouvrier"
    },
    "semester": "S5",
    "isPublish": false,
    "startAt": 0,
    "endAt": 0,
    "updatedAt": "2019-09-19T22:21:24.365Z",
    "createdAt": "2019-09-19T22:21:24.365Z"
}

204 - No content

If the API doesn't have any internship in his 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 a validated internship

GET /api/v1/internships/:id/validatedCampaigns/:campaign_id/link

Paths variables

KeyTypeDescription
idStringInternship ID
campaign_idStringCampaign ID

200 - OK

Data are linked

204 - No content

If the API doesn't have any file 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"
}

Get student related to an internship by giving his ID

GET /api/v1/internships/:id/students

Paths variables

KeyTypeDescription
idStringInternship ID

200 - Student

{
    "id": 1,
    "firstName": "John",
    "lastName": "Doe",
    "email": "john.doe@enib.fr",
    "semester": "S8",
    "createdAt": "2019-09-30T11:24:50.000Z",
    "updatedAt": "2019-09-30T11:24:50.000Z"
}

204 - No content

If the API doesn't have any internship in his 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 student to an internship

GET /api/v1/internships/:id/students/:student_id/link

Paths variables

KeyTypeDescription
idStringInternship ID
student_idStringStudent ID

200 - OK

Data are linked

204 - No content

If the API doesn't have any file 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"
}
← FilesInternshipTypes →
  • List of all internships
    • Params
    • 200 - List of internships
    • 204 - Not content
  • Create a new internship
    • Headers
    • Body
    • 200 - Created
    • 400 - Bad request
  • Get a internship by ID
    • Paths variables
    • 200 - Internship
    • 204 - No content
    • 400 - Bad request
  • Update a internship by ID
    • Paths variables
    • Headers
    • Body
    • 200 - Updated internship
    • 204 - No content
    • 400 - Bad request
  • Remove a internship by ID
    • Paths variables
    • 200 - Removed
    • 204 - No content
  • Get businesses related to an internship by giving his ID
    • Paths variables
    • 200 - Business
    • 204 - No content
    • 400 - Bad request
  • Link business to internship
    • Paths variables
    • 200 - OK
    • 204 - No content
    • 400 - Bad request
  • Get category related to an internship by giving his ID
    • Paths variables
    • 200 - Category
    • 204 - No content
    • 400 - Bad request
  • Link category to internship
    • Paths variables
    • 200 - OK
    • 204 - No content
    • 400 - Bad request
  • Get files related to an internship by giving his ID
    • Paths variables
    • Params
    • 200 - Files list
    • 204 - No content
    • 400 - Bad request
  • Link file to internship
    • Paths variables
    • 200 - OK
    • 204 - No content
    • 400 - Bad request
  • Get campaign related to an available internship by giving his ID
    • Paths variables
    • 200 - Campaign
    • 204 - No content
    • 400 - Bad request
  • Link campaign to an available internship
    • Paths variables
    • 200 - OK
    • 204 - No content
    • 400 - Bad request
  • Get campaign related to a validated internship by giving his ID
    • Paths variables
    • 200 - Campaign
    • 204 - No content
    • 400 - Bad request
  • Link campaign to a validated internship
    • Paths variables
    • 200 - OK
    • 204 - No content
    • 400 - Bad request
  • Get student related to an internship by giving his ID
    • Paths variables
    • 200 - Student
    • 204 - No content
    • 400 - Bad request
  • Link student to an internship
    • Paths variables
    • 200 - OK
    • 204 - No content
    • 400 - Bad request
Copyright © 2019 ENIB