Create Offer

Details#

This endpoint is used to create offers. Both Admins and Companies can use it.

info

If the logged-in user is a Company, that account will be the Offer owner. Otherwise, the creation will be done in admin/god mode, which requires permissions.

URL : /offers/new

Method :

POST

Authentication

Auth is required to create an Offer as a Company. Otherwise, owner and (if in god mode) god_token must be provided.

Concurrent Offers

The time when the offer is published must not make the respective company exceed the maximum number of concurrent active offers.

Parameters#

god_token#

Body Parameter
Optional
String

If set, will use this for validating the usage of god mode (in case no session details are available, i.e., no logged-in user).

owner#

Body Parameter
Optional
String (MongoDB ObjectId)

If the logged-in user is a company, this is not required.

Otherwise, it specifies the company to link this offer to.

title#

Body Parameter
Required

String
Max Length: 90

The title of the offer, used in search.

publishDate#

Body Parameter
Optional

Default: Now
Date (ISO8601 String)

The date when the offer will be made public (published).

publishEndDate#

Body Parameter
Required
Date (ISO8601 String)

The date when the offer will be "hidden" from the application (will be invisible to search).

jobMinDuration#

Body Parameter
Required
Number

The duration of the work itself (in months).

  • Must be an Integer (positive).

jobMaxDuration#

Body Parameter
Required
Number

The duration of the work itself (in months).

  • Must be an Integer (positive).

jobStartDate#

Body Parameter
Optional
Date (ISO8601 String)

The date when the job is expected to begin.

description#

Body Parameter
Required

String
Max Length: 1500

The offer description. Text that is shown when users request info about a specific offer.

contacts#

Body Parameter
Required

Array
Minimum: 1

List of contacts regarding offer information.

isPaid#

Body Parameter
Optional
Boolean

Informs if the offer has paid compensation.

vacancies#

Body Parameter
Optional

Number
Minimum: 0

Number of vacancies available.

  • Must be an Integer (positive)

jobType#

Body Parameter
Required
String

Type of the offer.

caution

Must be a valid Job Type ( currently ["FULL-TIME", "PART-TIME", "SUMMER INTERNSHIP", "CURRICULAR INTERNSHIP", "RESEARCH GRANT", "OTHER"]).

fields#

Body Parameter
Optional

Array
Minimum: 1
Maximum: 5

Specifies the fields (areas) the offer corresponds to.

caution

Must be a valid Field Type ( see list).

technologies#

Body Parameter
Optional

Array
Minimum: 1
Maximum: 7

Specifies the technologies the offer is looking for.

caution

Must be a valid Technology Type ( see list).

isHidden#

Body Parameter
Optional

Default: false
Boolean

If true, the offer will not show up in search by default. However, the owner and admins can still see it, by activating the showHidden flag when searching.

location#

Body Parameter
Required
String

Where the work will be done (usually in City, Country format).

coordinates#

Body Parameter
Optional
String

The coordinates of the workplace, so that a map can be shown in the UI.

requirements#

Body Parameter
Optional

Array
Minimum: 1

An array of strings containing job requirements in list form. Useful to list them in a more straightforward way.

applyURL#

Body Parameter
Optional
String

URL that users can use to apply to the offer. Must use http, https or mailto protocol.

Must respect the following regex: https?://S+.\S+

Request examples#

Example 1 - Valid Request (Logged-in as Company)#

Code :

200 OK

{
"contacts": [
"contact@company.com"
],
"location": "Porto, Portugal",
"jobStartDate": "2022-06",
"jobMinDuration": "2",
"jobMaxDuration": "4",
"publishEndDate": "2022-02-20T00:00:00+01:00",
"title": "Software fixer",
"description": "A nice description for this offer",
"jobType": "SUMMER INTERNSHIP",
"fields": [
"DEVOPS",
"MACHINE LEARNING"
],
"technologies": [
"Java",
"C#"
],
"requirements": [
"A good hammer"
],
"applyURL": "https://company.com/apply"
}

Example 2 - Publish Date in the Past#

Condition : If publishDate is in the past.

Code :

422 UNPROCESSABLE ENTITY

{
"contacts": [
"contact@company.com"
],
"location": "Porto, Portugal",
"jobStartDate": "2022-06",
"jobMinDuration": "2",
"jobMaxDuration": "4",
"publishDate": "2022-02-20T00:00:00+01:00",
"publishEndDate": "2022-08-19T00:00:00+01:00",
"title": "Software fixer",
"description": "A nice description for this offer",
"jobType": "SUMMER INTERNSHIP",
"fields": [
"DEVOPS",
"MACHINE LEARNING"
],
"technologies": [
"Java",
"C#"
],
"requirements": [
"A good hammer"
],
"applyURL": "https://company.com/apply"
}

Example 3 - Publish time over 6 month limit#

Condition : If publishEndDate is more than 6 months after publishDate.

Code :

422 UNPROCESSABLE ENTITY

{
"contacts": [
"contact@company.com"
],
"location": "Porto, Portugal",
"jobStartDate": "2022-06",
"jobMinDuration": "2",
"jobMaxDuration": "4",
"publishDate": "2022-05-20T00:00:00+01:00",
"publishEndDate": "2022-12-20T00:00:00+01:00",
"title": "Software fixer",
"description": "A nice description for this offer",
"jobType": "SUMMER INTERNSHIP",
"fields": [
"DEVOPS",
"MACHINE LEARNING"
],
"technologies": [
"Java",
"C#"
],
"requirements": [
"A good hammer"
],
"applyURL": "https://company.com/apply"
}

Example 4 - Maximum number of concurrent offers exceeded#

Condition : If the owner has more than 5 offers active (published and non-hidden) at a same point in time.

Code :

422 UNPROCESSABLE ENTITY

{
"contacts": [
"contact@company.com"
],
"location": "Porto, Portugal",
"jobStartDate": "2022-06",
"jobMinDuration": "2",
"jobMaxDuration": "4",
"publishDate": "2022-08-20T00:00:00+01:00",
"publishEndDate": "2022-12-20T00:00:00+01:00",
"title": "Software fixer",
"description": "A nice description for this offer",
"jobType": "SUMMER INTERNSHIP",
"fields": [
"DEVOPS",
"MACHINE LEARNING"
],
"technologies": [
"Java",
"C#"
],
"requirements": [
"A good hammer"
],
"applyURL": "https://company.com/apply"
}

Example 5 - Disabled company (Logged-in as Admin)#

Condition : If the owner is disabled.

Code :

403 FORBIDDEN

{
"contacts": [
"contact@company.com"
],
"location": "Porto, Portugal",
"jobStartDate": "2022-06",
"jobMinDuration": "2",
"jobMaxDuration": "4",
"publishDate": "2022-08-20T00:00:00+01:00",
"publishEndDate": "2022-12-20T00:00:00+01:00",
"title": "Software fixer",
"description": "A nice description for this offer",
"jobType": "SUMMER INTERNSHIP",
"fields": [
"DEVOPS",
"MACHINE LEARNING"
],
"technologies": [
"Java",
"C#"
],
"requirements": [
"A good hammer"
],
"applyURL": "https://company.com/apply",
"owner": "62601cb7cb39d3001b3664d9"
}

Example 6 - Offer blocked (With god token)#

Condition : If the offer has been blocked by an Admin.

Code :

403 FORBIDDEN

{
"publishEndDate": "2021-12-20T00:00:00+01:00",
"god_token": "token",
"owner": "62601cb7cb39d3001b3664d9"
}