Function Reference for the legacy version apiVersion:1

Accounts, Account Accesses, Short Domains, Domains

Scopes: Operator

.sharedAccount().read();                     // Read all shared accounts
.sharedAccount(id).read();                   // Read a single shared account
.sharedAccount(id).update(AccountDocument);  // Update a shared account

.sharedAccount(id).access().read();                    // Read all account accesses
.sharedAccount(id).access(id).read();                  // Read a single account access
.sharedAccount(id).access(id).update(AccessDocument);  // Update a single account access

.sharedAccount(id).shortDomain().read();  // Read a single account's short domains

.sharedAccount(id).domain().read();  // Read a single account's domains

Actions

Scopes: Operator, User, TrustedApplication, Device

.action(type).create(ActionDocument);  // Create an action
.action(type).read();                  // Read all actions of a type

.action(type, id).read();              // Read an action
.action(type, id).delete();            // Delete an action

Action Types

Scopes: Operator, TrustedApplication, User

.actionType().create(ActionTypeDocument);      // Create an action type
.actionType().read();                          // Read all action types

.actionType(type).read();                      // Read a single action type
.actionType(type).update(ActionTypeDocument);  // Update an action type
.actionType(type).delete();                    // Delete an action type

Application Users

Scopes: Operator, Application

.appUser().create(ApplicationUserDocument);  // Create an Application User
.appUser(id).validate(activationCode);       // Activate an Application User

.user().read();                              // Read all Application Users
.user(id).read();                            // Read an Application User
.user(id).update(ApplicationUserDocument);   // Update an Application User
.user(id).delete();                          // Delete an Application User

Batches and Tasks

Scopes: Operator

.batch().create(BatchDocument);          // Create a batch
.batch().read();                         // Read all batches

.batch(id).read();                       // Read a batch
.batch(id).update();                     // Update a batch
.batch(id).delete();                     // Delete a batch

.batch(id).task().create(TaskDocument);  // Create a task on a batch
.batch(id).task().read();                // Read all tasks
.batch(id).task(id).read();              // Read a task

Collections

Scopes: Operator, TrustedApplication, User

.collection().create(CollectionDocument);            // Create a collection
.collection().read();                                // Read all collections

.collection(id).read();                              // Read a collection
.collection(id).update(CollectionDocument);          // Update a collection
.collection(id).delete();                            // Delete a collection

.collection(id).thng().read();                       // Read all Thngs in a collection
.collection(id).thng().update(thngIds);              // Add Thngs to a collection
.collection(id).thng().delete();                     // Remove all Thngs in a collection

.collection(id).thng(id).delete();                   // Remove a Thng from a collection

.collection(id).collection().read();                 // Read all collections in a collection
.collection(id).collection().create(collectionIds);  // Add collections to a collection
.collection(id).collection().delete();               // Remove all collections from a collection

Files

Scopes: Operator

.file().create(FileDocument);  // Create a file
.file().read();                // Read all files

.file(id).read();              // Read a file
.file(id).delete();            // Delete a file

Places

