API/Sites
Sites
Get site data with nested structure
Authorization
Authorization
RequiredBearer <token>In: header
Path Parameters
id
stringID of the site. Default is all sites.
Pattern:
"^[0-9a-fA-F]{24}$"
Response Body
Response with an array of sites (may be a single-element array for specific site requests)
TypeScript Definitions
Use the response body type in TypeScript.
data
Requiredarray<object>message
Requiredstringmeta
objectStandard error response
TypeScript Definitions
Use the response body type in TypeScript.
error
RequiredobjectStandard error response
TypeScript Definitions
Use the response body type in TypeScript.
error
RequiredobjectStandard error response
TypeScript Definitions
Use the response body type in TypeScript.
error
RequiredobjectStandard error response
TypeScript Definitions
Use the response body type in TypeScript.
error
Requiredobjectcurl -X GET "https://example.com/sites/507f1f77bcf86cd799439011" \
-H "Authorization: Bearer <token>"
fetch("https://example.com/sites/507f1f77bcf86cd799439011", {
headers: {
"Authorization": "Bearer <token>"
}
})
package main
import (
"fmt"
"net/http"
"io/ioutil"
)
func main() {
url := "https://example.com/sites/507f1f77bcf86cd799439011"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := ioutil.ReadAll(res.Body)
fmt.Println(res)
fmt.Println(string(body))
}
import requests
url = "https://example.com/sites/507f1f77bcf86cd799439011"
response = requests.request("GET", url, headers = {
"Authorization": "Bearer <token>"
})
print(response.text)
{
"data": [
{
"id": "507f1f77bcf86cd799439011",
"name": "California Factory - CAL01",
"description": "Automated Assembly Factory",
"lines": [
{
"id": "507f1f77bcf86cd799439011",
"name": "FATP Line",
"description": "Assembly line",
"elements": [
{
"id": "507f1f77bcf86cd799439011",
"name": "Top Assembly 1",
"description": "First of the assembly stations",
"type": "station"
}
]
}
]
}
],
"message": "Success",
"meta": {
"timestamp": "2019-08-24T14:15:22Z",
"request_id": "c2ed3e07-8c5f-4be9-b7ec-86bddcedd154",
"query_duration_ms": 0
}
}
{
"error": {
"code": "string",
"message": "string",
"details": null
}
}
{
"error": {
"code": "string",
"message": "string",
"details": null
}
}
{
"error": {
"code": "string",
"message": "string",
"details": null
}
}
{
"error": {
"code": "string",
"message": "string",
"details": null
}
}