Organisation APIs

Get Organisation list

OVERVIEW

Overview

Get a list of organisations from Publisher

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

Since v4.6

HTTP Request

GET  /api/2/organisations?{parameters}

URL Query Parameters
Parameter Format Description
domain String Domain to search for. If more than one is specified, this should be in a comma separated list
autologin String Auto login: true | false
homepage String The ID of the homepage
industry String The ID of the organisation industry
category String The ID of the organisation category
locations String Locations. If more than one is specified, this should be in a comma separated list. This will be a search across any of the fields within the Organisation location.
search String Will search across all organisation fields for a matching string. This should be the same search
status  String Status:  active | archive | disabled | suspended.
sort String

Allow ascending and descending sorting of a single field.

GET /api/2/organisations?sort=-created

This returns a list of organisations sorted by descending created date.

possible fields: id, name, status, url

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 Object will be returned for all users

GET /api/2/organisations?fields=id,name,status

limit String

Limits the number of organisations returned. e.g.

GET /api/2/organisations?offset=10&limit=5

Default: 200

offset String

Allows paging of organisations. e.g.

GET /api/2/organisations?offset=10&limit=5

Default: 0

createdDate 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/organisations?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/organisations?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 summary Object 

(Example below)

 

Error

See API Error messages

 

Example HTTP Request & Response

Query String:  (Domain == (google.com OR apple.com)) AND (Locations == (London OR New York OR Ahmedabad))

GET http://example.com/context/api/2/organisations?domain=google%2Ecom,apple%2Ecom&locations=London,New%20York,Ahmedabad

 

JSON Response

{

    "total": 2,   

    "currentpage": 0,  

    "organisations": [

        {

            "id": 3,

            "name": "Google",

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

        },

        {

            ....

        }

    ]

}

 

 

XML Response

<organisations>

    <total>2</total>

    <currentpage>0</currentpage>

    <organisation>

        <id>3</id>

        <name>Google</name>

        <link>http://example.com/context/api/2/organisations/3</link>
           
    </organisation>

    <organisation>

        ....

    </organisation>

</organisations>

 

Comments


0 Comments

Last Updated: Nov 08,2024