The Web API is a REST API, you can read more about REST here.
Formatting options currently include JSON and XML. You can read more about JSON here, and XML here.
For authentication, the Web API uses Basic HTTP Authentication. For every request made to the Web API, you will need to include the authentication token in the HTTP Header. You can read more about Basic HTTP Authentication here.
The Web API uses the following HTTP response codes:
See bottom for detailed list of possible error messages
See below documentation for each method available through the API. See bottom for a simple example.
New profession group added: "Andre sundhedsjobs". If profession groups are not loaded dynamically, make sure to update the list from GET api/v1/professiongroups.
Added 23video.com to possible video source for video link.
Added video field to the Advert Model. VideoLink. This can be set with the POST and PUT methods for updating Adverts. The field should be a valid link to an mp4 file, link to a Youtube video or link to a video on Vimeo.
Added two new fields to the Advert Model. NumberOfPositions and EskNumbers. These can be set both with the POST and PUT methods for updating Adverts. The two fields are required for adverts with the profession "Introduktionsstilling".
Before 07/11-2014 the two fields Skills and Professions were required when using the POST/PUT Advert. This is no longer the case, as it differs from each ProfessionGroup. There has been added two new fields to the ProfessionGroup model, DisplaySkills and DisplayProfessions. If either of these are false, the related list will not be required on the POST/PUT Advert.
For two examples, see below
{
"Id": 1,
"Name": "Lægejob",
"DisplaySkills": true,
"DisplayProfessions": true
}
{
"Id": 2,
"Name": "Sygeplejerskejob",
"DisplaySkills": false,
"DisplayProfessions": true
}
Last edited: 07/11-2014
Represents the different profession groups, e.g. lægejob or sygeplejerskejob
| API | Description |
|---|---|
| GET api/v1/professiongroups |
Gets all the profession groups |
| GET api/v1/professiongroups/{id} |
Gets specific profession group specified by the id |
Represents the different regions, e.g. Region Hovedstaden or Region Syddanmark
| API | Description |
|---|---|
| GET api/v1/regions |
Gets all the regions |
| GET api/v1/regions/{id} |
Gets specific region specified by the id |
Represents the different locations, e.g. Gentofte Hospital or Odense Universitetshospital
| API | Description |
|---|---|
| GET api/v1/locations |
Gets all locations |
| GET api/v1/locations/{id} |
Gets specific location specified by the id |
Represents the different job types, e.g. Vikariat or Fast ansættelse
| API | Description |
|---|---|
| GET api/v1/jobtypes |
Gets all job types |
| GET api/v1/jobtypes/{id} |
Gets specific job type specified by the id |
Represents the different skills, e.g. Almen medicin or Geriatri
| API | Description |
|---|---|
| GET api/v1/skills/{professionGroupId} |
Gets all skills for a profession group, specified by the professionGroupId |
| GET api/v1/skills/{professionGroupId}/{id} |
Gets specific skill for a specific profession group, specified by the professionGroupId and id |
Represents the different weekly working hour options, e.g. Fuld tid or Deltid over 21 timer
| API | Description |
|---|---|
| GET api/v1/weeklyworkinghours |
Gets all weekly working hours |
| GET api/v1/weeklyworkinghours/{id} |
Gets specific weekly working hour specified by the id |
This is the actual adverts created by the regions. See POST and PUT for details
| API | Description |
|---|---|
| GET api/v1/adverts?location={location} |
Gets all your adverts |
| GET api/v1/adverts/{id} |
Gets specific advert specified by the id |
| POST api/v1/adverts |
Creates a new advert. The advert id will automatically be set and returned in the response |
| PUT api/v1/adverts |
Updates an advert, dependant upon the advert id. If any properties are left out, they will stay as they were. |
| DELETE api/v1/adverts/{id} |
Deletes advert specified by the id |
Represents the different professions, e.g. 1. Reservelæge or Afdelingslæge
| API | Description |
|---|---|
| GET api/v1/professions/{professionGroupId} |
Gets all professions for a profession group, specified by the professionGroupId |
| GET api/v1/professions/{professionGroupId}/{id} |
Gets specific profession for a specific professionGroup, specified by the profesionGroupId and id |
This is an example of how you would create a new advert through the API. To create a new advert the following details are required:
Authorization: Basic xxxxxxxxxxxxx POST /api/v1/adverts HTTP/1.1
$ curl https://api.sundhedsjobs.dk/api/v1/adverts -u TEST:TEST -d " \
{
\"ProfessionGroup\" : 3,
\"Title\" : \"Reservelæge i akut medicin på OUH\",
\"Number\" : \"1337\",
\"PublishDate\" : \"2014-08-29\",
\"ApplyLink\" : \"http://www.yourdomain.com/apply\",
\"DeadlineDate\" : \"2014-09-30\",
\"StartDate\" : \"2014-11-01\",
\"Locations\" : [
1,
2
],
\"Skills\" : [
4,
7
],
\"Professions\" : [
5
],
\"Content\" : \"HTML of the advert\",
\"WeeklyWorkingHours\" : 1,
\"JobType\" : 2,
\"Employer\" : {
\"Name\" : \"OUH\",
\"CVR\" : \"87654321\",
\"PNumber\" : \"98912933134\"
\"ContactPersonFirstName\" : \"John\",
\"ContactPersonLastName\" : \"Doe\",
\"Address\" : \"Street 1\",
\"Zip\" : \"1234\",
\"City\" : \"Odense\",
\"Email\" : \"john@doe.com\",
\"Phone\" : \"12345678\",
}
}"
{
"Id" : 1324,
"ProfessionGroup" : {
"Id" : 3,
"Name" : "Lægejob"
},
"Title" : "Reservelæge i akut medicin på OUH",
"Number" : "1337",
"PublishDate" : "2014-08-29T00:00:00+02.00",
"ApplyLink" : "http://www.yourdomain.com/apply",
"DeadlineDate" : "2014-09-30T00:00:00+02.00",
"StartDate" : "2014-11-01T00:00:00+02.00",
"DurationOfHiring" : null,
"Locations" : [
{
"Id" : 1,
"Name" : "OUH",
"Region" : {
"Id" : 1,
"Name" : "Region Syddanmark"
}
},
{
"Id" : 2,
"Name" : "Random Hospital",
"Region" : {
"Id" : 1,
"Name" : "Region Syddanmark"
}
}
],
"Skills" : [
{
ProfessionGroup : {
"Id" : 3,
"Name" : "Lægejob"
},
"Id" : 4,
"Name" : "Akut medicin"
},
{
ProfessionGroup : {
"Id" : 3,
"Name" : "Lægejob"
},
"Id" : 7,
"Name" : "Almen medicin"
}
],
"Professions" : [
{
ProfessionGroup : {
"Id" : 3,
"Name" : "Lægejob"
},
"Id" : 5,
"Name" : "Reservelæge"
}
],
"Summary" : null,
"Content" : "HTML of the advert",
"WeeklyWorkingHours" : {
"Id" : 1,
"Name" : "Fuld tid"
},
"JobType" : {
"Id" : 2,
"Name" : "Projektansat"
},
"Employer" : {
"Name" : "OUH",
"CVR" : "87654321",
"PNumber" : "98912933134"
"ContactPersonFirstName" : "John",
"ContactPersonLastName" : "Doe",
"Address" : "Street 1",
"Zip" : "1234",
"City" : "Odense",
"Email" : "john@doe.com",
"Phone" : "12345678",
"Website" : null,
}
}
{
"Message" : "ProfessionGroup is required"
}
This is an example of how you would update an advert through the API. To update an advert the following details are required:
Authorization: Basic xxxxxxxxxxxxx PUT /api/v1/adverts HTTP/1.1
$ curl https://api.sundhedsjobs.dk/api/v1/adverts -u TEST:TEST -X PUT -d " \
{
\"Id\" : 1324,
\"Number\" : \"1338\",
}"
{
"Id" : 1324,
"ProfessionGroup" : {
"Id" : 3,
"Name" : "Lægejob"
},
"Title" : "Reservelæge i akut medicin på OUH",
"Number" : "1338",
"PublishDate" : "2014-08-29T00:00:00+02.00",
"ApplyLink" : "http://www.yourdomain.com/apply",
"DeadlineDate" : "2014-09-30T00:00:00+02.00",
"StartDate" : "2014-11-01T00:00:00+02.00",
"DurationOfHiring" : null,
"Locations" : [
{
"Id" : 1,
"Name" : "OUH",
"Region" : {
"Id" : 1,
"Name" : "Region Syddanmark"
}
},
{
"Id" : 2,
"Name" : "Random Hospital",
"Region" : {
"Id" : 1,
"Name" : "Region Syddanmark"
}
}
],
"Skills" : [
{
ProfessionGroup : {
"Id" : 3,
"Name" : "Lægejob"
},
"Id" : 4,
"Name" : "Akut medicin"
},
{
ProfessionGroup : {
"Id" : 3,
"Name" : "Lægejob"
},
"Id" : 7,
"Name" : "Almen medicin"
}
],
"Professions" : [
{
ProfessionGroup : {
"Id" : 3,
"Name" : "Lægejob"
},
"Id" : 5,
"Name" : "Reservelæge"
}
],
"Summary" : null,
"Content" : "HTML of the advert",
"WeeklyWorkingHours" : {
"Id" : 1,
"Name" : "Fuld tid"
},
"JobType" : {
"Id" : 2,
"Name" : "Projektansat"
},
"Employer" : {
"Name" : "OUH",
"CVR" : "87654321",
"PNumber" : "98912933134"
"ContactPersonFirstName" : "John",
"ContactPersonLastName" : "Doe",
"Address" : "Street 1",
"Zip" : "1234",
"City" : "Odense",
"Email" : "john@doe.com",
"Phone" : "12345678",
"Website" : null,
}
}
{
"Message" : "Advert not found"
}
Below is the possible Bad Request (400) error messages