basePath: / definitions: 2FAinfo: description: 2FA method information properties: phone: example: '+15120000000' type: string two_factor_enabled: example: true type: boolean two_factor_method: example: sms type: string AdapterFileConfig: description: Adapter file content and config, to associate this file with a command, use MapAdapterCommand endpoint properties: adapter_name: description: The adapter the file is a part of. type: string file: description: The base64 encoded file content. example: IyEvYmluL2Jhc2gKbWtkaXIgU2hvd1RpbWVBZGFwdGVyCgptdiBzdGFydC5zaCBTaG93VGltZUFkYXB0ZXIKbXYgc3RvcC5zaCBTaG93VGltZUFkYXB0ZXIKbXYgc3RhdHVzLnNoIFNob3dUaW1lQWRhcHRlcgptdiBkZXBsb3kuc2ggU2hvd1RpbWVBZGFwdGVyCm12IHVuZGVwbG95LnNoIFNob3dUaW1lQWRhcHRlcgptdiBzaG93VGltZSBTaG93VGltZUFkYXB0ZXIKCmVjaG8gIlNob3dUaW1lQWRhcHRlciBEZXBsb3llZCI= type: string name: description: The name of the file, spaces ` ` or `-` are not allowed type: string path_name: description: the file path where the adapter file is stored on the client side. For example, on the file system where edge is running. example: start.sh type: string required: - name Assets: description: Assets for the deployment properties: asset_class: description: The names of the services, users, devices, triggers, timers, adapters, portals, plugins or collection that are being updated in the deployment example: adapters type: string asset_id: description: name of a particular asset or empty string for all assets example: adapter_name type: string sync_to_edge: description: specifies whether asset should be synced to all edges example: true type: boolean sync_to_platform: description: specifies whether asset should be synced to platform example: true type: boolean type: object CacheArrayResp: description: list of caches items: $ref: '#/definitions/getCacheResp' type: array Change: description: Owner changes properties: add: example: owner@clearblade.com type: string remove: example: owner@clearblade.com type: string Collection: description: A data set that contains items properties: category: type: string id: format: int64 type: integer name: type: string photoUrls: items: type: string type: array tags: items: type: string type: array required: - name - id ColumnField: items: $ref: '#/definitions/ItemID' type: array DBResp: properties: Data: example: - type: array Total: example: 1 type: integer DataArray: items: $ref: '#/definitions/DataArray2' type: array DataArray2: items: $ref: '#/definitions/DataObject' type: array DataObject: properties: EQ: $ref: '#/definitions/DataObject2' type: object DataObject2: items: $ref: '#/definitions/DataObjectItem' type: array DataObjectItem: properties: item_id: example: 6e0227d8-8a98-454a-951d-a109f813a397 type: string type: object DataPut: properties: $set: properties: columnName: example: newValue type: object query: $ref: '#/definitions/DataQuery' DataQuery: properties: FILTERS: $ref: '#/definitions/DataArray' type: array Error: description: Bad Request error information properties: category: example: User Permissions type: string code: example: 400 type: integer detail: example: Invalid token type: string id: example: f5471393-b45e-42dc-8a13-034284d291f5 type: string level: example: 1 type: integer line: example: /go/src/clearblade/router/newRouter.go:336 type: string lowLevelError: example: {} type: object message: example: Bad request type: string required: - id - code - level - category - message - detail - line ErrorResp: description: Error responses properties: error: $ref: '#/definitions/Error' example: true statusCode: description: Error code example: 400 type: integer required: - error - statusCode type: object FilterQuery: properties: PAGENUM: example: 1 type: integer PAGESIZE: default: 100 type: integer SORT: items: $ref: '#/definitions/SortQuery' minLength: 0 type: array type: object Filters: items: $ref: '#/definitions/Operator' type: array Item: properties: id: format: int64 type: integer name: type: string ItemID: properties: item_id: example: 6e0227d8-8a98-454a-951d-a109f813a397 type: string type: object KVPs: properties: topic: example: temperature/sensorA type: string MapAdapterCommand: description: The information to be used for adding a command to an adapter. properties: architecture: description: The platform the adapter will be running on. example: darwin-amd64 type: string deploy_command: description: The file name that will be running for the deploy command. example: ./deploy.sh type: string logs_command: description: '' example: ./logs.sh type: string os: description: The os this adapter is going to run on. example: linux type: string run_deploy_on_deploy: description: '' example: true type: boolean run_start_on_deploy: description: '' example: true type: boolean run_stop_on_deploy: description: '' example: true type: boolean start_command: description: A command or shell script that will be executed to start the adapter on a ClearBlade Edge. If a start-up command is not specified , the adapter would need to be manually started by connecting to the gateway device (via ssh) and issuing an appropriate start example: ./start.sh type: string status_command: description: A command or shell script that will be run to determine the status of the adapter on a specific ClearBlade Edge. A shell script that echoes the status of an adapter should be supplied example: ./status.sh type: string stop_command: description: A command or shell script that will be run to stop the adapter on a ClearBlade Edge. If the Stop Command is not specified, the adapter would need to be manually stopped by connecting to the gateway device (via ssh) and issuing an appropriate stop command. example: ./stop.sh type: string undeploy_command: description: A command or shell script that will be run to uninstall the adapter from a ClearBlade Edge. If the Undeploy Command is not specified the default behavior of the ClearBlade platform is to remove the adapter files from the directory where Edge is running. example: ./undeploy.sh type: string Operator: description: Choose only one of the below properties. properties: EQ: items: $ref: '#/definitions/OperatorValue' type: array GT: items: $ref: '#/definitions/OperatorValue' type: array GTE: items: $ref: '#/definitions/OperatorValue' type: array LT: items: $ref: '#/definitions/OperatorValue' type: array LTE: items: $ref: '#/definitions/OperatorValue' type: array NEQ: items: $ref: '#/definitions/OperatorValue' type: array RE: items: $ref: '#/definitions/OperatorValue' type: array type: object OperatorValue: description: An object describing a column/value relationship to be used in a query's operators. properties: '[columnName]': description: '[itemValue]' type: string type: object PutQuery: properties: $set: properties: '[columnName]': example: '[newValue]' type: object query: $ref: '#/definitions/Filters' type: object Query: properties: FILTERS: $ref: '#/definitions/Filters' PAGENUM: example: 1 type: integer PAGESIZE: default: 100 type: integer SORT: items: $ref: '#/definitions/SortObject' minLength: 0 type: array type: object QueryResultSet: description: An object representing a SQL query result set. properties: DATA: description: An array containing each row returned by a query items: type: object type: array TOTAL: description: The number of rows affected by a query type: integer type: object SMSSettings: description: 2FA SMS communication settings properties: from: example: '+15120000000' type: string password: example: test type: string service_name: description: Only Twilio is supported. example: Twilio type: string two_factor_message: example: 'Please use the code to log in: $CODE' type: string url: example: https://api.twilio.com type: string username: example: AC25b4eb989b9db8 type: string validation_message: example: 'Please validate your email here: $LINK' type: string SMSTest: description: 2FA SMS communication test properties: recipient: example: '+15120000000' type: string SecuritySettings: description: Security Settings for 2FA properties: developer_token_ttl: example: 86400 type: integer two_factor_auth: $ref: '#/definitions/enabled' SortObject: description: Choose only one of the below properties. properties: ASC: description: Sort by ascending values in this column example: columnName type: string DESC: description: Sort by descending values in this column example: columnName type: string type: object SortQuery: description: Sorts based on query. properties: DESC: description: Sort by descending values example: datetime type: string type: object SortUser: description: Sort by user ID. properties: ASC: description: Sort by ascending values example: user_id type: string type: object SuccessResp: description: Success responses properties: success: description: Describes if the action was successfully performed or not. example: true type: boolean required: - success addAdapter: description: The information to be used for adding an adapter. properties: architecture: description: The platform the adapter will be running on. example: darwin-amd64 type: string deploy_command: description: The file name that will be running for the deploy command. example: '' type: string logs_command: description: A command or shell script that will be used to retrieve any logs printed out by the adapter while it is running. example: '' type: string name: description: Name of the adapter. example: example-adapter type: string os: description: The os this adapter is going to run on. example: linux type: string start_command: description: A command or shell script that will be executed to start the adapter on a ClearBlade Edge. If a start-up command is not specified , the adapter would need to be manually started by connecting to the gateway device (via ssh) and issuing an appropriate start example: '' type: string status_command: description: A command or shell script that will be run to determine the status of the adapter on a specific ClearBlade Edge. A shell script that echoes the status of an adapter should be supplied example: '' type: string stop_command: description: A command or shell script that will be run to stop the adapter on a ClearBlade Edge. If the Stop Command is not specified, the adapter would need to be manually stopped by connecting to the gateway device (via ssh) and issuing an appropriate stop command. example: '' type: string undeploy_command: description: A command or shell script that will be run to uninstall the adapter from a ClearBlade Edge. If the Undeploy Command is not specified the default behavior of the ClearBlade platform is to remove the adapter files from the directory where Edge is running. example: '' type: string required: - name addCache: description: the information given when adding a cache properties: description: description: Description of new shared cache type: string name: example: sharedCache type: string ttl: example: 30 maxLength: 3600 minLength: 30 type: integer required: - ttl addColumnInfo: properties: id: description: This is the collection ID example: c0f8e2c50bbeeafb87f5efa2eee301 type: string name: example: Sensor_Location type: string type: example: string type: string required: - id - name - type addUserColumn: description: User column information. properties: column_name: example: phone_number type: string type: example: string type: string required: - column_name - type addservice: properties: code: example: "function serviceName(req,resp){resp.success(\u201Csuccess\u201D\ );}" type: string dependencies: example: log type: string name: example: serviceName type: string parameters: example: - '{}' type: string run_user: example: '' type: string systemID: example: c0f8e2c50bc6cc90b7a19abbbb8d01 type: string required: - code - name - systemID - parameters allBuckets: items: $ref: '#/definitions/buckets' type: array allCollections: properties: appID: description: This is the system key example: c0f8e2c50bbeeafb87f5efa2eee301 type: string collectionID: example: 92ceabdd0be690a3d3fdd9dbd3e901 type: string name: example: Employee_List type: string type: object allCollectionsSuccess: items: $ref: '#/definitions/allCollections' type: array allDatabases: items: $ref: '#/definitions/database' type: array allIndexes: properties: Data: items: $ref: '#/definitions/indexArray' type: array Total: description: Total number of indexes in collection example: 2 type: integer allowKey: properties: allow_key_auth: example: true type: boolean analyticItems: properties: developers: example: - example@clearblade.com type: array disabled: example: false type: boolean diskUsage: example: 2 type: integer lastUpdated: example: 1580407664 type: integer name: example: System-Name type: string numAPIReqsMonth: example: 2 type: integer numAPIReqsTotal: example: 2 type: integer numAPIReqsYear: example: 2 type: integer numDeployments: example: 2 type: integer numDevices: example: 2 type: integer numDevs: example: 2 type: integer numEdges: example: 2 type: integer numLibraries: example: 2 type: integer numPub: example: 2 type: integer numPubMonth: example: 2 type: integer numPubYear: example: 2 type: integer numRecMonth: example: 2 type: integer numRecTotal: example: 2 type: integer numRecYear: example: 2 type: integer numRoles: example: 2 type: integer numServices: example: 2 type: integer numUsers: example: 2 type: integer owner: example: example@clearblade.com type: string system_key: example: ccafb4cf0bd0dcbcadaccaf9ebba01 type: string auditInfo: items: $ref: '#/definitions/auditItems' type: array auditItems: properties: action_type: example: Update type: string asset_class: example: devices type: string asset_id: example: ClearBlade-iPhone type: string changes: example: '{"last_location_update":"2020-01-29T20:18:18.429,"last_seen_location":"none","x_pos":874.2206168192284,"y_pos":739.82265853589}' type: string email: example: example@clearblade.com type: string id: example: 10440595 type: integer response_time: description: In milleseconds example: 4038669 type: integer system_key: example: ccafb4cf0bd0dcbcadaccaf9ebba01 type: string time: example: '2020-01-29T20:18:18.475214Z' type: string user_type: example: DEV type: string authAnon: properties: user_token: example: jt-w5IiOOnhuSp8hJbanB2Tluj_ShXphjAta0_6_mAcUPSbatjFRYr1m5Ojl4skSOZ3txbbkFWArnUnfNA== type: string authUser: properties: expires_at: description: The format is UNIX timestamp. If value is -1, then no refresh token is returned example: 1589313683 type: integer refresh_token: example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOiJhNGE0YTNlYjBiZDg5ZmU4YmV4cCI6MTU4OTc0NTY4MywiaWF0IjoxNTg4ODgxNjgzfQ.K2Ji0HldYtUO0RgednnOq117cnZy-ij-C1k1a8qVMsw type: string user_id: example: ce81b8dd0bf6fea6cec6d3c19774 type: string user_token: example: jt-w5IiOOnhuSp8hJbanB2Tluj_ShXphjAta0_6_mAcUPSbatjFRYr1m5Ojl4skSOZ3txbbkFWArnUnfNA== type: string authdata: description: The credentials to be used for authentication and refreshing developer tokens properties: email: example: cbman@clearblade.com type: string password: example: cl34rbl4d3 type: string box: properties: example/full/path/to/file.txt: $ref: '#/definitions/box_data' type: object box_data: properties: base_name: description: Base Name example: sample.txt type: string bucket_name: description: Box Name example: inbox type: string last_modified: description: Date of update example: '2017-07-03T19:52:41.693Z' type: string path_name: description: Full file path example: example/full/path/to/file.txt type: string permissions: description: File permissions example: -rw-r--r-- type: string relative_name: description: relative name example: test/file.txt type: string size: description: File size in bytes example: 60 type: integer buckets: properties: deployment_name: description: Deployment Name example: ExampleDeployment type: string edge_config: description: Edge Config file example: - root: type: array edge_storage: description: Edge storage type - local or google example: local type: string platform_config: description: Platform Config file example: - root: type: array platform_storage: description: Platform storage type - local or google example: local type: string system_key: example: 98a6cbe60bceafcc5d8b4a33b type: string changeRoleSettings: description: Changes settings in individual roles properties: changes: $ref: '#/definitions/roleSettings' id: example: Administrator type: string required: - changes - id changeRolesObject: description: Contains at least one of the keys, add or delete which consists of an array of roles properties: add: example: - Administrator type: array delete: example: - Authenticated type: array changeroles: description: Changes roles properties: roles: $ref: '#/definitions/changeRolesObject' required: - roles changes: description: Changes roles and password properties: password: example: test type: string roles: $ref: '#/definitions/changeRolesObject' changesInfo: description: Item identification properties: itemInfo: $ref: '#/definitions/itemInfo' permissions: $ref: '#/definitions/permissions' required: - itemInfo - permissions codeMeta: properties: code: items: $ref: '#/definitions/codeSettings' type: array codeSettings: properties: auto_balance: description: When set to `true` automatically start this service on each of the available nodes with the number of instances in the concurrency limit example: false type: boolean auto_balance_euid: example: '' type: string auto_restart: example: false type: boolean concurrency: example: 0 type: integer euid: example: b0a6cbe60b8edf93fdca978aed8e01 type: string execution_timeout: example: 60 type: integer logging_enabled: type: boolean name: example: serviceName type: string namespace: example: '' type: string system_key: example: 98a6cbe60bceafcc5d8b4a33b type: string uuid: example: ea339dce-3e5e-45b2-b1a6-fe030a03b0fd type: string version: example: 3 type: integer version_id: example: 1767d09d-e6c6-4841-a26a-9935a1e5fd96 type: string collectionSuccess: description: Collection success response body properties: CURRENTPAGE: example: 2 type: integer DATA: items: $ref: '#/definitions/dataArray' type: array NEXTPAGEURL: example: /api/v/1/data/a8eeb8db0b8aebf2d7f186d89348?query=%7B%22FILTERS%22%3A%5B%5D%2C%22PAGENUM%22%3A2%2C%22PAGESIZE%22%3A100%2C%22SELECTCOLUMNS%22%3Anull%2C%22SORT%22%3A%5B%5D%7D type: string PREVPAGEURL: example: 1 type: integer TOTAL: example: 2 type: integer required: - CURRENTPAGE - NEXTPAGEURL - PREVPAGEURL - TOTAL type: object columnObject: properties: ColumnName: example: item_id type: string ColumnType: example: int type: string PK: example: 'false' type: boolean type: object columnSuccess: items: $ref: '#/definitions/columnObject' type: array connectedDevice: properties: device_name: items: $ref: '#/definitions/connectedDeviceSettings' type: array connectedDeviceCount: properties: total_device_connections: example: 5 type: integer total_devices: example: 3 type: integer unique_device_connections: example: 2 type: integer connectedDeviceInfo: properties: allow_certificate_auth: type: boolean allow_key_auth: type: boolean certificate: example: null type: string connections: items: $ref: '#/definitions/connectedDeviceSettings' type: array created_date: example: 1576095410 type: integer description: example: A connected device. type: string device_key: example: 'e4ba8adf0beeea9dcc909dafaeab01 :: deviceName' type: string enabled: type: boolean has_keys: type: boolean last_active_date: example: 1576095410 type: integer name: example: ExampleDevice type: string state: example: active type: string system_key: example: e4ba8adf0beeea9dcc909dafaeab01 type: string type: example: sensor type: string connectedDeviceSettings: properties: client_id: example: DhkVG42mlBQ7DkZSvb5d type: string time_connected: example: '2019-12-13T17:53:09.5778599Z' type: string copyFile: properties: from_box: description: Box Name where file is being copied/moved example: inbox type: string from_path: description: Relative File Path Name where file is being copied/moved example: /relative/file/path type: string to_box: description: Box Name of where file is being copied/moved to example: inbox type: string to_path: description: Relative File Path Name where file is being copied/moved to example: /relative/file/path type: string count: example: count: 1 type: object createBox: properties: box: description: Box Name example: inbox type: string contents: description: base64 encoded file contents example: IyEvYmluL2Jhc2gKbWtkaXIgU2hvd1RpbWVBZGFwdGVyCgptdiBzdGFydC5zaCBTaG93VGltZUFkYXB0ZXIKbXYgc3RvcC5zaCBTaG93VGltZUFkYXB0ZXIKbXYgc3RhdHVzLnNoIFNob3dUaW1lQWRhcHRlcgptdiBkZXBsb3kuc2ggU2hvd1RpbWVBZGFwdGVyCm12IHVuZGVwbG95LnNoIFNob3dUaW1lQWRhcHRlcgptdiBzaG93VGltZSBTaG93VGltZUFkYXB0ZXIKCmVjaG8gIlNob3dUaW1lQWRhcHRlciBEZXBsb3llZCI= type: string path: description: Relative File Path example: /relative/file/path type: string createDatabase: description: Credentials for all databases can be found in the endpoint description properties: credentials: $ref: '#/definitions/credentials' type: object dbtype: example: mysql type: string name: example: mysql_example type: string type: object createDeployment: description: The information used to create a deployment properties: assets: items: $ref: '#/definitions/Assets' type: array edges: description: Names of edges to be included in the deployment example: - edge1 - edge2 - edge3 type: array name: type: string required: - name credentials: properties: address: example: MYSQL_ADDRESS type: string dbname: example: MYSQL_DATABASE_NAME type: string password: example: MSQL_PASSWORD type: string port: example: '3306' type: string user: example: MYSQL_USER type: string dataArray: example: row1: row1_data row2: row2_data type: object database: description: Database name and type properties: dbtype: example: MongoDB type: string name: example: sample_db type: string type: object deleteFile: properties: box: description: Box Name of file being deleted example: inbox type: string path: description: Relative File Path Name of file being deleted example: /relative/file/path type: string deleteuserdata: properties: user_id: example: c6b4cf0b8ca5b7c3fad793cb12 type: string deployment: properties: description: example: This an example deployment type: string name: example: deployment_name type: string deploymentSuccess: items: $ref: '#/definitions/deployment' type: array devemail: description: email key of developer properties: email: example: rob@clearblade.com type: string required: - email deviceAdd: properties: active_key: example: '1574445864' type: string allow_certificate_auth: type: boolean allow_key_auth: type: boolean certificate: type: string description: example: This is a sensor type: string name: example: device_name type: string state: example: 'On' type: string type: example: Sensor type: string deviceAdminNew: description: New device information properties: active_key: type: string allow_certificate_auth: type: boolean allow_key_auth: type: boolean certificate: type: string custom: type: string description: type: string enabled: type: boolean keys: type: string name: type: string state: type: string type: type: string required: - name - type - state - enabled - allow_key_auth - allow_certificate_auth deviceAdminUpdate: description: Updated device information properties: active_key: type: string allow_certificate_auth: type: boolean allow_key_auth: type: boolean certificate: type: string custom: type: string description: type: string enabled: type: boolean keys: type: string state: type: string type: type: string deviceAuth: properties: deviceName: example: BLEdevice type: string deviceToken: example: 1dBfevzh0-lLVbZwx9DbyTLPyw-8F0RDq3qeUGqwinr8x3-bKMXLpfyliRSXsre5KxMn76CuChFQANoEEg== type: string expiresAt: description: The format is UNIX timestamp. If value is -1, then no refresh token is returned example: 1589313683 type: integer refreshToken: example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOiJhNGE0YTNlYjBiZDg5ZmU4YmV4cCI6MTU4OTc0NTY4MywiaWF0IjoxNTg4ODgxNjgzfQ.K2Ji0HldYtUO0RgednnOq117cnZy-ij-C1k1a8qVMsw type: string deviceAuthdata: properties: activeKey: example: 378BLE type: string deviceName: example: BLEdevice type: string required: - deviceName - activeKey deviceKey: description: List of rotating keys. properties: active_key: example: "\uFFFD\uFFFDW&\x1A\uFFFDKw\uFFFD\uFFFD" type: string keys: items: $ref: '#/definitions/rotatingDeviceKeys' type: array deviceSession: items: $ref: '#/definitions/deviceSessionInfo' type: array deviceSessionInfo: properties: device_key: example: DEVICENAME00000 type: string issued: example: 1587659826 type: integer deviceUpdate: properties: allow_certificate_auth: example: true type: boolean allow_key_auth: example: true type: boolean certificate: example: '' type: string created_date: example: 1574445666 type: integer description: example: This device is a sensor type: string device_key: example: 'c0f8e2c50bbeeafb87f5efa2eee301 :: device_name' type: string enabled: example: true type: boolean last_active_date: example: 1574445864 type: integer name: example: device_name type: string state: example: 'On' type: string system_key: example: c0f8e2c50bbeeafb87f5efa2eee301 type: string type: example: sensor type: string deviceUserUpdate: description: Updated device information properties: custom_attribute: example: custom_setting type: string state: example: 'On' type: string devpass: description: Contains oldPass and newPass keys properties: new_password: example: bieberluver type: string old_password: example: bieberboy type: string required: - old_password - new_password devregdata: description: The information to be used for user registration. Custom fields may be added. properties: email: description: Developer's email. example: martin@clearblade.com type: string fname: description: Developer's first name. example: Martin type: string lname: description: Developer's last name. example: theMachine type: string org: description: Developer's organization. example: ClearBlade type: string password: description: Developer's password. example: bieberboy type: string required: - email - password - fname - lname - org devregresp: properties: dev_token: example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOiJhNGE0YhjY2NhNS0xNjRhLTQ5ODgtYjU2MS1jYWVmNTcyNGU0NjAiLCJ1dCI6MSwidHQiOjEsImV4cCI6MTU4OTMxMzY4MywiaWF0IjoxNTg4ODgxNjgzfQ.0FK58r0wcJSQIDuDCAselAdmN-uj_CXHqJqk2mF9WB4 type: string expires_at: description: The format is UNIX timestamp. If value is -1, then no refresh token is returned example: 1589313683 type: integer is_two_factor: example: false type: boolean refresh_token: example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOiJhNGE0YTNlYjBiZDg5ZmU4YmV4cCI6MTU4OTc0NTY4MywiaWF0IjoxNTg4ODgxNjgzfQ.K2Ji0HldYtUO0RgednnOq117cnZy-ij-C1k1a8qVMsw type: string user_id: example: a4a4a3eb0bd89fe8bbeb99f8d2be01 type: string disableData: description: The information to be used for disabling a developer properties: admin: type: boolean disabled: type: boolean email: type: string required: - email - admin - disabled edgeCommand: description: The information for the command running on a specific edge. properties: command: description: The command the edge is currently using. example: status type: string edges: description: Name of edge(s) being used. example: - edgeName type: string required: - command - edges edgeNew: description: New edge properties: description: type: string local_addr: type: string local_port: type: string location: type: string mac_address: type: string public_addr: type: string public_port: type: string system_key: type: string system_secret: type: string token: type: string required: - system_key - system_secret - token edgeTemplateModule: properties: module: enum: - trigger - service - library type: string edgeTemplateUpdate: properties: def_module: $ref: '#/definitions/edgeTemplateModule' def_name: type: string required: - def_name edgeUpdate: description: Update edge properties: description: type: string local_addr: type: string local_port: type: string location: type: string mac_address: type: string public_addr: type: string public_port: type: string system_key: type: string system_secret: type: string token: type: string required: - system_key - system_secret emailSettings: description: 2FA email communication settings properties: encryption_type: example: STARTTLS type: string from: example: example@gmail.com type: string host: example: smtp.gmail.com type: string password: example: test type: string port: example: '587' type: string protocol: example: SMTP type: string two_factor_message: example: 'Please use the code to log in: $CODE' type: string two_factor_subject: example: Login code type: string username: example: example@gmail.com type: string validation_message: example: 'Please validate your email here: $LINK' type: string validation_subject: example: Email validation type: string emailTest: description: 2FA email communication test properties: recipient: example: example@companyname.com type: string enabled: properties: enabled: example: true type: boolean eventDefinition: properties: def_keys: example: - topic type: array def_module: example: Messaging type: string def_name: example: Subscribe type: string visibility: example: true type: boolean executeWebhook: description: Data passing through webhooks properties: data: example: Third party server data type: string required: - data externalDB: properties: credentials: $ref: '#/definitions/credentials' type: object dbtype: example: mysql type: string id: example: 5 type: integer name: example: mysql_example type: string system_key: example: bc91ede40bb993a7babaa801 type: string getCacheResp: description: The list of Shared Cache returned properties: description: example: Here goes an example description. type: string id: description: Unique ID of cache example: 54eb0787-50df-4099-b368-c68ea97f1ce2 type: string name: example: test_cache type: string system_key: example: b4d49dd00basfdb3deb4ccbefeb0df01 type: string ttl: example: 30 maxLength: 3600 minLength: 30 type: integer required: - id - name - system_key - ttl type: object getUsers: properties: creation_date: example: '2019-09-11T18:41:15Z' type: string email: example: cbman@clearblade.com type: string user_id: example: ce81b8dd0bf6fea6cec6d3c19774 type: string getUsersData: items: $ref: '#/definitions/getUsers' type: array getUsersSuccess: properties: Data: $ref: '#/definitions/getUsersData' Total: example: 1 type: integer getWebhook: description: Webhook properties properties: auth_method: example: http_basic_auth type: string description: example: Webhook to get data type: string id: example: f2ca33c4-8bd0-45aa-af4a-da3467b451bc type: string name: example: webhook_example type: string service_name: example: service_example type: string system_key: example: ccafb4cf0bd0dcbcadaccaf9ebba01 type: string system_secret: example: CCAFB4CF0BBABDDCE3F2F1E6C3E601 type: string required: - auth_method - id - name - service_name - system_key - system_secret type: object indexArray: description: Type choices are unique index and nonunique index properties: name: description: Column Name example: ExampleColumn type: string type: description: Index Type example: Unique Index type: string itemInfo: description: Item identification properties: id: example: 8edaedc50bcaf9cd88bce5c6e57a type: string name: example: sampleAsset type: string required: - id - name libdata: properties: code: example: function getter(uri){var r=Requests();r.get({'uri':uri},function(err,resp){log(JSON.stringify(resp));});} type: string dependencies: example: http,log type: string visibility: example: system type: string required: - code - dependencies - visibility messagePublish: description: The topic, message body and the qos (0,1 or 2) required to publish a message properties: body: example: '{"temperature":43}' type: string qos: example: 0 type: number topic: example: /sensor/111111 type: string required: - topic msgArray: items: $ref: '#/definitions/msgTopic' type: array msgTopic: properties: ip: example: '' type: string payload: description: The message body of the topic example: Message Body. type: string payloadsize: description: Message character count example: 50 type: integer pk: example: 12a38ef9-6d01-4aed-8117-e4464f14ffbc type: string qos: description: Quality of Service (0,1,2) example: 0 type: integer time: description: The format is UNIX timestamp. example: 1589313683 type: integer topicid: example: Topic Name type: string userid: example: e291cdc70bf6a4fa3e288c3af01 type: string newcollection: description: The information necessary to create a new collection properties: appID: description: This is the system key example: c0f8e2c50bbeeaf87f5efa2eee301 type: string collectionID: example: c0f8e2c50bbeeafb87f5efa2eee301 type: string name: example: newCollection type: string required: - appID - name newsystem: description: Info to create a new system properties: description: example: Here is my new system. type: string name: example: ExampleSystem type: string required: - name - description operations: example: db.collectionName.find() type: string operationsDB: properties: operation: items: $ref: '#/definitions/operations' passdata: properties: new_password: example: P@ssw0rd type: string old_password: example: cl34rbl4d3 type: string required: - old_password - new_password permissions: description: 'Read - 1, Create - 2 , Update - 4 , Delete - 8. Ex: R+C+D = 1+2+8 = 10' properties: permissions: example: 8 type: integer type: object platformInfo: properties: about: example: ClearBlade Platform type: object buildId: example: a66297bca:485 type: string version: example: 9.0.0 type: string portalArray: items: $ref: '#/definitions/portalSettings' type: array portalSettings: properties: config: type: object description: example: Portal Description. type: string last_updated: example: 03 Aug 20 02:33 UTC type: string name: example: ExamplePortal type: string namespace: example: '' type: string system_key: example: 98a6cbe60bceafcc5d8b4a33b type: string type: example: custom_v2 type: string regUser: properties: creation_date: example: '2019-09-11T18:41:15Z' type: string email: example: cbman@clearblade.com type: string expires_at: description: The format is UNIX timestamp. If value is -1, then no refresh token is returned example: 1589313683 type: integer options: example: '' type: string refresh_token: example: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOiJhNGE0YTNlYjBiZDg5ZmU4YmV4cCI6MTU4OTc0NTY4MywiaWF0IjoxNTg4ODgxNjgzfQ.K2Ji0HldYtUO0RgednnOq117cnZy-ij-C1k1a8qVMsw type: string user_id: example: ce81b8dd0bf6fea6cec6d3c19774 type: string user_token: example: jt-w5IiOOnhuSp8hJbanB2Tluj_ShXphjAta0_6_mAcUPSbatjFRYr1m5Ojl4skSOZ3txbbkFWArnUnfNA== type: string regensystem: description: Contains id of system to generate new keys for properties: id: example: '[systemID]' type: string required: - id resetPassword: properties: email: example: example@clearblade.com type: string new_password: example: password type: string retrySync: properties: asset_class: description: Asset Type example: services type: string asset_id: example: c0f8e2c50bbeeafb87f5efa2eee301 type: string edge: description: Edge Name example: ExampleEdge type: string is_collection: type: boolean sync_event: example: 0 (Insert)/1 (Update)/2 (Delete)/5 (Upsert) type: integer roleSettings: description: Assets with permission changes properties: allcollections: $ref: '#/definitions/changesInfo' allservices: $ref: '#/definitions/permissions' collections: $ref: '#/definitions/changesInfo' deployments: $ref: '#/definitions/permissions' description: type: string devices: $ref: '#/definitions/permissions' edges: $ref: '#/definitions/changesInfo' msgHistory: $ref: '#/definitions/permissions' portals: $ref: '#/definitions/changesInfo' roles: $ref: '#/definitions/permissions' services: $ref: '#/definitions/changesInfo' topics: $ref: '#/definitions/changesInfo' triggers: $ref: '#/definitions/permissions' users: $ref: '#/definitions/permissions' roles: description: Contains the roles to add or delete for the user properties: changes: $ref: '#/definitions/changeroles' user: example: b4d8aaab0bf48e98dacbd78e9e50 type: string required: - user - changes rolesinfo: description: Information of the roles properties: collections: example: [] type: array description: example: '' type: string name: example: Administrator type: string services: example: [] type: array topics: example: [] type: array required: - name rolespass: description: Contains the roles to add or delete for the user properties: changes: $ref: '#/definitions/changes' user: example: b4d8aaab0bf48e98dacbd78e9e50 type: string required: - user - changes rotatingDeviceKeys: example: "\uFFFD\uFFFDW&\x1A\uFFFDKw\uFFFD\uFFFD" type: string serviceUpdate: properties: auto_balance: description: If concurrency > 0 then auto_balance can be set to true if needed type: boolean auto_restart: description: If execution_timeout = -1 => Stream Service then auto_restart can be set to true if needed type: boolean code: example: "function serviceName(req,resp){resp.success(\u201Csuccess\u201D\ );}" type: string concurrency: example: 0 type: integer current_version: example: 4 type: integer dependencies: example: log type: string execution_timeout: example: 60 type: integer logging_enabled: type: boolean name: example: serviceName type: string parameters: example: [] type: array run_user: description: Uses user_id. example: e8b7f0cb0bdccdb7a8a7c78cdfcb01 type: string timers: example: [] type: array triggers: example: [] type: array required: - auto_balance - auto_restart - code - concurrency - current_version - logging_enabled - name systemInfo: items: $ref: '#/definitions/analyticItems' type: array systemSettings: description: System info properties: Dev: description: Developer Id for the owner of the system example: 92f8dbbb0bccb3fff4be5cdb601 type: string appId: description: system key example: a6e0f8e20bbefcec789de6b8f4cf01 type: string appSecret: description: system secret example: A6E0F8E20BDEB0C2838EF2B6D09801 type: string auth_service: description: Configure the system to have all authentication requests go through a specific Code Service. example: '' type: string description: example: Here is my new system. type: string name: example: ExampleSystem type: string reg_service: description: Configure the system to have all registration requests go through a specific Code Service. example: '' type: string registration: example: '' type: string token_ttl: description: ttl for developer tokens in seconds. Min - 86400 (1 day), Max- 2592000 (30 days), Default - 432000 Infinite - -1 example: '432000' type: string token_ttl_anon: description: ttl for anonymous tokens in seconds. Min - 3600 (1 hour), Max- 7776000 (90 days), Default - 432000 (5 days) Infinite - -1 example: '432000' type: integer token_ttl_device: description: ttl for device tokens in seconds. Min - 3600 (1 hour), Max- 7776000 (90 days), Default - 432000 (5 days) Infinite - -1 example: '432000' type: string token_ttl_user: description: ttl for user tokens in seconds. Min - 3600 (1 hour), Max- 7776000 (90 days), Default - 432000 (5 days) Infinite - -1 example: '432000' type: string timerArray: items: $ref: '#/definitions/timerList' type: array timerList: properties: description: example: This timer is 60 seconds type: string frequency: description: Frequency (in seconds) between two consecutive invocations of a timer handler example: 60 type: integer name: example: Timer_Example type: string namespace: example: '' type: string repeats: description: The number of times a timer handler is invoked. To invoke the handler indefinitely set 'repeats = -1' example: -1 type: integer service_name: example: TimerHandler type: string start_time: example: '2017-07-03T19:52:41.693Z' type: string system_key: example: ccafb4cf0bd0dcbcadaccaf9ebba01 type: string system_secret: example: CCAFB4CF0BBABDDCE3F2F1E6C3E601 type: string timer_key: example: 'c0f8e2c50bbeeafb87f5efa2eee301 :: timer_name' type: string user_id: example: c6b4cf0b8ca5b7c3fad793cb12 type: string user_token: example: jt-w5IiOOnhuSp8hJbanB2Tluj_ShXphjAta0_6_mAcUPSbatjFRYr1m5Ojl4skSOZ3txbbkFWArnUnfNA== type: string timerSuccess: description: Success response for timer properties: description: example: My 10 second timer type: string frequency: example: 10 type: integer name: example: tenSecondTimer type: string namespace: example: tenSecond type: string repeats: example: 20 type: integer service_name: example: getTemps type: string start_time: example: '2017-07-03T19:52:41.693Z' type: string system_key: example: 828dead00b84d78ed580c5faa7a101 type: string system_secret: example: 828DEAD00BD6F9E9AF8FD2F3D817 type: string timer_key: example: 828dead00b84d78ed580c5faa7a101::tenSecondTimer type: string user_id: example: 92f8dbbb0bccb3fff4b2e0e5cdb601 type: string user_token: example: jt-w5IiOOnhuSp8hJbanB2Tluj_ShXphjAta0_6_mAcUPSbatjFRYr1m5Ojl4skSOZ3txbbkFWArnUnfNA== type: string timerdata: properties: description: description: Information about the timer example: My 10 second timer type: string disabled: description: Enable or disable timer example: true type: boolean frequency: description: Frequency (in seconds) between two consecutive invocations of a timer handler example: 10 type: integer name: description: Timer label example: tenSecondTimer type: string repeats: description: The number of times a timer handler is invoked. To invoke the handler indefinitely set 'repeats = -1' example: 20 type: integer service_name: description: The handler service invoked by the timer example: getTemps type: string required: - frequency - name - repeats - service_name - disabled triggerArray: items: $ref: '#/definitions/triggerList' type: array triggerList: properties: event_definition: $ref: '#/definitions/eventDefinition' key_value_pairs: example: topic: /CB/sensors/# type: object name: example: Message_Trigger type: string namespace: example: '' type: string service_name: example: TriggerHandler type: string system_key: example: ccafb4cf0bd0dcbcadaccaf9ebba01 type: string system_secret: example: CCAFB4CF0BBABDDCE3F2F1E6C3E601 type: string triggerdata: properties: def_module: example: Messaging type: string def_name: example: Publish type: string disabled: description: Enable or disable trigger example: true type: boolean key_value_pairs: $ref: '#/definitions/KVPs' service_name: example: updateTemps type: string required: - def_module - def_name - service_name - key_value_pairs - disabled updateCache: description: the information updated in a cache properties: description: type: string ttl: example: 30 maxLength: 3600 minLength: 30 type: integer required: - ttl updateCollection: description: The information necessary to create a new column in a collection. There is also a deleteColumn option using the same info as addColumn properties: addColumn: $ref: '#/definitions/addColumnInfo' id: description: This is the collection ID example: c0f8e2c50bbeeafb87f5efa2eee301 type: string required: - id updateDeployment: description: the information used to update a deployment properties: assets: description: Assets to be added and removed from deployment properties: add: items: $ref: '#/definitions/Assets' type: array remove: items: $ref: '#/definitions/Assets' type: array type: object edges: description: Edges to be added and removed from deployment properties: adds: description: Names of edges to be added to the deployment example: - edge1 - edge2 - edge3 items: type: string type: array removes: description: Names of edges to be removed from the deployment example: - edge5 - edge6 - edge7 items: type: string type: array type: object required: - assets - edges updateOwner: description: New system owner email properties: change: items: $ref: '#/definitions/Change' owner: example: owner@clearblade.com type: string required: - owner - change updatedata: properties: code: example: function rand(){log('rolling die'); return 3;} type: string dependencies: example: log type: string description: example: Random number generator type: string required: - description - dependencies - code userCheck: properties: is_authenticated: example: true type: boolean userSession: items: $ref: '#/definitions/userSessionInfo' type: array userSessionInfo: properties: issued: example: 1587659826 type: integer user_id: example: 9aeeace602d2a6aaead2f62a type: string userdata: properties: column_name: example: column_value type: string userinfo: description: User information properties: admin: example: true type: boolean creation_date: example: 1551475825 type: integer email: example: example@clearblade.com type: string email_validated: example: true type: boolean fname: example: FirstName type: string last_login: example: 1551475825 type: integer lname: example: LastName type: string org: example: CompanyName type: string phone: example: '+15120000000' type: string phone_validated: example: true type: boolean two_factor_enabled: example: true type: boolean two_factor_enabled_instance": example: true type: boolean two_factor_method: example: email type: string userid: example: e291cdc70be288c3af01 type: string userlogin: description: user login information properties: email: example: helpme@clearblade.com type: string password: example: c13rb1ad3ru13z type: string required: - email - password userregdata: description: The information to be used for user registration. Custom fields may be added. properties: email: description: User's email. example: cbman@clearblade.com type: string password: description: User's password. example: cl34rbl4d3 type: string required: - email - password users: properties: PAGENUM: example: 1 type: integer PAGESIZE: default: 100 type: integer SORT: items: $ref: '#/definitions/SortUser' minLength: 0 type: array type: object validation: properties: type: example: email type: string webhookCreate: description: Webhook creation properties properties: auth_method: example: http_basic_auth type: string description: example: Create a webhook type: string name: example: webhook_example type: string service_name: example: service_example type: string required: - auth_method - name - service_name type: object webhookResp: description: list of webhooks and properties items: $ref: '#/definitions/getWebhook' type: array webhookUpdate: description: Webhook update properties properties: auth_method: example: http_basic_auth type: string description: example: Create a webhook type: string required: - auth_method type: object host: platform.clearblade.com info: contact: email: support@clearblade.com description: A friendly little API to help you interact with the ClearBlade platform. termsOfService: https://docs.clearblade.com/v/4/static/tac.html title: ClearBlade API version: '3.0' paths: /api/v/1/code/{systemKey}/{serviceName}: get: description: Returns setting information and data for a code service operationId: GetService parameters: - description: Dev Token obtained through authentication. in: header name: ClearBlade-DevToken required: true type: string - description: System key that identifies the system the device is a part of. in: path name: systemKey required: true type: string - description: Code Service's name in: path name: serviceName required: true type: string produces: - application/json responses: '200': description: Returns setting information and data for a code service '500': description: Server error. summary: CODE - Retrieve information about service tags: - Code post: description: Executes a code service. operationId: ExecuteService parameters: - description: Token obtained through user authentication. in: header name: ClearBlade-UserToken required: true type: string - description: System Key that identifies the system that holds the code service. in: path name: systemKey required: true type: string - description: Code Service's name in: path name: serviceName required: true type: string - description: Parameters for code service. in: body name: parameters required: false schema: type: object produces: - application/json responses: '200': description: Code service successfully executed. '500': description: Server error. summary: CODE - Call/Execute code service tags: - Code /api/v/1/collection/{systemKey}/{collectionName}: delete: description: Deletes data rows in the specified collection. operationId: DeleteCollectionData parameters: - description: Token obtained through user authentication. in: header name: ClearBlade-UserToken required: true type: string - description: System Key that identifies the system that holds the collection. in: path name: systemKey required: true type: string - description: Name of the collection. in: path name: collectionName required: true type: string - description: Query to limit scope of deletion. in: query name: query required: true type: string produces: - application/json responses: '200': description: Rows successfully deleted. schema: $ref: '#/definitions/count' '400': description: Bad request. schema: $ref: '#/definitions/ErrorResp' summary: DATA(name) - Delete items tags: - Data get: description: Returns the data from the specified collection. operationId: GetCollectionData parameters: - description: Token obtained through user authentication. in: header name: ClearBlade-UserToken required: true type: string - description: System Key that identifies the system that holds the collection. in: path name: systemKey required: true type: string - description: Name of the collection. in: path name: collectionName required: true type: string - description: Query object used to filter the items. See query model below for example. in: query name: query required: false type: string produces: - application/json responses: '200': description: A list of the data rows from the specified collection that match the query. schema: $ref: '#/definitions/collectionSuccess' '400': description: Bad request. schema: $ref: '#/definitions/ErrorResp' '401': description: Unauthorized schema: $ref: '#/definitions/ErrorResp' summary: DATA(name) - Get items tags: - Data post: description: Creates new data rows in the specified collection. operationId: CreateCollectionData parameters: - description: Token obtained through user authentication. in: header name: ClearBlade-UserToken required: true type: string - description: System Key that identifies the system that holds the collection. in: path name: systemKey required: true type: string - description: Name of the collection. in: path name: collectionName required: true type: string - description: New data row(s). Can accept multiple comma-separated key-value pairs to populate columns. Can also accept a blank object to create an unpopulated row. in: body name: payload schema: $ref: '#/definitions/ColumnField' produces: - application/json responses: '200': description: Items successfully created. schema: $ref: '#/definitions/ColumnField' '400': description: Bad request. schema: $ref: '#/definitions/ErrorResp' summary: DATA(name) - Create items tags: - Data put: description: Updates preexisting data rows in the specified collection. operationId: UpdateCollectionData parameters: - description: Token obtained through user authentication. in: header name: ClearBlade-UserToken required: true type: string - description: System Key that identifies the system that holds the collection. in: path name: systemKey required: true type: string - description: Name of the collection. in: path name: collectionName required: true type: string - description: Query to limit scope of update, and new data values. in: body name: payload required: true schema: $ref: '#/definitions/DataPut' produces: - application/json responses: '200': description: Items successfully updated. schema: $ref: '#/definitions/count' '400': description: Bad request. schema: $ref: '#/definitions/ErrorResp' summary: DATA(name) - Update items tags: - Data /api/v/1/message/{systemKey}/publish: post: description: Publishes a message to a topic, given the user has permission to publish on that topic. operationId: PublishMessage parameters: - description: Token obtained through user authentication. in: header name: ClearBlade-UserToken required: true type: string - description: System Key that identifies the system the messages belong to. in: path name: systemKey required: true type: string - description: Message to publish. in: body name: body required: true schema: $ref: '#/definitions/messagePublish' produces: - application/json responses: '200': description: No response was specified summary: MESSAGING - Publish message tags: - Messaging /api/v/1/user: get: description: Returns all user info that the current user is authorized to see. operationId: GetUsers parameters: - description: Token obtained through user authentication. in: header name: ClearBlade-UserToken required: true type: string - description: Query object used to filter the user list. See the query model below for an example. in: query name: query required: false type: string produces: - application/json responses: '200': description: A list of users. schema: $ref: '#/definitions/getUsersSuccess' '400': description: Invalid UserToken. Either the user is not authenticated or the token is malformed. schema: $ref: '#/definitions/ErrorResp' '403': description: Forbidden. schema: $ref: '#/definitions/ErrorResp' summary: USERS - Get all users tags: - User /api/v/1/user/anon: post: description: Logs an anonymous user into the specified system and returns an UserToken. operationId: AuthAnon parameters: - description: System Key that identifies the system you're logging the user into. in: header name: ClearBlade-SystemKey required: true type: string - description: System Secret that ensures authenticity. in: header name: ClearBlade-SystemSecret required: true type: string produces: - application/json responses: '200': description: Anonymous authenticated. schema: $ref: '#/definitions/authAnon' '400': description: Bad Request. schema: $ref: '#/definitions/ErrorResp' '401': description: Unauthorized. schema: $ref: '#/definitions/ErrorResp' '500': description: Server error. schema: $ref: '#/definitions/ErrorResp' summary: USERS - Authenticate anonymous user tags: - User /api/v/1/user/auth: post: description: "## Description\nLogs user into system and returns an UserToken.\n\ ## Endpoint Body Values\nHere are the body values for the two scenarios\n\ ### Basic Auth\nRequired Keys\n - username\n - password\n\nExample \n```json\n\ {\n \"username\":\"cbman@clearblade.com\",\n \"password\":\"cl34rbl4d3\"\ \n}\n``` \n\n### Refreshing Token\nRequired Keys \n - grant_type (only one\ \ valid value - \"refresh_token\")\n - refresh_token\n - access_token\n\n\ Example \n```json\n{\n \"grant_type\":\"refresh_token\",\n \"refresh_token\"\ :\"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOiJmMjkwZTJlYjBiZDRmNjhiZDRkM2RlZjNkMWM0MDEiLCJzaWQiOiIzOWFkM2U5OC1hMmU0LTQxYzQtOGMzNi03ZjQxNDFhYzYxN2IiLCJ1dCI6MiwidHQiOjMsImV4cCI6MTU5MDI3ODExMSwiaWF0IjoxNTg5NDE0MTExfQ.iY6uJu2QgNP0uHoGdmEZm9wsztB1SUrCHrisxoXoxolol\"\ ,\n \"access_token\":\"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOiJmMjkwZTJlYjBiZDRmNjhiZDRkM2RlZjNkMWM0MDEiLCJzaWQiOiI3NmY4ODg4MS04YmU5LTRiM2UtOWJkNi1jOTJjZGQ4OTNlMmEiLCJ1dCI6MiwidHQiOjEsImV4cCI6MTU4OTg0NjExMSwiaWF0IjoxNTg5NDE0MTExfQ.xboryHuVn2zz-gSZ_JcD7-j_eBmJU1SMHkiDl9j8bak\"\ \n}\n``` \n" operationId: AuthUser parameters: - description: System Key that identifies the system you're logging the user into. in: header name: ClearBlade-SystemKey required: true type: string - description: System Secret that ensures authenticity. in: header name: ClearBlade-SystemSecret required: true type: string - description: User credentials. in: body name: body required: true schema: $ref: '#/definitions/authdata' produces: - application/json responses: '200': description: User authenticated. schema: $ref: '#/definitions/authUser' '400': description: Bad Request. schema: $ref: '#/definitions/ErrorResp' '401': description: Unauthorized. '500': description: Internal Server error. summary: USERS - Authenticate user tags: - User /api/v/1/user/checkauth: post: description: Checks if current user's UserToken is valid. operationId: UserCheckAuth parameters: - description: System Key that identifies the system the user might be logged into. in: header name: ClearBlade-SystemKey required: true type: string - description: User Token obtained through previous authentication. in: header name: ClearBlade-UserToken required: true type: string produces: - application/json responses: '200': description: User is authenticated with the specified system. schema: $ref: '#/definitions/userCheck' '400': description: User in not authenticated with the specified system. '401': description: Unauthorized. '500': description: Server error. summary: USERS - Check user auth tags: - User /api/v/1/user/info: delete: description: This endpoints provides user the ability to delete another user if the user has Delete User operation permissions in Roles settings. operationId: DeleteUserAsUser parameters: - description: Token obtained through user authentication. in: header name: ClearBlade-UserToken required: true type: string - in: header name: ClearBlade-SystemKey required: true type: string - in: header name: ClearBlade-SystemSecret required: true type: string - in: body name: body required: true schema: $ref: '#/definitions/deleteuserdata' produces: - application/json responses: '200': description: Successfully Deleted User. No response returned. '400': description: Bad request. schema: $ref: '#/definitions/ErrorResp' summary: Allows an user with adequate permissions to delete another user tags: - User get: description: Returns all user information about the current user. operationId: GetUserInfo parameters: - description: Token obtained through user authentication. in: header name: ClearBlade-UserToken required: true type: string produces: - application/json responses: '200': description: Current user information. schema: $ref: '#/definitions/getUsers' '400': description: Bad Request. schema: $ref: '#/definitions/ErrorResp' '401': description: Unauthorized. schema: $ref: '#/definitions/ErrorResp' '500': description: Server error. schema: $ref: '#/definitions/ErrorResp' summary: USERS - Get user info tags: - User put: description: Updates some or all of the current user's information. operationId: UpdateUserInfo parameters: - description: Token obtained through user authentication. in: header name: ClearBlade-UserToken required: true type: string - description: Updated user information. in: body name: body required: true schema: $ref: '#/definitions/userdata' produces: - application/json responses: '200': description: User has been updated. '400': description: Bad Request. schema: $ref: '#/definitions/ErrorResp' '401': description: Unauthorized. schema: $ref: '#/definitions/ErrorResp' '500': description: Server error. schema: $ref: '#/definitions/ErrorResp' summary: USERS - Update user info tags: - User /api/v/1/user/logout: post: description: Logs the current user out of the specified system and invalidates their UserToken. operationId: UserLogout parameters: - description: Token obtained through user authentication. in: header name: ClearBlade-UserToken required: true type: string produces: - application/json responses: '200': description: Successfully logged out '400': description: Bad Request. schema: $ref: '#/definitions/ErrorResp' '401': description: Unauthorized. schema: $ref: '#/definitions/ErrorResp' '500': description: Server error. schema: $ref: '#/definitions/ErrorResp' summary: USERS - Log out user tags: - User /api/v/1/user/pass: put: description: Changes an user's password. operationId: UpdateUserPass parameters: - description: Token obtained through user authentication. in: header name: ClearBlade-UserToken required: true type: string - description: Password change information. in: body name: body required: true schema: $ref: '#/definitions/passdata' produces: - application/json responses: '200': description: User's password was successfully changed. Returns `Success` as a response. '400': description: Bad Request. schema: $ref: '#/definitions/ErrorResp' '401': description: Unauthorized. schema: $ref: '#/definitions/ErrorResp' '500': description: Server error. schema: $ref: '#/definitions/ErrorResp' summary: USERS - Change user password tags: - User /api/v/1/user/reg: post: description: Registers a new user in the specified system and returns an UserToken for them. operationId: RegUser parameters: - description: System Key that identifies the system you're adding the user to. in: header name: ClearBlade-SystemKey required: true type: string - description: System Secret that ensures authenticity. in: header name: ClearBlade-SystemSecret required: true type: string - description: Token obtained through user authentication. in: header name: ClearBlade-UserToken required: true type: string - description: User registration information. in: body name: body required: true schema: $ref: '#/definitions/userregdata' produces: - application/json responses: '200': description: User registered. schema: $ref: '#/definitions/regUser' '400': description: Bad Request. schema: $ref: '#/definitions/ErrorResp' '401': description: Unauthorized. '500': description: Internal Server error. summary: USERS - Register new user tags: - User /api/v/2/devices/{SystemKey}: delete: description: Deletes all devices matching the filters specified by a query. operationId: DeleteDevices parameters: - description: System Key that identifies the system the device is a part of. in: path name: SystemKey required: true type: string - description: Token obtained through user authentication. in: header name: ClearBlade-UserToken required: true type: string - description: Tags to filter devices by. See the query model below for an example. in: query name: query required: true type: string produces: - application/json responses: '200': description: Successfully deleted devices. '400': description: Bad request. schema: $ref: '#/definitions/ErrorResp' summary: DEVICES - Delete devices using a query tags: - Device get: description: Returns all device info that the current user is authorized to see. operationId: GetDevices parameters: - description: System Key that identifies the system the device is a part of. in: path name: SystemKey required: true type: string - description: Token obtained through user authentication. in: header name: ClearBlade-UserToken required: true type: string - description: Tags to filter devices by. See the query model below for an example. in: query name: query required: false type: string produces: - application/json responses: '200': description: A list of devices. schema: $ref: '#/definitions/deviceUpdate' '400': description: Bad request. schema: $ref: '#/definitions/ErrorResp' summary: DEVICES - Get all devices tags: - Device put: description: Updates all devices matching the filters specified by a query. operationId: UpdateDevices parameters: - description: System Key that identifies the system the device is a part of. in: path name: SystemKey required: true type: string - description: Token obtained through user authentication. in: header name: ClearBlade-UserToken required: true type: string - description: Query to limit scope of update, and new data values. in: body name: payload required: true schema: $ref: '#/definitions/PutQuery' produces: - application/json responses: '200': description: A JSON object representing the SQL result set containing the list of affected devices. schema: $ref: '#/definitions/QueryResultSet' '400': description: Bad request. schema: $ref: '#/definitions/ErrorResp' summary: DEVICES - Update devices using a query tags: - Device /api/v/2/devices/{SystemKey}/auth: post: description: "## Description\nLogs device into system and returns an Device\ \ Access Token.\n## Endpoint Body Values\nHere are the body values for the\ \ two scenarios\n### Basic Auth\nRequired Keys\n - deviceName\n - activeKey\n\ \nExample \n```json\n{\n \"deviceName\":\"BLEdevice\",\n \"activeKey\":\"\ 378123BLE\"\n}\n``` \n\n### Refreshing Token\nRequired Keys \n - grant_type\ \ (only one valid value - \"refresh_token\")\n - refresh_token\n - access_token\n\ \nExample \n```json\n{\n \"grant_type\":\"refresh_token\",\n \"refresh_token\"\ :\"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOiJmMjkwZTJlYjBiZDRmNjhiZDRkM2RlZjNkMWM0MDEiLCJzaWQiOiIzOWFkM2U5OC1hMmU0LTQxYzQtOGMzNi03ZjQxNDFhYzYxN2IiLCJ1dCI6MiwidHQiOjMsImV4cCI6MTU5MDI3ODExMSwiaWF0IjoxNTg5NDE0MTExfQ.iY6uJu2QgNP0uHoGdmEZm9wsztB1SUrCHrisxoXoxolol\"\ ,\n \"access_token\":\"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ1aWQiOiJmMjkwZTJlYjBiZDRmNjhiZDRkM2RlZjNkMWM0MDEiLCJzaWQiOiI3NmY4ODg4MS04YmU5LTRiM2UtOWJkNi1jOTJjZGQ4OTNlMmEiLCJ1dCI6MiwidHQiOjEsImV4cCI6MTU4OTg0NjExMSwiaWF0IjoxNTg5NDE0MTExfQ.xboryHuVn2zz-gSZ_JcD7-j_eBmJU1SMHkiDl9j8bak\"\ \n}\n```\n" operationId: AuthDevice parameters: - description: System Key that identifies the system the device is a part of. in: path name: SystemKey required: true type: string - description: Device credentials. in: body name: body required: true schema: $ref: '#/definitions/deviceAuthdata' produces: - application/json responses: '200': description: Device authenticated. schema: $ref: '#/definitions/deviceAuth' '400': description: Bad Request. schema: $ref: '#/definitions/ErrorResp' '401': description: Unauthorized. schema: $ref: '#/definitions/ErrorResp' '500': description: Server error. schema: $ref: '#/definitions/ErrorResp' summary: DEVICES - Authenticate device tags: - Device /api/v/2/devices/{systemKey}/{name}: post: description: Adds a device in the system operationId: AddDevice parameters: - description: Token obtained through user authentication. in: header name: ClearBlade-UserToken required: true type: string - description: System key that identifies the system the device is a part of. in: path name: systemKey required: true type: string - description: Name of device. in: path name: name required: true type: string - description: Add device info. in: body name: body required: true schema: $ref: '#/definitions/deviceAdd' produces: - application/json responses: '200': description: Device added successfully schema: $ref: '#/definitions/deviceUpdate' '400': description: Bad Request. schema: $ref: '#/definitions/ErrorResp' '401': description: Unauthorized. '500': description: Server error. summary: DEVICES - Adds a device tags: - Device put: description: Updates a device's state or custom attributes. operationId: UpdateDeviceInfo parameters: - description: Token obtained through user authentication. in: header name: ClearBlade-UserToken required: true type: string - description: System key that identifies the system the device is a part of. in: path name: systemKey required: true type: string - description: Name of device. in: path name: name required: true type: string - description: Updated device info. in: body name: body required: true schema: $ref: '#/definitions/deviceUserUpdate' produces: - application/json responses: '200': description: Device updated. schema: $ref: '#/definitions/deviceUpdate' '400': description: Bad Request. schema: $ref: '#/definitions/ErrorResp' '401': description: Unauthorized. '500': description: Server error. summary: DEVICES - Update info tags: - Device /api/v/2/edges/{systemKey}: get: description: Returns all edge info that the current user is authorized to see. operationId: GetAllEdges parameters: - description: Token obtained through user authentication. in: header name: ClearBlade-UserToken required: true type: string - description: System Key that identifies the system that holds the edge. in: path name: systemKey required: true type: string - description: System Key that identifies the system you want the info about. in: query name: id required: true type: string produces: - application/json responses: '200': description: A list of the edges from the specified system. '400': description: Bad request. summary: EDGE - Fetch all edges tags: - Edge /api/v/3/edges/{systemKey}/{name}: delete: description: Deletes the specified edge from its system. operationId: DeleteEdgeByName parameters: - description: Developer Token obtained through admin authentication. in: header name: ClearBlade-UserToken required: true type: string - description: System key that identifies the system the edge currently belongs to. in: path name: systemKey required: true type: string - description: Name of the edge you're deleting. in: path name: name required: true type: string produces: - application/json responses: '200': description: No response was specified. '400': description: Bad request. summary: Edge - Delete edge tags: - Edge get: description: Returns the data from the specified edge. operationId: GetEdgeDataByName parameters: - description: Token obtained through user authentication. in: header name: ClearBlade-UserToken required: true type: string - description: System Key that identifies the system that holds the collection. in: path name: systemKey required: true type: string - description: Name of the edge. in: path name: name required: true type: string produces: - application/json responses: '200': description: Information about the specified edge. '400': description: Bad request. summary: Edge(name) - Get edge info tags: - Edge post: description: Creates a new edge in the specified system. operationId: CreateNewEdge parameters: - description: Developer Token obtained through admin authentication. in: header name: ClearBlade-UserToken required: true type: string - description: System key that identifies the system the new edge will belong to. in: path name: systemKey required: true type: string - description: Name of the edge you're creating. in: path name: name required: true type: string - description: New edge information. in: body name: body required: true schema: $ref: '#/definitions/edgeNew' produces: - application/json responses: '200': description: No response was specified. '400': description: Bad request. summary: EDGE - Create edge tags: - Edge put: description: Updates the specified edge's information. operationId: UpdateEdgeByName parameters: - description: Developer Token obtained through admin authentication. in: header name: ClearBlade-UserToken required: true type: string - description: System key that identifies the system the edge you're updating belongs to. in: path name: systemKey required: true type: string - description: Name of the edge you're updating. in: path name: name required: true type: string - description: Updated edge information. in: body name: Edge required: true schema: $ref: '#/definitions/edgeUpdate' produces: - application/json responses: '200': description: No response was specified. '400': description: Bad request. summary: EDGE - Update edge tags: - Edge /api/v/3/{systemKey}/deployments/{deploymentName}: delete: description: Deletes a deployment based on the name operationId: DeleteDeployment parameters: - description: User Token obtained through user authentication. in: header name: ClearBlade-UserToken required: true type: string - description: System Key that identifies the system that holds the deployment. in: path name: systemKey required: true type: string - description: Name of the deployment to delete in: path name: deploymentName required: true type: string produces: - application/json responses: '200': description: Deployment successfully deleted. '500': description: Server error. summary: DEPLOYMENT - Delete a deployment tags: - Deployments get: operationId: GetADeployment parameters: - description: User Token obtained through user authentication. in: header name: clearblade-usertoken required: true type: string - description: System Key that identifies the system that holds the deployment. in: path name: systemKey required: true type: string - description: Name of the deployment to retrieve in: path name: deploymentName required: true type: string produces: - application/json responses: '200': description: Retrieved deployment successfully '500': description: Server error. summary: DEPLOYMENTS - Gets a deloyment for a system tags: - Deployments put: description: Updates a deployment. operationId: UpdateDeployment parameters: - description: User Token obtained through user authentication. in: header name: ClearBlade-UserToken required: true type: string - description: System Key that identifies the system that holds the deployment. in: path name: systemKey required: true type: string - description: Name of the deployment to update in: path name: deploymentName required: true type: string - description: Updated deployment information. in: body name: body required: true schema: $ref: '#/definitions/updateDeployment' produces: - application/json responses: '200': description: Deployment successfully updated. '500': description: Server error. summary: DEPLOYMENT - Update deployment tags: - Deployments /api/v/4/{SystemKey}/adapters/{AdapterName}/control: put: description: Commands with files will send data to an edge operationId: AddEdgeCommand parameters: - description: System Key that identifies the system the adapter is a part of. in: path name: SystemKey required: true type: string - description: Identifies an adapter in the system. in: path name: AdapterName required: true type: string - description: Dev Token obtained through authentication. in: header name: ClearBlade-DevToken required: true type: string - description: Updated user information. in: body name: body required: true schema: $ref: '#/definitions/edgeCommand' produces: - application/json responses: '200': description: Edge command is working. '400': description: Bad Request. '401': description: Unauthorized. '500': description: Server error. summary: ADAPTERS - Send command to edge tags: - Adapter schemes: - https swagger: '2.0' tags: - description: User authentication and management. name: User - description: Device authentication and management. name: Device - description: Adapter configuration and management. name: Adapter - description: Interactions with data collections. name: Data - description: Interactions with code services. name: Code - description: MQTT messaging and push notifications. name: Messaging - description: Interactions with edges. name: Edge - description: Deployment CRUD Operations name: Deployments