(POST) Create Area API 

Description

This API endpoint will allow a customer to create a new area in an existing business, group and department. The new area will be added to the hierarchy of the business. 

URL

https://apiprod.pdsglobal.com/V2/api/area/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).

departmentId

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

areaTypeId*

Primary key of the Area Type. You can get the areaTypeId from the (GET) All AreaTypes API, areaTypeId is part of its response.

Body

Object: CreateArea

name* - string(50)
The name of the Area. The name must be unique in the hierarchy at the area 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
       - areaId:XXX

400 - HTTP Response Bad Request
       -  Missing API Key
       -   departmentId and areaTypeId parameters not provided (If both required parameters are missing)
       -   areaTypeId parameter is not provided
       -   Invalid departmentId and areaTypeId (both parameters are invalid)

       - Invalid departmentId
       - Invalid areaTypeId

       - name is not provided on the json request body
       - Area name is already existing on departmentId :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 Area and the areaId will be the response
- Invalid Security Token
- Invalid/Incorrect API Key
- Missing Content-Type header
- Error connecting to PDS Server
- departmentId and areaTypeId parameters not provided (If both required parameters
are missing)
- areaTypeId parameter is not provided
- departmentId parameter is not provided
- Invalid departmentId and areaTypeId (both parameters are invalid)
- Invalid departmentid
- Invalid areaTypeId
- name is not provided on the json request body
- Area name is already existing on departmentId:XXX

Examples

Example URL:
https://apiprod.pdsglobal.com/V2/api/area/V1&api_key=xxx123&groupId=1&areaTypeId=1

Request Example Body

{"name":"Test 1 Area", 

"functionalLocation":"Test 1 Area functional location" 

}

Successful Response Example Body:

{
  "areaId":  140
}

 

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

Articles in this section

prev next

Related sections