Organization Resource

Table of Contents

  • Get Organization
  • Get Running
  • List data sources
  • Create data source
  • Get data source
  • Update data source
  • Delete data source

Get Organization

Fetch a single organization.

Request

Method: GET

URL: https://api.ghostinspector.com/v1/organizations/{{organizationId}}/?apiKey={{apiKey}}

Query parameters

apiKey
Your API key provided in your account
organizationId
The ID of the organization to fetch
{
"code": "SUCCESS",
"data": {
"_id": "5aed177226a8722dad009e39",
"address": "123 Front Street",
"city": "Seattle",
"country": "US",
"dateCreated": "2022-01-06T23:23:23.521Z",
"email": "email@domain.com",
"emailBilling": "billing@domain.com",
"name": "Organization Name",
"plan": {
"advancedScheduling": true,
"maxCsvUploadRows": 10000,
"maxViewportSize": {
"width": 100,
"height": 200,
},
"memberCount": 5,
"name": "Plan Name",
"overagePrice": 1.00,
"price": 100.00,
"retentionMonths": 12,
"screenshotSteps": false,
"testRuns": 100000,
"yearly": true,
},
"postalCode": "98108",
"state": "Washington",
"suiteCount": 1,
"testCount": 2,
"testRuns": {
"2022-01": 4000,
},
}
}

Get Running

Fetch a list of the currently-executing results for the entire organization and return the results.

Request

Method: GET

URL: https://api.ghostinspector.com/v1/organizations/{{organizationId}}/running/?apiKey={{apiKey}}

Query parameters

apiKey
Your API key provided in your account
organizationId
The ID of the organization to get results for
{
"code": "SUCCESS",
"data": [
{
"_id": "5e2b6294854c611834aa6cde",
"autoRetry": false,
"autoRetryTriggered": false,
"browser": "chrome",
"commentCount": 0,
"comments": [],
"console": [],
"dateCreated": "2020-01-24T21:33:08.870Z",
"dateExecutionStarted": "2020-01-24T21:33:09.571Z",
"disableVisuals": false,
"disallowInsecureCertificates": false,
"endUrl": "",
"executionHost": "test001.ghostinspector.net",
"executionTime": null,
"failOnJavaScriptError": false,
"filters": [],
"finalDelay": 0,
"globalStepDelay": 250,
"language": null,
"maxAjaxDelay": 10000,
"maxWaitDelay": 15000,
"name": "Login and Check Dashboard",
"organization": "5a1b419ae40144279f9ac680",
"passing": null,
"region": "us-east-1",
"screenshotCompareBaselineResult": null,
"screenshotCompareDifference": null,
"screenshotCompareEnabled": true,
"screenshotComparePassing": null,
"screenshotCompareThreshold": 0.01,
"startUrl": "https://ghostinspector.com",
"steps": [
{
"_id": "5e2b5ce5854c611834aa6cd2",
"command": "click",
"condition": null,
"extra": {
"source": {
"sequence": 0,
"test": "5e2a0b342d0f5947444c31fc"
}
},
"notes": "",
"optional": false,
"passing": null,
"private": false,
"sequence": 0,
"target": ".site-logo a",
"value": "",
"variableName": ""
}
{
"_id": "5e2b5ce5854c611834aa6cd1",
"command": "assertTextPresent",
"condition": null,
"extra": {
"source": {
"sequence": 1,
"test": "5e2a0b342d0f5947444c31fc"
}
},
"notes": "",
"optional": false,
"passing": null,
"private": false,
"sequence": 1,
"target": "h1",
"value": "Automated",
"variableName": ""
}
],
"suiteResult": null,
"test": {
"_id": "5e2a0b342d0f5947444c31fc",
"name": "Login and Check Dashboard",
"organization": "5a1b419ae40144279f9ac680",
"suite": "5a1e1b90154014760af39ef5"
},
"urls": [],
"user": {
"_id": "55b2accc4f66690c07294201",
"name": "Justin Klemm"
},
"uuid": "6e930f8b-37f4-42e6-a4a1-11d85cf57fd0",
"viewportSize": {
"height": 768,
"width": 1024
}
}
]
}

