Org department APIs

Org department list

OVERVIEW

 

Overview

This API call is used to get a list of departments in an organisation object in the system. 

 

HTTP Request

GET /api/5/organisations/departments?orgid=<ORGID>&ordertype={ordertype}&orderby={orderby}&search={departmentname}

URL Parameters

Parameter Description
ORGID The ID of the organisation of which the departments to be listed
ordertype Field on which sorting will be applied. It has to be ID or the name of the department.
orderby The sorting order, either asc or desc.
search The field on which searching will be done. Only supported field is departmentname

 

HTTP Response

Success

HTTP response 200

Error

See API Error messages

Example

GET http://example.com/context/api/5/organisations/departments?orgid=123&ordertype=departmentname&orderby=desc&search=abc

 

XML format

<departments>
	<department>
		<id>1</id>
		<name>IT</name>
		<status>active</status>
		<link>https://jigneshkd.local.com/jigneshd_4_live/api/4/organisations/departments/15</link>
	</department>
	<department>
		<id>2</id>
		<name>SALES</name>
		<status>active</status>
		<link>https://jigneshkd.local.com/jigneshd_4_live/api/4/organisations/departments/16</link>  
	</department>
</departments>

 

JSON format

{
		"department": [
			{
				"id": "1",
				"name": "IT",
				"status": "active",
				"link": "https://jigneshkd.local.com/jigneshd_4_live/api/4/organisations/departments/15"

			},
			{
				"id": "2",
				"name": "SALES",
				"status": "active",
				"link": "https://jigneshkd.local.com/jigneshd_4_live/api/4/organisations/departments/16"

			}
		]
}

 

Error messages

Summary Ref Code (V4) Ref Code (before V4)

The ordertype is invalid. name and ID are supported ordertype

351  

The orderby value is invalid. asc and desc are supported orderby values.

147  

The Organisation ID is invalid

260  

You do not have access to the given organisation ID

318  

Comments


0 Comments

Last Updated: Jun 09,2023