(POST) Create Group API 

Description

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

URL

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

businessId*

Primary key of the Business where you want to create a new group. You can get the businessId from the (GET) All Business API, businessId is part of its response.

Body

Object: CreateGroup

name* - string(50)
The name of the group. 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
       - groupId:XXX

400 - HTTP Response Bad Request
       -  Missing API Key
       -   businessId parameter is not provided
       - Invalid businessId
       - name is not provided on the json request body
       - Group name is already existing on businessId: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 Group and the groupId will be the response
- Invalid Security Token
- Invalid/Incorrect API Key
- Missing Content-Type header
- Error connecting to PDS Server
- businessId parameter is not provided
- Invalid businessId
- name is not provided on the json request body
- Group name is already existing on businessId:XXX

Examples

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

Request Example Body

{"name":"Test 1 Group", 

"functionalLocation":"Test 1 Group functional location" 

} 

Successful Response Example Body:

{
  "groupId":  21
}

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

Articles in this section

prev next

Related sections