List data sources

List data sources for an organization.

Request

Method: GET

URL: https://api.ghostinspector.com/v1/organizations/{{organizationId}}/data-sources?apiKey={{apiKey}}

Query parameters

apiKey
Your API key provided in your account
organizationId
The ID of the organization to fetch data sources for
{
"code": "SUCCESS",
"data": [
{
"name": "My Data Source",
"organization": "5a0604918ee17043538a1b2c",
"data": [
{
"firstName": "Jim",
"lastName": "Brown",
"num": "2",
"square": "4"
},
{
"firstName": "Bob",
"lastName": "Smith",
"num": "3",
"square": "9"
},
{
"firstName": "Pat",
"lastName": "Jones",
"num": "4",
"square": "16"
}
],
"_id": "5f457c8aea0986258392bc8b"
}
]
}

Create data source

Create data source for organization.

Request

Method: POST

URL: https://api.ghostinspector.com/v1/organizations/{{organizationId}}/data-sources?apiKey={{apiKey}}

Query parameters

apiKey
Your API key provided in your account
organizationId
The ID of the organization to fetch data sources for

Request Example using cURL

POST request with JSON body
curl https://api.ghostinspector.com/v1/organizations/{{organizationId}}/data-sources?apiKey={{apiKey}}
-X POST \
-H "Content-Type: application/json" \
-d '{"name": "My Data Source", "data": [{"colour": "blue", "count": 2}, {"colour": "red", "count": 3}]}'
{
"code": "SUCCESS",
"data": [
{
"name": "My Data Source",
"organization": "5a0604918ee17043538a1b2c",
"data": [
{
"colour": "blue",
"count": 2
},
{
"colour": "red",
"count": 3
}
],
"_id": "5f457c8aea0986258392bc8b"
}
]
}

Get data source

Get a data source.

Request

Method: GET

URL: https://api.ghostinspector.com/v1/organizations/{{organizationId}}/data-sources/{{dataSourceId}}?apiKey={{apiKey}}

Query parameters

apiKey
Your API key provided in your account
organizationId
The ID of the organization to fetch data sources for
dataSourceId
The ID of the data source
{
"code": "SUCCESS",
"data": [
{
"name": "My Data Source",
"organization": "5a0604918ee17043538a1b2c",
"data": [
{
"firstName": "Jim",
"lastName": "Brown",
"num": "2",
"square": "4"
},
{
"firstName": "Bob",
"lastName": "Smith",
"num": "3",
"square": "9"
},
{
"firstName": "Pat",
"lastName": "Jones",
"num": "4",
"square": "16"
}
],
"_id": "5f457c8aea0986258392bc8b"
}
]
}

Update data source

Update a data source.

Request

Method: POST

URL: https://api.ghostinspector.com/v1/organizations/{{organizationId}}/data-sources/{{dataSourceId}}?apiKey={{apiKey}}

Query parameters

apiKey
Your API key provided in your account
organizationId
The ID of the organization to fetch data sources for
dataSourceId
The ID of the data source to update

Request Example using cURL

POST request with JSON body
curl https://api.ghostinspector.com/v1/organizations/{{organizationId}}/data-sources/{{dataSourceId}}?apiKey={{apiKey}}
-X POST \
-H "Content-Type: application/json" \
-d '{"name": "My Data Source", "data": [{"colour": "green", "count": 5}, {"colour": "red", "count": 3}]}'
{
"code": "SUCCESS",
"data": [
{
"name": "My Data Source",
"organization": "5a0604918ee17043538a1b2c",
"data": [
{
"colour": "green",
"count": 5
},
{
"colour": "red",
"count": 3
}
],
"_id": "5f457c8aea0986258392bc8b"
}
]
}

Delete data source

Delete a data source.

Request

Method: DELETE

URL: https://api.ghostinspector.com/v1/organizations/{{organizationId}}/data-sources/{{dataSourceId}}?apiKey={{apiKey}}

Query parameters

apiKey
Your API key provided in your account
organizationId
The ID of the organization to fetch data sources for
dataSourceId
The ID of the data source to update