(POST) Create Department API 

Description

This API Endpoint will allow a customer to create a new department in an existing business. The new department will be added to the hierarchy of the business. 

URL

https://apiprod.pdsglobal.com/V2/api/department/V1

There are two non-production environments that can be used for testing.

Request

Mandatory Fields are denoted by *

Type

POST

Headers

Content-Type = application/json

Parameters

Api_key*
This is required for authentication. If you do not have your API key please contact PDS Support (support@pdsglobal.com).

groupId*

Primary key of the group where you want to create a new department. You can use the groupId that is in the response of (GET) Area Details API.

Body

Object: CreateDepartment

name* - string(50)
The name of the department. The name must be unique in the hierarchy at the group level.

functionalLocation - string(50) 

A functional location can be added to reference the group to external software like SAP. This is just free text, not a link.


Response

After sending through your data, the API call will return a response entity with a body and a status. The response entity will let you know if the data you sent through was successful or unsuccessful.

Status

200 - HTTP Response OK
       - DepartmentId:XXX

400 - HTTP Response Bad Request
       -  Missing API Key
       - groupId parameter is not provided
       - Invalid groupId
       - name is not provided on the json request body
       - Department name is already existing on groupIid:XXX

403 - HTTP Response Forbidden
       - Invalid/Incorrect API Key
       - Non “API User” role.

500 - HTTP Response Internal Server Error

Body

Object: ResponseEntity
The ResponseEntity object will contain a string or object value. This will have an error or success message – examples below:

- Successfully created Department and the departmentId will be the response.
- Invalid Security Token.
- Invalid/Incorrect API Key.
- Missing Content-Type header.
- Error connecting to PDS Server.
- groupId parameter is not provided.
- Invalid  groupId.
- name is not provided on the json request body.
- Department name is already existing on  groupId:XXX.

Examples

Example URL:
https://apiprod.pdsglobal.com/V2/api/group/V1?api_key=xxx123&businessId=1

Request Example Body

{"name":"Test 1 Department", 

"functionalLocation":"Test 1 Department functional location" 

}

Successful Response Example Body:

{
  "departmentId":  45
}

 

prev next
Was this article helpful?
0 out of 0 found this helpful

Articles in this section

prev next

Related sections