API Documentation

Models

ProfessionGroups

Represents the different profession groups, e.g. lægejob or sygeplejerskejob

APIDescription
GET api/v1/professiongroups

Gets all the profession groups

GET api/v1/professiongroups/{id}

Gets specific profession group specified by the id

Regions

Represents the different regions, e.g. Region Hovedstaden or Region Syddanmark

APIDescription
GET api/v1/regions

Gets all the regions

GET api/v1/regions/{id}

Gets specific region specified by the id

Locations

Represents the different locations, e.g. Gentofte Hospital or Odense Universitetshospital

APIDescription
GET api/v1/locations

Gets all locations

GET api/v1/locations/{id}

Gets specific location specified by the id

JobTypes

Represents the different job types, e.g. Vikariat or Fast ansættelse

APIDescription
GET api/v1/jobtypes

Gets all job types

GET api/v1/jobtypes/{id}

Gets specific job type specified by the id

Skills

Represents the different skills, e.g. Almen medicin or Geriatri

APIDescription
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

WeeklyWorkingHours

Represents the different weekly working hour options, e.g. Fuld tid or Deltid over 21 timer

APIDescription
GET api/v1/weeklyworkinghours

Gets all weekly working hours

GET api/v1/weeklyworkinghours/{id}

Gets specific weekly working hour specified by the id

Adverts

This is the actual adverts created by the regions. See POST and PUT for details

APIDescription
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

Professions

Represents the different professions, e.g. 1. Reservelæge or Afdelingslæge

APIDescription
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

Example

1. Creating a new advert

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:

  • ProfessionGroup
  • Title
  • DeadlineDate
  • Locations
  • Skills
  • Professions
  • Content
  • WeeklyWorkingHours
  • JobType
  • Employer
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"
}

2. Updating an advert

This is an example of how you would update an advert through the API. To update an advert the following details are required:

  • Id of the advert
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"
}

Error messages

Below is the possible Bad Request (400) error messages

  • No data received
  • Title is required
  • Title can max be 255 characters
  • Number can max be 255 characters
  • ApplyLink is required
  • DeadlineDate is required
  • DurationOfHiring is required
  • Summary can max be 255 characters
  • Content is required
  • Employer is required
  • Employer.Name is required
  • Employer.ContactPersonFirstName is required
  • Employer.ContactPersonLastName is required
  • Employer.Address is required
  • Locations is required
  • No Locations found
  • ProfessionGroup is required
  • ProfessionGroup not found
  • No Skills found
  • No Professions found
  • WeeklyWorkingHours is required
  • WeeklyWorkingHours not found
  • JobType is required
  • JobType not found