API Employers

See API Specification

Anyone using the API should also become very familiar with our schema documentation which contains important details about individual database table columns.
See Employer Database Schema.

Employers GET (single)

Version Added: 23.3.22

Gets a single employer.

Parameters:

EmployerNum: Required in URL.

Example Request:
GET /employers/7

Example Response:
{
"EmployerNum": 7,
"EmpName": "Sergio and Sons Co,"
"Address": "7804 West Cactus Lane",
"Address2": "Building C, Unit 12",
"City": "Mesa",
"State": "AZ",
"Zip": "85201",
"Phone": "(480) 555-0198"
}

200 OK
404 NotFound (with explanation)

Employers GET (multiple)

Version Added: 23.3.22

Gets a list of employers.

Example Requests:
GET /employers

Example Response:
[
{
"EmployerNum": 1,
"EmpName": "Store Mart,"
"Address": "55 Atlantic Wharf",
"Address2": "Dock Office 3",
"City": "Portland",
"State": "ME",
"Zip": "04101",
"Phone": "(207) 555-0112"
},
{
"EmployerNum": 2,
"EmpName": "Townville Hospital,"
"Address": "1309 South Market Street",
"Address2": "Warehouse Annex",
"City": "Wichita",
"State": "KS",
"Zip": "67202",
"Phone": "(316) 555-0164"
},
etc...
]

200 OK

Employers POST (create)

Version Added: 21.4

Creates a new employer.

EmpName: Required. The employer's name.

Example Request:
POST /employers

{
"EmpName": "James Smith Confectionery Co."
}

Example Response:
{
"EmployerNum": 4,
"EmpName": "James Smith Confectionery Co.",
"Address": "",
"Address2": "",
"City": "",
"State": "",
"Zip": "",
"Phone": ""
}

201 Created
400 Bad Request (with explanation)

Employers PUT (update)

Version Added: 21.4

Updates the employer's name.

EmployerNum: Required in the URL.

EmpName: Required. The Employer's name.

Example Request:
PUT /employers/5

{
"EmpName": "Silver Pine Outfitters"
}

Example Response:
{
"EmployerNum": 5,
"EmpName": "Silver Pine Outfitters",
"Address": "",
"Address2": "",
"City": "",
"State": "",
"Zip": "",
"Phone": ""
}

200 OK
400 BadRequest (with explanation)
404 NotFound (with explanation)

Employers DELETE

Version Added: 23.3.22

Deletes an employer. Employers associated with a patient or an insurance plan cannot be deleted.

EmployerNum: Required in the URL.

Example Request:
DELETE /employers/4

Example Response:
200 OK
400 BadRequest (with explanation)
404 NotFound (with explanation)