Organisation Group APIs

Get Organisation Group list

OVERVIEW

Overview

Get a list of organisation groups from Publisher

This API call is used to retrieve a list of organisation groups from the system.

Since v4.6

HTTP Request

GET  /api/2/organisationgroups?{parameters}

URL Parameters
Parameter Format Description
search String Will search across all organisation group fields for a matching string. This should be the same search as at the top of the organisation groups admin page
sort String

Allow ascending and descending sorting over multiple fields.

GET /organisationgroups?sort=-name,+created

This returns a list of organisation groups sorted by descending group name and ascending created date.

possible fields: name, created, updated

fields String

To reduce the network traffic for mobile devices, we can reduce the number of fields returned.

If no fields are specified, an Organisation Summary Object  will be returned for all organisations

If "all" is specified, the full Organisation Group Object will be returned for all organisations

GET /organisationgroups?fields=id,name

limit String

Limits the number of groups returned. 

GET /organisationgroups?offset=10&limit=5

Default: 20

offset String

Allows paging of groups. e.g.

GET /organisationgroups?offset=10&limit=5
Default: 0
createdDateTime String

DateTime within a range. Possible values are:

  • "lastweek" 
  • "lastmonth" 
  • "lastyear" 
  • startDateYYYYMMDD,endDateYYYYMMDD (i.e. createdDate=20170801,20171004  would show Date range - 01 Aug 2017 to 04 Oct 2017)

GET /api/2/organisationgroups?createdDate=lastweek

modifiedDate String

Date String within a range. Possible values are:

  • "lastweek" 
  • "lastmonth" 
  • "lastyear" 
  • startDateYYYYMMDD,endDateYYYYMMDD (i.e. modifiedDate=20170801,20171004  would show Date range - 01 Aug 2017 to 04 Oct 2017)

GET /api/2/organisationgroups?modifiedDate=lastweek

HTTP Headers
HTTP Request Header Description Example
Authorization The API Authorisation token "Bearer XXXXXXXXXXXXX"
Accept

The format of the expected response. 

  • "application/json"
  • "application/xml"

If no parameter is set, JSON is the default response given.

"application/xml"
Content-Type

The format of the provided content.

  • "application/json"
  • "application/xml"

If no parameter is set, JSON is the expected content by default.

"application/json"

 

HTTP Response

Success

HTTP response 200 with a list of Organisation group summary Objects 

(Example below)

 

Error

See API Error messages

 

Example HTTP Request & Response

Query String:  (Search = "finance" AND sort by created)

GET http://example.com/context/api/2/organisationgroups?search=finance&sort=+created

 

 

JSON Response

{

    "total": 4,   

    "currentpage": 0,  

    "organisationgroups": [

        {

            "id": 3,

            "name": "Finance partners",

            "link": "http://example.com/context/api/2/organisationgroups/3"

        },

        {

            ....

        }

    ]

}

 

 

XML Response

<organisationgroups>

    <total>4</total>

    <currentpage>0</currentpage>

    <organisationgroup>

        <id>3</id>

        <name>Finance partners</name>

        <link>http://example.com/context/api/2/organisationgroups/3</link>
           
    </organisationgroup>

    <organisationgroup>

        ....

    </organisationgroup>

</organisationgroups>

Comments


0 Comments

Last Updated: Nov 08,2024