PebblePad : API documentation

Organisational Unit

Provides the methods for interacting with organisational units held in the Data Island. Each record has a unique Id that is provided by you and should to match those in your own systems.

Methods

Method HTTP request Description
Create POST https://v3.pebblepad.co.uk/api/1.1/di/Organisational Unit/Create/ Adds a new Organisational Unit to Data Island.
Delete DELETE https://v3.pebblepad.co.uk/api/1.1/di/Organisational Unit/Delete/ Deletes an Organisational Unit from Data Island.
Get GET https://v3.pebblepad.co.uk/api/1.1/di/Organisational Unit/Get/{id} Gets a specific Organisational Unit
GetAll GET https://v3.pebblepad.co.uk/api/1.1/di/Organisational Unit/GetAll/ Gets the list of all Organisational Units
Update POST https://v3.pebblepad.co.uk/api/1.1/di/Organisational Unit/Update/ Updates an Organisational Unit in Data Island.

Methods

Create

Adds a new Organisational Unit to Data Island.

Scope Required

admin_organisational_units:c

Request

POST https://v3.pebblepad.co.uk/api/1.1/di/Organisational Unit/Create/

Example request

POST api/1.1/di/OrganisationalUnit/Create HTTP/1.1
Host: https://v3.pebblepad.co.uk/
Authorization: Bearer xxxxxxxxxxxxxxxx
{
  "id":"aa85e6f1-67d4-4892-9102-2ea2e7dd7495",
  "description":"OU 1",
  "createatlasregion":true,
  "title":"Organisational Unit 1"
} 

Response

HTTP / 1.1 200 (OK)
"aa85e6f1-67d4-4892-9102-2ea2e7dd7495" 

Example error response

HTTP/1.1 400 (Bad Request)
{
  "errormessage":"Id for the given Course is already being used."
  "erroritem":"aa85e6f1-67d4-4892-9102-2ea2e7dd7495"
} 

Delete

Deletes an Organisational Unit from Data Island.

Scope Required

admin_organisational_units:d

Request

DELETE https://v3.pebblepad.co.uk/api/1.1/di/Organisational Unit/Delete/

Example request

DELETE api/1.1/di/OrganisationalUnit/Delete/aa85e6f1-67d4-4892-9102-2ea2e7dd7495 HTTP/1.1
Host: https://v3.pebblepad.co.uk/
Authorization: Bearer xxxxxxxxxxxxxxxx 

Response

HTTP / 1.1 200 (OK)
"aa85e6f1-67d4-4892-9102-2ea2e7dd7495" 

Example error response

HTTP/1.1 400 (Bad Request)
{
  "errormessage":"No Organisation Unit was found with the given Id",
  "erroritem":"aa85e6f1-67d4-4892-9102-2ea2e7dd7495"
} 

Get

Gets a specific Organisational Unit

Scope Required

admin_organisational_units:r

Request

GET https://v3.pebblepad.co.uk/api/1.1/di/Organisational Unit/Get/{id}

Parameters

Parameter name Value Required Description
id string Yes Organisational Unit Id

Example request

GET api/1.1/di/OrganisationalUnit/Get/aa85e6f1-67d4-4892-9102-2ea2e7dd7495 HTTP/1.1
Host: https://v3.pebblepad.co.uk/
Authorization: Bearer xxxxxxxxxxxxxxxx 

Response

HTTP / 1.1 200 (OK)
{
  "id":"aa85e6f1-67d4-4892-9102-2ea2e7dd7495",
  "description":"OU 1",
  "createatlasregion":true,
  "title":"Organisational Unit 1"
} 

Example error response

HTTP/1.1 400 (Bad Request)
{
  "errormessage":"No Organisation Unit was found with the given Id",
  "erroritem":"aa85e6f1-67d4-4892-9102-2ea2e7dd7495"
} 

GetAll

Gets the list of all Organisational Units

Scope Required

admin_organisational_units:r

Request

GET https://v3.pebblepad.co.uk/api/1.1/di/Organisational Unit/GetAll/

Example request

GET api/1.1/di/OrganisationalUnit/GetAll HTTP/1.1
Host: https://v3.pebblepad.co.uk/
Authorization: Bearer xxxxxxxxxxxxxxxx 

Response

HTTP / 1.1 200 (OK)
[
  {
  "id":"aa85e6f1-67d4-4892-9102-2ea2e7dd7495",
  "description":"OU 1",
  "createatlasregion":true,
  "title":"Organisational Unit 1"
  },
  {
  "id":"ba85e6f1-67d4-4892-9102-2ea2e7dd746",
  "description":"OU 2",
  "createatlasregion":false,
  "title":"Organisational Unit 2"
  }
] 

Example error response

Update

Updates an Organisational Unit in Data Island.

Scope Required

admin_organisational_units:u

Request

POST https://v3.pebblepad.co.uk/api/1.1/di/Organisational Unit/Update/

Example request

POST api/1.1/di/OrganisationalUnit/Update/aa85e6f1-67d4-4892-9102-2ea2e7dd7495 HTTP/1.1
Host: https://v3.pebblepad.co.uk/
Authorization: Bearer xxxxxxxxxxxxxxxx
{
  "id":"aa85e6f1-67d4-4892-9102-2ea2e7dd7495",
  "description":"OU 1",
  "createatlasregion":true,
  "title":"Organisational Unit 1"
} 

Response

HTTP / 1.1 200 (OK)
"aa85e6f1-67d4-4892-9102-2ea2e7dd7495" 

Example error response

HTTP/1.1 400 (Bad Request)
{
  "errormessage":"No Organisation Unit was found with the given Id",
  "erroritem":"aa85e6f1-67d4-4892-9102-2ea2e7dd7495"
}