Skip to content
This repository was archived by the owner on Jan 12, 2021. It is now read-only.

Sub Organizations

Johnathan Ludwig edited this page Jan 27, 2015 · 1 revision

Actions

List

List a pageable response of 25 records per page.

api.sub_organizations.list
> [
    {
                   "id" => 1,
      "organization_id" => 1,
                 "name" => "Test",
           "created_at" => "2014-06-23T18:53:25.531Z",
           "updated_at" => "2014-09-03T12:32:50.472Z"
    }
  ]

Show

Show a specific sub organization

Parameters

Name Type Description
id integer Required. The ID of the record.

Example

api.sub_organizations.show(id: 1)
> {
                 "id" => 1,
    "organization_id" => 1,
               "name" => "Test",
         "created_at" => "2014-06-23T18:53:25.531Z",
         "updated_at" => "2014-09-03T12:32:50.472Z"
  }

Update

Update the name of a specific sub organization

Parameters

Name Type Description
id integer Required. The ID of the record.
name string Required. The new name for the record.

Example

api.sub_organizations.update(id: 1, name: 'Test')
> {
                 "id" => 1,
    "organization_id" => 1,
               "name" => "Test",
         "created_at" => "2014-06-23T18:53:25.531Z",
         "updated_at" => "2014-09-24T18:37:02.252Z"
  }

Create

Create a new sub organization

Parameters

Name Type Description
name string Required. The name of the record.

Example

api.sub_organizations.create(name: 'Test')
> {
                 "id" => 3,
    "organization_id" => 1,
               "name" => "Test",
         "created_at" => "2014-09-24T18:39:25.493Z",
         "updated_at" => "2014-09-24T18:39:25.493Z"
  }

Destroy

Destroy a sub organization

Note: This action will also destroy every team, external account, and report under the sub organization.

Parameters

Name Type Description
id integer Required. The ID of the record.

Example

api.sub_organizations.destroy(id: 3)
> {
    "success" => "Test has been destroyed"
  }

Clone this wiki locally