Integrations

Get All Integrations

curl "https://example.ziik.io/api/integrations"
  -H "Authorization: Bearer aaaaaaaaa.bbbbbbbbb.cccccccccc"

The above command returns JSON structured like this:

{
  "hits": [
    {
      "id": 1,
      "name": "onelogin",
      "enabled": false,
      "settings": {
        "base_uri": "api.us.onelogin.com",
        "subdomain": "",
        "client_id": "",
        "client_secret": "",
        "unit": {
          "default": ""
        }
      },
      "url": "api/integrations/1",
      "permissions": {
        "edit": true,
        "delete": true
      },
      "rules": []
    },
    {
      "id": 3,
      "name": "samesystem",
      "enabled": false,
      "settings": {
        "email": "Info@ziik.io",
        "password": "12345678",
        "unit": {
          "default": ""
        }
      },
      "url": "api/integrations/3",
      "permissions": {
        "edit": true,
        "delete": true
      },
      "rules": []
    },
    {
      "id": 6,
      "name": "tamigo",
      "enabled": false,
      "settings": {
        "key": "",
        "unit": {
          "default": ""
        }
      },
      "url": "api/integrations/6",
      "permissions": {
        "edit": true,
        "delete": true
      },
      "rules": []
    }
  ],
  "meta": {
    "pagination": {
      "total": 3,
      "count": 3,
      "per_page": 50,
      "current_page": 1,
      "total_pages": 1,
      "links": []
    }
  }
}

This endpoint retrieves integration settings for the site.

HTTP Request

GET https://example.ziik.io/api/integrations

Query Parameters

ParameterTypeDefaultDescription
pageInteger1Page number for pagination.
limitInteger50Number of records to return per page.

Permissions Required

  • Manage integrations permission

Create New Integration

$api->post('integrations', 'App\Api\V1\Controllers\IntegrationController@store')->middleware('can:manage,App\Integration');

curl -i -X POST "https://example.ziik.io/api/integrations"
  -H "Authorization: Bearer aaaaaaaaa.bbbbbbbbb.cccccccccc"
  -d "{ [...] }"

The above command returns 201 Created with a location header for where to find the new integration

HTTP/1.0 201 Created
Location: https://example.ziik.io/api/integrations/1234
{
    "message": "Integration created"
}

This endpoint creates a new integration definition.

HTTP Request

POST https://example.ziik.io/api/integrations

Request Parameters

ParameterTypeRequiredDescription
nameStringYesName of the new group.
enabledBooleanNoWhether the integration is enabled.
settingsArrayNoIntegration specific settings

Permissions Required

  • Manage integrations permission

Get Single Integration

curl "https://example.ziik.io/api/integrations/123"
  -H "Authorization: Bearer aaaaaaaaa.bbbbbbbbb.cccccccccc"

The above command returns JSON structured like this:

{
  "id": 1,
  "name": "onelogin",
  "enabled": false,
  "settings": {
    "base_uri": "api.us.onelogin.com",
    "subdomain": "",
    "client_id": "",
    "client_secret": "",
    "unit": {
      "default": ""
    }
  },
  "url": "api/integrations/1",
  "permissions": {
    "edit": true,
    "delete": true
  },
  "rules": []
}

This endpoint returns a single integration

HTTP Request

GET https://example.ziik.io/api/integrations/ID

URL Parameters

ParameterTypeDescription
IDIntegerThe ID of the integration

Permissions Required

  • Manage integrations permission

Update Integration

$api->patch('integrations/{integration}', 'App\Api\V1\Controllers\IntegrationController@update')->middleware('can:manage,integration');

Delete Integration

$api->delete('integrations/{integration}', 'App\Api\V1\Controllers\IntegrationController@destroy')->middleware('can:manage,integration');

Get Roles From Integration

$api->get('integrations/{integration}/roles', 'App\Api\V1\Controllers\IntegrationController@roles')->middleware('can:manage,integration');

Create Integration Rule

$api->post('integrations/{integration}/rules', 'App\Api\V1\Controllers\IntegrationController@rules')->middleware('can:manage,integration');

Get Single Integration Rule

$api->get('integrations/{integration}/rules/{rule}', 'App\Api\V1\Controllers\IntegrationRuleController@show')->middleware('can:manage,integration');

Update Integration Rule

$api->patch('integrations/{integration}/rules/{rule}', 'App\Api\V1\Controllers\IntegrationRuleController@update')->middleware('can:manage,integration');

Delete Integration Rule

$api->delete('integrations/{integration}/rules/{rule}', 'App\Api\V1\Controllers\IntegrationRuleController@destroy')->middleware('can:manage,integration');