Scopes: Operator, Application, TrustedApplication, User`

.place().create(PlaceDocument);    // Create a place
.place().read();                   // Read all places

.place(id).read();                 // Read a place
.place(id).update(PlaceDocument);  // Update a place
.place(id).delete();               // Delete a place

Products, Product Properties, Product Redirections

Scopes: Operator, Application, TrustedApplication, User

.product().create(ProductDocument);                  // Create a product
.product().read();                                   // Read all products

.product(id).read();                                 // Read a product
.product(id).update(ProductDocument);                // Update a product
.product(id).delete();                               // Delete a product

.product(id).property().read();                      // Read product properties
.product(id).property().update(PropertiesDocument);  // Update product properties

.product(id).property(key).read();                   // Read product property history
.product(id).property(key).update(value);            // Update a product property
.product(id).property(key).delete();                 // Delete a product property

.product(id).redirection().create(RedirectionDocument);  // Create a product's redirection
.product(id).redirection().read();                       // Read a product's redirection
.product(id).redirection().update(RedirectionDocument);  // Update a product's redirection
.product(id).redirection().delete();                     // Delete a product's redirection

Projects, Applications, Reactor, Application Redirector

Scopes: Operator, TrustedApplication

.project().create(ProjectDocument);                        // Create a project
.project().read();                                         // Read all projects

.project(id).read();                                       // Read a project
.project(id).update(ProjectDocument);                      // Update a project
.project(id).delete();                                     // Delete a project

.project(id).application().create(ApplicationDocument);    // Create an application
.project(id).application().read();                         // Read all applications in a project

.project(id).application(id).read();                       // Read an application
.project(id).application(id).update(ApplicationDocument);  // Update an application
.project(id).application(id).delete();                     // Delete an application

.project(id).application(id).secretKey().read();  // Read Trusted Application API Key

.project(id).application(id).redirector().read();  // Read an application
.project(id).application(id).redirector()          // Update an application
  .update(ApplicationDocument);

.project(id).application(id).reactor.log().read();         // Read Reactor logs

.project(id).application(id).reactor.script().read();  // Read the Reactor script
.project(id).application(id).reactor.script()          // Update the Reactor script
  .update(ReactorScriptDocument);

.project(id).application(id).reactor.schedule()    // Create a Reactor schedule
  .create(ReactorScheduleDocument);
.project(id).application(id).reactor.schedule()    // Read all Reactor schedules
  .read();
.project(id).application(id).reactor.schedule(id)  // Read a Reactor schedule
  .read();
.project(id).application(id).reactor.schedule(id)  // Update a Reactor schedule
  .update(ReactorScheduleDocument);
.project(id).application(id).reactor.schedule(id)  // Delete a Reactor schedule
  .delete();

Purchase Orders

Scopes: Operator, TrustedApplication, User

.purchaseOrder().create(PurchaseOrderDocument);  // Create a purchase order
.purchaseOrder().read();                         // Read all purchase orders

.purchaseOrder(id).read();                       // Read a purchase order
.purchaseOrder(id).update();                     // Update a purchase order
.purchaseOrder(id).delete();                     // Delete a purchase order

Account Redirector

Scopes: Operator

.redirector().read();                      // Read account Redirector
.redirector().update(RedirectorDocument);  // Update account Redirector

Roles, Permissions, and Role Policies

Scopes: Operator

.role().create(RoleDocument);                           // Create a role
.role().read();                                         // Read all roles

.role(id).read();                                       // Read a role
.role(id).update(RoleDocument);                         // Update a role
.role(id).delete();                                     // Delete a role

.role(id).permission().read();                          // Read role permissions
.role(id).permission().update(RolePermissionDocument);  // Update role permissions

Shipment Notices

Scopes: Operator

.shipmentNotice().create(ShipmentNoticeDocument);  // Create a shipment notice
.shipmentNotice().read();                          // Read all shipment notices

.shipmentNotice(id).read();                        // Read a shipment notice
.shipmentNotice(id).update();                      // Update a shipment notice
.shipmentNotice(id).delete();                      // Delete a shipment notice

Thngs, Thng Properties, Thng Redirections, Thng Commission State

Scopes: Operator, TrustedApplication, User

.thng().create(ThngDocument);                     // Create a Thng
.thng().read();                                   // Read all Thngs

.thng(id).read();                                 // Read a Thng
.thng(id).update(ThngDocument);                   // Update a Thng
.thng(id).delete();                               // Delete a Thng

.thng(id).location().read();                      // Read a Thng's location
.thng(id).location().update(LocationDocument);    // Update a Thng's location

.thng(id).property().read();                      // Read Thng properties
.thng(id).property().update(PropertiesDocument);  // Update Thng properties

.thng(id).property(key).read();                   // Read a Thng property's history
.thng(id).property(key).update(value);            // Update a Thng property's history
.thng(id).property(key).delete();                 // Delete a Thng property's history

.thng(id).redirection().create(RedirectionDocument);  // Create a Thng's redirection
.thng(id).redirection().read();                       // Read a Thng's redirection
.thng(id).redirection().update(RedirectionDocument);  // Update a Thng's redirection
.thng(id).redirection().delete();                     // Delete a Thng's redirection

.thng(id).commissionState().read();  // Read Thng commissioning state

Other Requests

For all other requests (such as setting an account's role) that aren't implemented in the evrythng.js SDK, you can use api(). For example:

evrythng.api({ url: '/time' })
  .then(console.log);