Query Companies

List of paths to query for all companies across an application.

Note: /v1.0/admin path requires a client_credential grant access token.

Methods & Paths#

MethodURINameSummary
GET/v1.0/admin/companiesCompanyRetrieve all companies for current application
GET/v1.0/admin/companies/{company_id}Company ListRetrieve a company
GET/v1.0/admin/companies/countCompany CountCount all companies for current application

Query Parameters#

NameSourceType
application_idquerystring
limitquerynumber
pagequerynumber
user_idquerystring

Responses#

CodeStatusDescriptionHas headersSchema
200OKSuccessful company retrievalschema
400Bad RequestBad request sent to serverschema
401UnauthorizedYou are unauthorizedschema
403ForbiddenYou are forbidden to perform this actionschema

Company Model#

NameTypeRequiredExample
addressstringโœ“3900 W Alameda Ave
application_idstringuuid
citystringโœ“Burbank
countrystringโœ“USA
created_atdate (formatted string)1970-01-01T00:00:00.000Z
idnumber1
industrystringโœ“[\"IoT\"]
latitudenumber34.1526642
longitudenumber-118.3428161
namestringโœ“My Company
statestringCA
statusnumber0
timezonestringAmerica/Los_Angeles
updated_atdate (formatted string)1970-01-01T00:00:00.000Z
user_idstringuuid
zipstringโœ“91505

Example#

List all Companies within your domain

We will use the token obtained in the previous call and use it to list all companies within our domain.

alt text Remember to use the access token obtained from the OAuth call when making any queries.

curl --request GET --url https://api.iotinabox.com/v1.0/admin/companies \
--header 'authorization: Bearer YourAuthToken' \
--header 'content-type: application/json'

Example Response:

{
"count": 3,
"limit": 100,
"page": 0,
"rows": [
{
"id": 881,
"name": "neosmart",
"industry": "[\"Food & Beverage\"]",
"address": "1 Rocket Rd",
"city": "Hawthorne",
"state": "CA",
"zip": "90250",
"country": "United States",
"latitude": 33.9206814,
"longitude": -118.3280263,
"timezone": "America/Los_Angeles",
"user_id": "f8ef7b38-daf7-45a2-a0b2-1d8f1a0e5455",
"application_id": "neosmart",
"status": 0,
"created_at": "2019-04-26T18:16:12.000Z",
"updated_at": "2019-04-26T18:16:12.000Z"
},
{
"id": 882,
"name": "Safeway",
"industry": "[\"Food & Beverage\"]",
"address": "3333 Arapahoe Rd",
"city": "Erie",
"state": "CO",
"zip": "80516",
"country": "United States",
"latitude": 40.0169468,
"longitude": -105.1008409,
"timezone": "America/Denver",
"user_id": "829c4031-f93a-42bb-859b-aa7135482c00",
"application_id": "neosmart",
"status": 0,
"created_at": "2019-04-26T18:28:36.000Z",
"updated_at": "2019-04-26T18:28:36.000Z"
},
{
"id": 884,
"name": "NeoSmart",
"industry": "[\"Food & Beverage\"]",
"address": "200 I St NE",
"city": "Miami",
"state": "OK",
"zip": "74354",
"country": "United States",
"latitude": 36.8795784,
"longitude": -94.8674195,
"timezone": "America/Chicago",
"user_id": "8284bd9b-f00a-4689-b5ed-aed736c5716c",
"application_id": "neosmart",
"status": 0,
"created_at": "2019-04-26T18:37:12.000Z",
"updated_at": "2019-04-26T18:37:12.000Z"
}
]
}