DataStorage Service
Api Reference Guide
cURL Javascript

Introduction

Welcome to the AssetWise DataStorage API!

The DataStorage REST API provides an intuitive programming interface to all AssetWise Information Management data entities, and this web site is the starting point for exploring the DataStorage REST programming interface to the AssetWise Information Management data entities. Its three-panel display contains entity tree, content and sample code panes.

Quick Links

Jump to Searching for Objects

Jump to Retrieving Objects

Jump to Swagger API Documentation

Navigating the Documentation

The recommended navigation of this web site is as follows. Users can make the best use of this documentation web site by adopting the following approach.

 

 

Choose Entity that Best Satisfies Current Requirement. The DataStorage Service REST API provides resources to manage many types of entities, including documents, tags, projects, people, organizations, and relationships between these types of objects. The first step in accessing the API is to determine the most appropriate entity to use.

Navigate or Search DataStorage Tree to Find Entity. Browse the identity tree or use the search field to find the chosen entity. Most of the commonly used entities, including documents, tags, projects, people, organizations, are available in the Business Entities section of the entity tree.

Click Entity to Display its Documentation in the Content Pane. Clicking on the chosen entity displays information about the entity in the content pane, including the available parameters and associated default values. Add any of the available parameters to an HTTP header and set values as required to send information to the DataStorage Service.

Choose Action to Perform on the Entity. The DataStorage Service REST API uses HTTP methods to access or update entities. Use the GET method to search for entities matching criteria specified in the HTTP header. The PATCH and POST methods allow additions or updates to server entities. The sample code pane illustrates correct calling comventions for the HTTP request methods.

Choose Parameter Values for Selected Action. Specify entities to search for through parameters in the request header. Most GET methods create EQL queries to return result sets. Adding a context to the HTTP header restricts searching to a specific AssetWise community. Similarly, adding an "id" to the HTTP header retrieves the entity specified by the "id" and its associated metadata.

Test API Call in Swagger. Use the "Try me in Swagger" link to test the operation of the API. The Swagger page "Try it out" function sends parameters to the DataStorage Service in the HTTP header. Users may find it helpful to have the documentation page open in a separate browser window while they are

Review Results. The Swagger "Try it out" feature causes the API to process the HTTP request, and returns the results on the Swagger page.

Using the API

Users access the API by invoking an HTTP request method, most commonly GET or POST, to act on a resource. HTTP requests to the DataStorage Service access resources, while their headers pass additional information to and from the server.

RESTful resources are pluralized nouns, e.g., Persons. There are usually many instances of each type of resource, and users can access a specific resource by providing its unique identifier, such as Persons/{id}. Resources are held in a data source or 'context' that comprises part of a URL, e.g., {context}/Persons/{id}.

The prefix api isolates APIs from other application resources, e.g., api/{context}/Persons/{id}. The prefix can also distinguish between different versions of the API, as in api-v2/{context}/Persons/{id}. The full URL includes the protocol, server and port according to the following pattern.

{protocol}://{server}[:{port}]/api[-{version}[/{context}]/{Resource}[/{id}]

 

# A single Person in a specific community
https://datastorage.bentley.com/api/3422FC0E-136C-4532-9D8B-F8B2CE28A94C/Persons/123

# A collection of Persons in a specific community
https://datastorage.bentley.com/api/3422FC0E-136C-4532-9D8B-F8B2CE28A94C/Persons

# A collection of all Open Sessions of the user for all available communities
https://session.bentley.com/api/Sessions

# The same call as above but targeting a specific version of the API
https://session.bentley.com/api-v1/SomeOldEntity

The following figure illustrates a complete GET and POST requests to an HTTP server, including authentication.

 

 

Query Parameters

Use a GET method when the query parameters produce a URL that is shorter than 2000 characters.

$ curl -X GET "https://datastorage.dev.aw-au.bentley.com/api/0/Documents?filter=Name+LIKE+%27A%25%27"

If the query parameters would produce a URL that is longer than 2000 characters, use a POST method with the query parameters in the request body.

curl -X POST "https://datastorage.dev.aw-au.bentley.com/api/0/Search" /
-H "Content-Type: text/plain" /
-d "START WITH Document SELECT Id, Code WHERE Name LIKE 'A%'"

Authentication

# Login to Session service (at https://session.dev.aw-au.bentley.com)
#    Once logged in you can yet your sessionToken from : https://session.dev.aw-au.bentley.com/Session/Token?authority=https%3A%2F%2Fqa-imsoidc.bentley.com&label=session
$sessionToken = "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjQ3OTQ4QjgzNTY2RDk1MDAxODRDQjRC ..."

#    Then use the SessionToken to get the desired [IMS] AccessToken
$headers = @{
    "Authorization" = "Bearer $sessionToken"
}

# Call the DataStorage
$result = Invoke-WebRequest -Uri "https://datastorage.dev.aw-au.bentley.com/api/0/Documents?pageSize=20" -Method GET -Headers $headers 

# Display the results
$result.Content

Make sure to replace sessionToken with your API key.

Authenticating client connections to the HTTP server requires three steps.

  1. Call the IMS Authority Service to obtain an IMS access token.

  2. Pass the IMS access token to the Session Service to obtain a session bearer token.

  3. Parameterize the session bearer token into a DataStorage Service HTTP request header.

DataStorage expects the SessionTokens to be included in all API requests to the server in a header that looks like the following:

Authorization: eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjQ3OTQ4QjgzNTY2RDk1MDAxODRDQjRC ...

Context

A context (community) is a collection of AssetWise data, users, groups and permissions. A context may exist in one database or be distributed across several servers. Users may not simultaneously access information from multiple communities.

Searching

All business entities provide a GET request method to search for entities matching user-supplied filter criteria with the following syntax. /api/{Context}/{EntityNameInPlural}?include=Id,Code,Class.Id&filter=Code LIKE '*LN9*'&startAt=1&pageSize=30&order=Class.Id

The result of a search operation is a flat list of the properties selected in the include parameter. This list may contain properties from any level of the object hierarchy.

Users must specify a context (community) to narrow the search. Setting the value of the context parameter to "0" references the current context.

Before invoking the method, set up the HTTP request header to pass the following parameters to the HTTP server.

  1. Set the "Authorization" parameter to a valid session bearer token.

  2. Use the following parameters to control how results are returned.

    Parameter Description
    include Properties to return in result set. (Defaults to "Id", "Name", "Code" and "Class.Id" depending on the Entity)
    filter Search criteria. (Defaults to "Id>1".)
    order Ordering of the search results.
    startAt Index of the first row returned. (Defaults to 1.)
    pageSize Maximum number of rows returned. (User specific setting.)

The result set contains a list of properties for entities satisfying the search criteria. The result set should include the "id" parameter to allow further entity operations, such as retrieving more detailed information related to an entity of interest.

Return to Introduction

Retrieving

The GET request method can retrieve more detailed information for a specific entity identified by "id", and the syntax for this form of the GET request is as follows.

/api/{Context}/{EntityNameInPlural}/{id}?include=Header;Attributes

The Retrieve operation returns the object hierarchy based on the Retrieve Options applied in the include parameter. Every retrievable entity supports the "Header" option which typically populate the primary properties of the object (e.g. Name, Code etc). Options can be combined in a single request using the ; as a separator. Options may also be specialized with filters. For more information on the available options and their filters per entity please check the related entity section.

Users must provide the "id" for an entity of interest, and a context (community). Setting the value of the context parameter to "0" references the current context.

Before invoking the method, set up the HTTP request header to pass the following parameters to the HTTP server.

  1. Set the "Authorization" parameter to a valid session bearer token.

  2. Use the following parameters to control how results are returned.

    Parameter Description
    include Entity specific Retrieve options (Defaults to "Header").

The result set can include a more detailed set of properties for the entity specified by "id". Setting the value of the "include" parameter to "Header" returns a predefined set of properties.

Return to Introduction

Transaction

Every operation that affects the state of an entity is executed in its own transaction (except when Bulk Transactions are used). When an error occurs the transaction is rolled back and no changes are applied.

Add, Change, Delete

The caller doesn't need to take any special action for executing the operation using a transaction. User's ability to Add, Change or Delete an entity is controlled by his/her permissions and roles which are configured by the system administrator.

Paging

Due to the extended size of Business Entities all GET operations support Paging, typically controlled with parameters like startAt and pageSize. The latter is constraint by a system setting (MaxRowsToReturn).

When no pageSize is defined, the system will return at most MaxRowsToReturn records and the caller needs to repeat the request by setting the startAt parameter to the appropriate value (e.g. startAt += pageSize). e.g. /api/{Context}/{EntityNameInPlural}?include=Id,Code,Class.Id&filter=Code LIKE '*LN9*'&startAt=1&pageSize=30&order=Class.Id and then repeat /api/{Context}/{EntityNameInPlural}?include=Id,Code,Class.Id&filter=Code LIKE '*LN9*'&startAt=31&pageSize=30&order=Class.Id

The same logic applies for retrieve options that support the related filters. /api/{Context}/{Entity}/{id}?include=Header;Attributes[startAt=1, pageSize=30] and repeat with /api/{Context}/{Entity}/{id}?include=Header;Attributes[startAt=31, pageSize=30]

Bulk Transactions

Not available yet.

Errors

When a request cannot be handled by the system, the response status code is 4xx or 5xx (depending on the case) and an error description is available in the response body.

When the error is something that requires the user's attention, then the status code is in the 4xx range. When the error is unexpected the response is 500 and the user is advised to log a defect with the request and response data.

GET

The GET method is used to retrieve a resource or collection of resources. GET should only retrieve data and should have no other effect on the data.

Typical return codes differ between getting a known resource vs searching across possible resources. When you access a known resource the possible Error codes may be

Code Description
400 Bad Request (for 'syntax' issues)
401 Unauthorized (not signed-in)
403 Forbidden (no permission to access the resource)
404 Not Found
500 Internal Server Error (unexpected server error)

When searching across possible resources the possible Error codes may be:

Code Description
400 Bad Request (for 'syntax' or invalid input issues)
401 Unauthorized (not signed-in)
500 Internal Server Error (unexpected server error)

POST

Use POST to create or add a new resource. The result of a POST is typically a new identifier which can later be used as part of the resource identifier

Possible Error codes are:

Code Description
400 Bad Request (the system can complete the request with the provided data)
401 Unauthorized (not signed-in)
403 Forbidden (no permission)
409 Conflict (when trying to add a record that already exists e.g. primary key violation)
500 Internal Server Error (unexpected server error)

PUT

Use PUT to replace a resource in its entirety. Complex resources will typically not be replaced but rather just changed partially. For those cases use PATCH instead. Because PUT [re]places the entire resource it can also be used in cases where the unique identifiers is known by the caller. I.e. as an add or replace.

Possible Error codes are:

Code Description
400 Bad Request (for 'syntax' or invalid input issues)
401 Unauthorized (not signed-in)
403 Forbidden (no permission)
404 Not Found
500 Internal Server Error (unexpected server error)

PATCH

Use PATCH for partial updates to a resource. This is most commonly associated with change. With PATCH you typically only send the data you want to change. Also use PATCH when sending batch updates to the server. I.e. updates that affect more than one resource.

Possible Error codes are:

Code Description
400 Bad Request (for 'syntax' or invalid input issues)
401 Unauthorized (not signed-in)
403 Forbidden (no permission)
404 Not Found
500 Internal Server Error (unexpected server error)

DELETE

Removes the resource or collection of resources.

Possible Error codes are:

Code Description
400 Bad Request (for 'syntax' or invalid data issues)
401 Unauthorized (not signed-in)
403 Forbidden (no permission)
404 Not Found
500 Internal Server Error (unexpected server error)

Common Objects

Objects

Supported operations

Searching [GET] /api/{Context}/Objects

Retrieving [GET] /api/{Context}/Objects/{id}

Create From Template [POST] /api/{Context}/Templates/{id}/Instances

An Object is an 'Independent Object' and a key entity in the system.

An Object can be classified using Class and support Templates.

The read-only Id property is the unique identifier. This identifier is assigned on creation and used in subsequent actions like Retrieve .

An Object supports Namespace identification.

The ObjectType identifier for Object is 231.

The Object does not support Instance Permission (i.e. Permission to View/Add/Change/Delete are granted accross all records of this Type).

You can use Object as the root [START WITH] type in a Search . A number of properties including: Id, Type, Label, Keywords, Notes, Responsibilities etc. are available to the search. To find a full list of searchable properties use SearchableTypes .

Searching Objects

$ curl https://datastorage.dev.aw-au.bentley.com//api/{Context}/Objects/?include=Id,Name,Code,Class.Id&filter=Id=1&startAt=0&pageSize=20
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function searchObjects( host, include= 'Id,Name,Code,Class.Id', filter, order, startAt = 0, pageSize = 10) {
   let requestUrl = host + '/api/0/Objects?include=' + include +'&filter=' + filter +;&order=' + order +'&startAt=' + startAt + '&pageSize=' + pageSize;
   const init = {
      method: 'GET',
      headers: {
         Authorization: 'bearer {token}'
         }
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

[
{
  "classId": 998,
  "code": "sample",
  "id": 998,
  "name": "sample"
},
{
  "classId": 999,
  "code": "sample",
  "id": 999,
  "name": "sample"
}
]

Enables Searching on Objects using the EQL logic.

Use the GET request method to search for Objects that satisfy a set of search criteria.

GET /api/{Context}/Objects

Specify a context (community) to indicate the data source. The default value "0" references the current context.

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server.

  1. Set the "Authorization" parameter to a valid session bearer token.

  2. Use the parameters in the table below to control how the result set displays the returned properties.

The result set contains the selected list of properties for Objects satisfying the provided search criteria. The result set should include the "id" parameter to allow further operations, such as retrieving detailed information related to a Object of interest.


Try me in EqlExplorer
Try me in Swagger

Search Object Request Info

Info Description
url http(s)://{server}/api/{context}/Objects
Request GET
Media Type application/json
Response An Array of objects with the selected properties (key-value pairs).

Search Object Request Parameters

Parameter Default Description
include Id,Name,Code,Class The properties to include in the result.
filter Id>1 The search criteria
order Id How to order the results
startAt 1 The index of the first row to return. (Rows are determined base on order)
pageSize the number of rows to return The max number of row to return
context The session context The context (aka community) whose data are being accessed

Search Object Responses

Status Description
200, OK When there is at least one record that satisfies the provided filter.
204, No Content When there is no record that satisfies the provided filter.
400, Bad Request When there is an error in the provided parameters (e.g. syntax error in filter).
401, Unauthorized When access is attempted with no authorization header (see #authentication).
500, Internal Server Error An unexpected error occured.

Retrieving Objects

$ curl https://datastorage.dev.aw-au.bentley.com/{Context}/Objects/242?include={RetrieveOptions}
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function retrieveObjects( host, id, retrieveOptions = 'Header') {
   let requestUrl = host + '/api/0/Objects/id/?include=' + retrieveOptions;
   const init = {
      method: 'GET',
      headers: {
         Authorization: 'bearer {token}'
         }
      }
   return (await fetch(requestUrl, init)).json();
}

Retrieves a single Object instance the properties of which are populated based on the request parameters.

This GET request method can retrieve more detailed information for the Object identified by its "id". The syntax for this form of the GET request is as follows.

GET /api/{Context}/Objects/{id}

Use the "id" for the Object to retrieve, and specify a context (community) to narrow the search. The default value "0" references the current context.

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server.

  1. Set the "Authorization" parameter to a valid session bearer token.

  2. Use the "include" parameter to specify the properties returned in the result set. (Defaults to "Header").

The GET method returns the properties specified in the HTTP request header for the document copy identified by "id".


Try me in RetrieveExplorer
Try me in Swagger

Search Object Request Info

Info Description
url http(s)://{server}/api/{context}/Objects
Request GET
Media Type application/json
Response The Object with the [name](#retrieve-object-properties-per-include-option. properties populated.

Retrieve Object Request Parameters

Parameter Default Description
Id NULL The Identifier of the object to Retrieve.
include Header Which Properties to include (see ).
context The session context The context (aka community) whose data are being accessed

Retrieve Object Properties per include option.

Retrieve Option Property Type
Header IsTemplate bool?
Header Id int
Header Name string
Header Code string
Header Class Class
Header Type int?
Header VersionOrMiddle string
Header Revision string
Header Description string
Header Label string
Header Scope Scope
Header Namespace Namespace
Header Intent Intent
Header Flags long?
Header Guid Guid?
Header DateEffective DateTime?
Header DateObsolete DateTime?
Header IsLocked bool?
Header PermissionHint int?
Header StateHint int?
Header DateAdded DateTime?
Header AddedBy Person
Header DateChanged DateTime?
Header ChangedBy Person
Header Lock ObjectLock
Keywords Keywords List of ObjectKeyword. Supported Filters
[StartAt=value]
[PageSize=value]
Notes Notes List of Note. Supported Filters
[StartAt=value]
[PageSize=value]
Header Responsibilities List of Responsibility
Header CrossReferences List of CrossReference
AuditDetails AuditDetails List of AuditDetail
Settings Settings List of Setting. Supported Filters
[StartAt=value]
[PageSize=value]
[SettingDef.Id=value]
[SettingDef.Code=value]
[SettingDef.Id IN (comma delimited values)]
[SettingDef.Code IN (comma delimited values)]
[SettingDef.Intent.Id=value]
[SettingDef.Intent.Code=value]
[SettingDef.Category.Id IN (comma delimited values)]
[SettingDef.Category.Name IN (comma delimited values)]
Attributes Attributes List of Attribute. Supported Filters
[StartAt=value]
[PageSize=value]
[ForUseWithSecurity=value]
[IsLinked=value]
[CompleteMemo=value]
[AttributeDef.Id IN (comma delimited values)]
[AttributeDef.IsIntrinsic=value]
[AttributeDef.DataType IN (comma delimited values)]
[AttributeDef.DataType NOT IN (comma delimited values)]
[AttributeDef.Name=value]
Securities Securities List of Security. Supported Filters
[StartAt=value]
[PageSize=value]
[Permission&=value]
AttributeSecurities AttributeSecurities List of AttributeSecurity. Supported Filters
[StartAt=value]
[PageSize=value]
[AttributeGroup.Id=value]
[AttributeDef.Id=value]
SettingSecurities SettingSecurities List of SettingSecurity. Supported Filters
[StartAt=value]
[PageSize=value]
[SettingDef.Id=value]
FileContainer FileContainer ObjectFileContainer
Header Subscriptions List of Subscription
Header Subscribers List of Subscriber
Header IsPrototype bool?
Trends Trends List of ObjectTrend. Supported Filters
[StartAt=value]
[PageSize=value]
AttributeDomainSources AttributeDomainSources List of AttributeDomainSource. Supported Filters
[StartAt=value]
[PageSize=value]
[AttributeDef.Id IN (comma delimited values)]
[SourceObjectType IN (comma delimited values)]
Automations Automations List of ObjectAutomation
Layouts Layouts List of ObjectLayout
Blobs Blobs List of ObjectBlob. Supported Filters
[Id=value]
Behaviors Behaviors List of ObjectBehavior
Relationships Relationships List of Relationship. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
ContextualReports ContextualReports List of ReportContext. Supported Filters
[StartAt=value]
[PageSize=value]
[ExcludeInherited=value]
InheritanceHierarchy InheritanceHierarchy List of OrdinalObject
RelationshipGraph RelationshipGraph List of Relationship
Header Parent Object
Header Root Object
Children Children List of Object. Supported Filters
[StartAt=value]
[PageSize=value]
[DisplayFullDescription=value]
[Options=value]
[Files=value]
[IRVirtualItemDocuments=value]
[IRVirtualItemPhysicalItems=value]
[EDClassification=value]
[EDLocations=value]
[EDManufacturerPhysicalItems=value]
[EDManufacturerSerializedItems=value]
[EDWorkExchange=value]
[VirtualItemTags=value]
[WorkTaskOrganizations=value]
[VirtualItemDocuments=value]
[VirtualItemPhysicalItems=value]

RetrieveObject Responses

Status Description
200, OK The operation was completed successfully and the response body contains the result.
204, No Content The operation resulted no records (e.g. filter does not produce any result).
400, Bad Request When there is an error in the provided parameters (e.g. syntax error in filter).
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to access this instance.
500, Internal Server Error An unexpected error occured.

Templates

Supported operations

Searching [GET] /api/{Context}/Templates

Retrieving [GET] /api/{Context}/Templates/{id}

Creating [POST] /api/{Context}/Templates

Changing [PATCH] /api/{Context}/Templates/{id}

Deleting [DELETE] /api/{Context}/Templates/{id}

Creating Business Objects [POST] /api/{Context}/Templates/{id}/Instances

A Template is an 'Independent Object'.

A Template may be created in any Scope .

The read-only Id property is the unique identifier. This identifier is assigned on creation and used in subsequent actions like Retrieve .

A Template supports Namespace identification.

A Template is unique across ( name, object_type, namespace_id ).

The ObjectType identifier for Template is 188.

The Template supports the instance permissions: View, Modify, Approve, CanUse and Delete in addition to the Type permission that governs its creation.

You can use Template as the root [START WITH] type in a Search . A number of properties including: Id, Scope, Namespace, Name, Description, AuditDetails etc. are available to the search. To find a full list of searchable properties use SearchableTypes .

Templates let users easily create objects. When a user instantiates an entity, the system copies the relevant template so that the resulting object inherits default attribute values, relationships and security definition from the template. Each AssetWise entity may have multiple templates with differing properties, relationships and security. All templates associated with an entity class inherit all of the attributes associated with the class. However, each template associated with the class can assign different default values to the objects created from the template.

Creating Business Objects

Request Body (JSON)

{
  "mask": "string value",
  "options": "string value",
  "attributes": null
}

$ curl -X POST https://datastorage.dev.aw-au.bentley.com/{Context}/Templates/{id}/Instances
-H "Accept: application/json"
-H "Authorization: Bearer {token}"
-d "see json request body"

// the modelPost structure is described in the Request Json 
async function createFromTemplate( host, templateId, templateInstancePost) {{
   let requestUrl = host + '/api/0/Templates/'+templateId+'/Instances'
   const init = {
      method: 'POST',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = templateInstancePost.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

{
  "id": 999
}

Creating business objects can be achieved by making use of the following methods.

Templates are special system objects which allow the creation of new Business Entities using a parametrized entity -the model.

Post Creating Business Objects Request Info

Info Description
url http(s)://{server}/api/{context}/Templates/{id}/Instances
Request POST
Media Type application/json
Response The Id of the newly created business Object

Post Creating Business Objects Info

The Creating Business Objects POST request accepts the TemplateInstancePost contract, with the following properties

Name Type
Mask string
Options string
Attributes System.Collections.Generic.Dictionary

Searching Templates

$ curl https://datastorage.dev.aw-au.bentley.com//api/{Context}/Templates/?include=Id,Name,Class.Id&filter=Id=1&startAt=0&pageSize=20
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function searchTemplates( host, include= 'Id,Name,Class.Id', filter, order, startAt = 0, pageSize = 10) {
   let requestUrl = host + '/api/0/Templates?include=' + include +'&filter=' + filter +;&order=' + order +'&startAt=' + startAt + '&pageSize=' + pageSize;
   const init = {
      method: 'GET',
      headers: {
         Authorization: 'bearer {token}'
         }
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

[
{
  "classId": 998,
  "id": 998,
  "name": "sample"
},
{
  "classId": 999,
  "id": 999,
  "name": "sample"
}
]

Enables Searching on Templates using the EQL logic.

Use the GET request method to search for Templates that satisfy a set of search criteria.

GET /api/{Context}/Templates

Specify a context (community) to indicate the data source. The default value "0" references the current context.

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server.

  1. Set the "Authorization" parameter to a valid session bearer token.

  2. Use the parameters in the table below to control how the result set displays the returned properties.

The result set contains the selected list of properties for Templates satisfying the provided search criteria. The result set should include the "id" parameter to allow further operations, such as retrieving detailed information related to a Template of interest.


Try me in EqlExplorer
Try me in Swagger

Search Template Request Info

Info Description
url http(s)://{server}/api/{context}/Templates
Request GET
Media Type application/json
Response An Array of objects with the selected properties (key-value pairs).

Search Template Request Parameters

Parameter Default Description
include Id,Name,Class The properties to include in the result.
filter Id>1 The search criteria
order Id How to order the results
startAt 1 The index of the first row to return. (Rows are determined base on order)
pageSize the number of rows to return The max number of row to return
context The session context The context (aka community) whose data are being accessed

Search Template Responses

Status Description
200, OK When there is at least one record that satisfies the provided filter.
204, No Content When there is no record that satisfies the provided filter.
400, Bad Request When there is an error in the provided parameters (e.g. syntax error in filter).
401, Unauthorized When access is attempted with no authorization header (see #authentication).
500, Internal Server Error An unexpected error occured.

Retrieving Templates

$ curl https://datastorage.dev.aw-au.bentley.com/{Context}/Templates/242?include={RetrieveOptions}
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function retrieveTemplates( host, id, retrieveOptions = 'Header') {
   let requestUrl = host + '/api/0/Templates/id/?include=' + retrieveOptions;
   const init = {
      method: 'GET',
      headers: {
         Authorization: 'bearer {token}'
         }
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

/* Sample request for Template */
{
  "name": "sample",
  "description": "sample",
  "codeMask": "sample",
  "class": {
    "code": "sample",
    "name": "sample",
    "sysType": "sample",
    "isSyncTracked": false,
    "path": "sample",
    "id": 999
  },
  "model": {
    "type": 999,
    "label": "sample",
    "id": 999
  },
  "identGenFlag": 999,
  "isPrototype": true,
  "codeMaskExpression": "sample",
  "usageFlags": 999,
  "status": "sample",
  "scope": {
    "name": "sample",
    "id": 999
  },
  "namespace": {
    "name": "sample",
    "id": 999
  },
  "hasFlags": 9999,
  "permissionHint": 999,
  "dateAdded": "2020-09-10T12:09:03.311347+01:00",
  "addedBy": {
    "id": 999
  },
  "dateChanged": "2020-09-10T12:09:03.311518+01:00",
  "changedBy": {
    "id": 999
  },
  "revisionRule": {
    "id": 999,
    "forceOrder": false,
    "forceValue": false
  },
  "snapshotDef": {
    "autoOnly": true,
    "cardinality": 999,
    "contentRetrieveOptions": "sample",
    "derivedFrom": {
      "id": 999
    },
    "id": 999,
    "mayIgnoreEvent": true,
    "renditionType": 999,
    "targetType": 999
  },
  "id": 999
}

Retrieves a single Template instance the properties of which are populated based on the request parameters.

This GET request method can retrieve more detailed information for the Template identified by its "id". The syntax for this form of the GET request is as follows.

GET /api/{Context}/Templates/{id}

Use the "id" for the Template to retrieve, and specify a context (community) to narrow the search. The default value "0" references the current context.

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server.

  1. Set the "Authorization" parameter to a valid session bearer token.

  2. Use the "include" parameter to specify the properties returned in the result set. (Defaults to "Header").

The GET method returns the properties specified in the HTTP request header for the document copy identified by "id".


Try me in RetrieveExplorer
Try me in Swagger

Search Template Request Info

Info Description
url http(s)://{server}/api/{context}/Templates
Request GET
Media Type application/json
Response The Template with the [name](#retrieve-template-properties-per-include-option. properties populated.

Retrieve Template Request Parameters

Parameter Default Description
Id NULL The Identifier of the object to Retrieve.
include Header Which Properties to include (see ).
context The session context The context (aka community) whose data are being accessed

Retrieve Template Properties per include option.

Retrieve Option Property Type
Header Id int
Header Name string
Header Class Class
Header Scope Scope
Header Namespace Namespace
Header Description string
AuditDetails AuditDetails List of AuditDetail
Securities Securities List of Security. Supported Filters
[StartAt=value]
[PageSize=value]
[Permission&=value]
Header HasFlags long?
Header PermissionHint int?
Header CodeMask string
Header Status string
Header CodeMaskExpression string
Header IdentGenFlag int?
Header IsPrototype bool?
Header Model Object
Layouts Layouts List of ObjectLayout
Behaviors Behaviors List of ObjectBehavior
Header UsageFlags int?
Header DateAdded DateTime?
Header AddedBy Person
Header DateChanged DateTime?
Header ChangedBy Person
Header RevisionRule RevisionRule
Instances Instances List of TemplateInstance. Supported Filters
[StartAt=value]
[PageSize=value]
Automations Automations List of ObjectAutomation
SnapshotDef SnapshotDef SnapshotDef
Tasks Tasks List of TaskTemplate

RetrieveTemplate Responses

Status Description
200, OK The operation was completed successfully and the response body contains the result.
204, No Content The operation resulted no records (e.g. filter does not produce any result).
400, Bad Request When there is an error in the provided parameters (e.g. syntax error in filter).
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to access this instance.
500, Internal Server Error An unexpected error occured.

Creating Templates

Try me in Swagger

Request Body (JSON)

{
  "name": "string value",
  "description": "string value",
  "codeMask": "string value",
  "class": {
    "id": 999
  },
  "model": {
    "type": 999,
    "id": 999
  },
  "identGenFlag": 999,
  "isPrototype": true,
  "codeMaskExpression": "string value",
  "usageFlags": 999
}

$ curl -X POST https://datastorage.dev.aw-au.bentley.com/{Context}/Templates
-H "Accept: application/json"
-H "Authorization: Bearer {token}"
-d "see json request body"

// the modelPost structure is described in the Request Json 
async function postTemplates( host, modelPost) {
   let requestUrl = host + '/api/0/Templates
   const init = {
      method: 'POST',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = modelPost.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

{
  "id": 999
}

The following methods are available for creating a new instance of Template.

  1. Calling the API directly providing the required data.

  2. Using a Template

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server. Set the "Authorization" parameter to a valid session bearer token.

Add Template Request Info

Info Description
url http(s)://{server}/api/{context}/Templates
Request POST
Media Type application/json
Response The Id of the newly created item

Post Template Contract Info

The POST request for Template contract has the following properties

Name Type
Name string
Description string
CodeMask string
Class IdPost
Model IdTypePost
IdentGenFlag int
IsPrototype bool
CodeMaskExpression string
UsageFlags int

Add Template Response Statuses

Status Description
201, Created A new instance was created and the result body contains the id of the instance.
400, Bad Request The Server could not create the instance. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to create new objects of this type.
409, Conflict When the provided record already exists.
500, Internal Server Error An unexpected error occured.

Changing Templates

Try me in Swagger

Request Body (JSON)

{
  "name": "string value",
  "description": "string value",
  "codeMask": "string value",
  "class": {
    "id": 999
  },
  "status": "string value",
  "model": {
    "id": 999
  },
  "identGenFlag": 999,
  "isPrototype": true,
  "codeMaskExpression": "string value",
  "usageFlags": 999,
  "id": 999
}

$ curl -X PATCH https://datastorage.dev.aw-au.bentley.com/{Context}/Templates
-H "Accept: application/json"
-H "Authorization: Bearer {token}"
-d "see json request"

// the modelPatch structure is described in the Request Json 
async function patchTemplates( host, id, modelPatch) {
   let requestUrl = host + '/api/0/Templates/'+id
   const init = {
      method: 'PATCH',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = modelPatch.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Saves the modification on the Template instance to the database.

Try me in Swagger

Change Template Request Info

Info Description
url http(s)://{server}/api/{context}/Templates
Request PATCH
Media Type application/json
Response status

Patch Template Contract Info

The Template properties for a PATCH requests are:

Name Type
Name string
Description string
CodeMask string
Class IdPatch
Status string
Model IdPatch
IdentGenFlag int
IsPrototype bool
CodeMaskExpression string
UsageFlags int
Id int

Patch Template Responses

Status Description
204, No Content The change was successful.
400, Bad Request The Server could not apply the change. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to Modify this instance or any instance of this type.
409, Conflict When the change request will produce a duplicate entry.
500, Internal Server Error An unexpected error occured.

Deleting Templates

Try me in Swagger

$ curl -X DELETE https://datastorage.dev.aw-au.bentley.com/{Context}/Templates/123
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function DeleteTemplates( host, id) {
   let requestUrl = host + '/api/0/Templates/+id+
   const init = {
      method: 'DELETE',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = model.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Deletes the Template instance from the database.

Delete Template Request Info

Info Description
url http(s)://{server}/api/{context}/Templates/{id}
Request DELETE
Media Type text/json
Response status

Delete Template Responses

Status Description
204, No Content The deletion was successful.
400, Bad Request The Server could not delete the instance. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to Delete this instance or any instance of this type.
500, Internal Server Error An unexpected error occured.

Keywords

Supported operations

Searching [GET] /api/{Context}/Keywords

Retrieving [GET] /api/{Context}/Keywords/{id}

Creating [POST] /api/{Context}/Keywords

Changing [PATCH] /api/{Context}/Keywords/{id}

Deleting [DELETE] /api/{Context}/Keywords/{id}

A Keyword is classified as a 'Data Domain Definition' which mean that it purpose is to define the type and value of an attribute rather than being a significant object in itself.

A Keyword may be created in any Scope .

The read-only Id property is the unique identifier. This identifier is assigned on creation and used in subsequent actions like Retrieve .

A Keyword supports Namespace identification.

A Keyword is unique across ( keyword, namespace_id ).

The ObjectType identifier for Keyword is 66.

The Keyword does not support Instance Permission (i.e. Permission to View/Add/Change/Delete are granted accross all records of this Type).

You can use Keyword as the root [START WITH] type in a Search . A number of properties including: Id, Scope, Namespace, Name, Objects, KeywordGroups etc. are available to the search. To find a full list of searchable properties use SearchableTypes .

Searching Keywords

$ curl https://datastorage.dev.aw-au.bentley.com//api/{Context}/Keywords/?include=Id,Name&filter=Id=1&startAt=0&pageSize=20
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function searchKeywords( host, include= 'Id,Name', filter, order, startAt = 0, pageSize = 10) {
   let requestUrl = host + '/api/0/Keywords?include=' + include +'&filter=' + filter +;&order=' + order +'&startAt=' + startAt + '&pageSize=' + pageSize;
   const init = {
      method: 'GET',
      headers: {
         Authorization: 'bearer {token}'
         }
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

[
{
  "id": 998,
  "name": "sample"
},
{
  "id": 999,
  "name": "sample"
}
]

Enables Searching on Keywords using the EQL logic.

Use the GET request method to search for Keywords that satisfy a set of search criteria.

GET /api/{Context}/Keywords

Specify a context (community) to indicate the data source. The default value "0" references the current context.

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server.

  1. Set the "Authorization" parameter to a valid session bearer token.

  2. Use the parameters in the table below to control how the result set displays the returned properties.

The result set contains the selected list of properties for Keywords satisfying the provided search criteria. The result set should include the "id" parameter to allow further operations, such as retrieving detailed information related to a Keyword of interest.


Try me in EqlExplorer
Try me in Swagger

Search Keyword Request Info

Info Description
url http(s)://{server}/api/{context}/Keywords
Request GET
Media Type application/json
Response An Array of objects with the selected properties (key-value pairs).

Search Keyword Request Parameters

Parameter Default Description
include Id,Name The properties to include in the result.
filter Id>1 The search criteria
order Id How to order the results
startAt 1 The index of the first row to return. (Rows are determined base on order)
pageSize the number of rows to return The max number of row to return
context The session context The context (aka community) whose data are being accessed

Search Keyword Responses

Status Description
200, OK When there is at least one record that satisfies the provided filter.
204, No Content When there is no record that satisfies the provided filter.
400, Bad Request When there is an error in the provided parameters (e.g. syntax error in filter).
401, Unauthorized When access is attempted with no authorization header (see #authentication).
500, Internal Server Error An unexpected error occured.

Retrieving Keywords

$ curl https://datastorage.dev.aw-au.bentley.com/{Context}/Keywords/242?include={RetrieveOptions}
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function retrieveKeywords( host, id, retrieveOptions = 'Header') {
   let requestUrl = host + '/api/0/Keywords/id/?include=' + retrieveOptions;
   const init = {
      method: 'GET',
      headers: {
         Authorization: 'bearer {token}'
         }
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

/* Sample request for Keyword */
{
  "addedBy": {
    "id": 999
  },
  "changedBy": {
    "id": 999
  },
  "dateAdded": "2020-09-10T12:09:03.5276104+01:00",
  "dateChanged": "2020-09-10T12:09:03.5277697+01:00",
  "id": 999,
  "name": "sample",
  "namespace": {
    "name": "sample",
    "id": 999
  },
  "scope": {
    "name": "sample",
    "id": 999
  }
}

Retrieves a single Keyword instance the properties of which are populated based on the request parameters.

This GET request method can retrieve more detailed information for the Keyword identified by its "id". The syntax for this form of the GET request is as follows.

GET /api/{Context}/Keywords/{id}

Use the "id" for the Keyword to retrieve, and specify a context (community) to narrow the search. The default value "0" references the current context.

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server.

  1. Set the "Authorization" parameter to a valid session bearer token.

  2. Use the "include" parameter to specify the properties returned in the result set. (Defaults to "Header").

The GET method returns the properties specified in the HTTP request header for the document copy identified by "id".


Try me in RetrieveExplorer
Try me in Swagger

Search Keyword Request Info

Info Description
url http(s)://{server}/api/{context}/Keywords
Request GET
Media Type application/json
Response The Keyword with the [name](#retrieve-keyword-properties-per-include-option. properties populated.

Retrieve Keyword Request Parameters

Parameter Default Description
Id NULL The Identifier of the object to Retrieve.
include Header Which Properties to include (see ).
context The session context The context (aka community) whose data are being accessed

Retrieve Keyword Properties per include option.

Retrieve Option Property Type
Header Id int
Header Scope Scope
Header Namespace Namespace
Header Name string
Header DateAdded DateTime?
Header AddedBy Person
Header DateChanged DateTime?
Header ChangedBy Person
Header AuditDetails List of AuditDetail
Objects Objects List of ObjectKeyword. Supported Filters
[StartAt=value]
[PageSize=value]
Header KeywordGroups List of KeywordGroupKeyword

RetrieveKeyword Responses

Status Description
200, OK The operation was completed successfully and the response body contains the result.
204, No Content The operation resulted no records (e.g. filter does not produce any result).
400, Bad Request When there is an error in the provided parameters (e.g. syntax error in filter).
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to access this instance.
500, Internal Server Error An unexpected error occured.

Creating Keywords

Try me in Swagger

Request Body (JSON)

{
  "name": "string value"
}

$ curl -X POST https://datastorage.dev.aw-au.bentley.com/{Context}/Keywords
-H "Accept: application/json"
-H "Authorization: Bearer {token}"
-d "see json request body"

// the modelPost structure is described in the Request Json 
async function postKeywords( host, modelPost) {
   let requestUrl = host + '/api/0/Keywords
   const init = {
      method: 'POST',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = modelPost.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

{
  "id": 999
}

The following methods are available for creating a new instance of Keyword.

  1. Calling the API directly providing the required data.

  2. Using a Template

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server. Set the "Authorization" parameter to a valid session bearer token.

Add Keyword Request Info

Info Description
url http(s)://{server}/api/{context}/Keywords
Request POST
Media Type application/json
Response The Id of the newly created item

Post Keyword Contract Info

The POST request for Keyword contract has the following properties

Name Type
Name string

Add Keyword Response Statuses

Status Description
201, Created A new instance was created and the result body contains the id of the instance.
400, Bad Request The Server could not create the instance. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to create new objects of this type.
409, Conflict When the provided record already exists.
500, Internal Server Error An unexpected error occured.

Changing Keywords

Try me in Swagger

Request Body (JSON)

{
  "name": "string value",
  "id": 999
}

$ curl -X PATCH https://datastorage.dev.aw-au.bentley.com/{Context}/Keywords
-H "Accept: application/json"
-H "Authorization: Bearer {token}"
-d "see json request"

// the modelPatch structure is described in the Request Json 
async function patchKeywords( host, id, modelPatch) {
   let requestUrl = host + '/api/0/Keywords/'+id
   const init = {
      method: 'PATCH',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = modelPatch.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Saves the modification on the Keyword instance to the database.

Try me in Swagger

Change Keyword Request Info

Info Description
url http(s)://{server}/api/{context}/Keywords
Request PATCH
Media Type application/json
Response status

Patch Keyword Contract Info

The Keyword properties for a PATCH requests are:

Name Type
Name string
Id int

Patch Keyword Responses

Status Description
204, No Content The change was successful.
400, Bad Request The Server could not apply the change. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to Modify this instance or any instance of this type.
409, Conflict When the change request will produce a duplicate entry.
500, Internal Server Error An unexpected error occured.

Deleting Keywords

Try me in Swagger

$ curl -X DELETE https://datastorage.dev.aw-au.bentley.com/{Context}/Keywords/123
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function DeleteKeywords( host, id) {
   let requestUrl = host + '/api/0/Keywords/+id+
   const init = {
      method: 'DELETE',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = model.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Deletes the Keyword instance from the database.

Delete Keyword Request Info

Info Description
url http(s)://{server}/api/{context}/Keywords/{id}
Request DELETE
Media Type text/json
Response status

Delete Keyword Responses

Status Description
204, No Content The deletion was successful.
400, Bad Request The Server could not delete the instance. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to Delete this instance or any instance of this type.
500, Internal Server Error An unexpected error occured.

Notes

Supported operations

Searching [GET] /api/{Context}/Notes

Retrieving [GET] /api/{Context}/Notes/{id}

Creating [POST] /api/{Context}/Notes

Changing [PATCH] /api/{Context}/Notes/{id}

Deleting [DELETE] /api/{Context}/Notes/{id}

A Note is a 'Dependent Object' which mean which mean that although it has most of the characteristics of an Object it depends on the existence of an Independent Object. If the 'parent' Object gets deleted it gets deleted too.

A Note may be created in any Scope .

The read-only Id property is the unique identifier. This identifier is assigned on creation and used in subsequent actions like Retrieve .

The ObjectType identifier for Note is 76.

The Note supports the instance permissions: View, Modify and Delete in addition to the Type permission that governs its creation.

You can use Note as the root [START WITH] type in a Search . A number of properties including: Object, Scope, Id, Name, Content, Priority etc. are available to the search. To find a full list of searchable properties use SearchableTypes .

Searching Notes

$ curl https://datastorage.dev.aw-au.bentley.com//api/{Context}/Notes/?include=Id,Name&filter=Id=1&startAt=0&pageSize=20
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function searchNotes( host, include= 'Id,Name', filter, order, startAt = 0, pageSize = 10) {
   let requestUrl = host + '/api/0/Notes?include=' + include +'&filter=' + filter +;&order=' + order +'&startAt=' + startAt + '&pageSize=' + pageSize;
   const init = {
      method: 'GET',
      headers: {
         Authorization: 'bearer {token}'
         }
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

[
{
  "id": 998,
  "name": "sample"
},
{
  "id": 999,
  "name": "sample"
}
]

Enables Searching on Notes using the EQL logic.

Use the GET request method to search for Notes that satisfy a set of search criteria.

GET /api/{Context}/Notes

Specify a context (community) to indicate the data source. The default value "0" references the current context.

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server.

  1. Set the "Authorization" parameter to a valid session bearer token.

  2. Use the parameters in the table below to control how the result set displays the returned properties.

The result set contains the selected list of properties for Notes satisfying the provided search criteria. The result set should include the "id" parameter to allow further operations, such as retrieving detailed information related to a Note of interest.


Try me in EqlExplorer
Try me in Swagger

Search Note Request Info

Info Description
url http(s)://{server}/api/{context}/Notes
Request GET
Media Type application/json
Response An Array of objects with the selected properties (key-value pairs).

Search Note Request Parameters

Parameter Default Description
include Id,Name The properties to include in the result.
filter Id>1 The search criteria
order Id How to order the results
startAt 1 The index of the first row to return. (Rows are determined base on order)
pageSize the number of rows to return The max number of row to return
context The session context The context (aka community) whose data are being accessed

Search Note Responses

Status Description
200, OK When there is at least one record that satisfies the provided filter.
204, No Content When there is no record that satisfies the provided filter.
400, Bad Request When there is an error in the provided parameters (e.g. syntax error in filter).
401, Unauthorized When access is attempted with no authorization header (see #authentication).
500, Internal Server Error An unexpected error occured.

Retrieving Notes

$ curl https://datastorage.dev.aw-au.bentley.com/{Context}/Notes/242?include={RetrieveOptions}
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function retrieveNotes( host, id, retrieveOptions = 'Header') {
   let requestUrl = host + '/api/0/Notes/id/?include=' + retrieveOptions;
   const init = {
      method: 'GET',
      headers: {
         Authorization: 'bearer {token}'
         }
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

/* Sample request for Note */
{
  "object": {
    "type": 999,
    "id": 999
  },
  "name": "sample",
  "addedBy": {
    "code": "sample",
    "surname": "sample",
    "initial": "sample",
    "firstName": "sample",
    "class": {
      "code": "sample",
      "name": "sample",
      "isSyncTracked": false,
      "id": 999
    },
    "isTemplate": true,
    "id": 999
  },
  "priority": {
    "priority": 999,
    "name": "sample",
    "id": 999
  },
  "content": "sample",
  "scope": {
    "name": "sample",
    "id": 999
  },
  "hasFlags": 9999,
  "permissionHint": 999,
  "dateAdded": "2020-09-10T12:09:03.5955067+01:00",
  "dateChanged": "2020-09-10T12:09:03.5955996+01:00",
  "changedBy": {
    "id": 999
  },
  "id": 999
}

Retrieves a single Note instance the properties of which are populated based on the request parameters.

This GET request method can retrieve more detailed information for the Note identified by its "id". The syntax for this form of the GET request is as follows.

GET /api/{Context}/Notes/{id}

Use the "id" for the Note to retrieve, and specify a context (community) to narrow the search. The default value "0" references the current context.

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server.

  1. Set the "Authorization" parameter to a valid session bearer token.

  2. Use the "include" parameter to specify the properties returned in the result set. (Defaults to "Header").

The GET method returns the properties specified in the HTTP request header for the document copy identified by "id".


Try me in RetrieveExplorer
Try me in Swagger

Search Note Request Info

Info Description
url http(s)://{server}/api/{context}/Notes
Request GET
Media Type application/json
Response The Note with the [name](#retrieve-note-properties-per-include-option. properties populated.

Retrieve Note Request Parameters

Parameter Default Description
Id NULL The Identifier of the object to Retrieve.
include Header Which Properties to include (see ).
context The session context The context (aka community) whose data are being accessed

Retrieve Note Properties per include option.

Retrieve Option Property Type
Header Object Object
Header Scope Scope
Header Id int
Header Name string
Header HasFlags long?
Header PermissionHint int?
Header Content string
Header Priority NotePriority
AuditDetails AuditDetails List of AuditDetail
Securities Securities List of Security. Supported Filters
[StartAt=value]
[PageSize=value]
[Permission&=value]
Header DateAdded DateTime?
Header AddedBy Person
Header DateChanged DateTime?
Header ChangedBy Person
Notes Notes List of Note. Supported Filters
[StartAt=value]
[PageSize=value]

RetrieveNote Responses

Status Description
200, OK The operation was completed successfully and the response body contains the result.
204, No Content The operation resulted no records (e.g. filter does not produce any result).
400, Bad Request When there is an error in the provided parameters (e.g. syntax error in filter).
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to access this instance.
500, Internal Server Error An unexpected error occured.

Creating Notes

Try me in Swagger

Request Body (JSON)

{
  "object": {
    "type": 999,
    "id": 999
  },
  "name": "string value",
  "addedBy": {
    "id": 999
  },
  "priority": {
    "priority": 999
  },
  "content": "string value"
}

$ curl -X POST https://datastorage.dev.aw-au.bentley.com/{Context}/Notes
-H "Accept: application/json"
-H "Authorization: Bearer {token}"
-d "see json request body"

// the modelPost structure is described in the Request Json 
async function postNotes( host, modelPost) {
   let requestUrl = host + '/api/0/Notes
   const init = {
      method: 'POST',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = modelPost.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

{
  "id": 999
}

The following methods are available for creating a new instance of Note.

  1. Calling the API directly providing the required data.

  2. Using a Template

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server. Set the "Authorization" parameter to a valid session bearer token.

Add Note Request Info

Info Description
url http(s)://{server}/api/{context}/Notes
Request POST
Media Type application/json
Response The Id of the newly created item

Post Note Contract Info

The POST request for Note contract has the following properties

Name Type
Object IdTypePost
Name string
AddedBy IdPost
Priority PriorityRefPost
Content string

Add Note Response Statuses

Status Description
201, Created A new instance was created and the result body contains the id of the instance.
400, Bad Request The Server could not create the instance. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to create new objects of this type.
409, Conflict When the provided record already exists.
500, Internal Server Error An unexpected error occured.

Changing Notes

Try me in Swagger

Request Body (JSON)

{
  "name": "string value",
  "addedBy": {
    "id": 999
  },
  "priority": {
    "priority": 999
  },
  "content": "string value",
  "id": 999
}

$ curl -X PATCH https://datastorage.dev.aw-au.bentley.com/{Context}/Notes
-H "Accept: application/json"
-H "Authorization: Bearer {token}"
-d "see json request"

// the modelPatch structure is described in the Request Json 
async function patchNotes( host, id, modelPatch) {
   let requestUrl = host + '/api/0/Notes/'+id
   const init = {
      method: 'PATCH',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = modelPatch.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Saves the modification on the Note instance to the database.

Try me in Swagger

Change Note Request Info

Info Description
url http(s)://{server}/api/{context}/Notes
Request PATCH
Media Type application/json
Response status

Patch Note Contract Info

The Note properties for a PATCH requests are:

Name Type
Name string
AddedBy IdPatch
Priority PriorityRefPatch
Content string
Id int

Patch Note Responses

Status Description
204, No Content The change was successful.
400, Bad Request The Server could not apply the change. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to Modify this instance or any instance of this type.
409, Conflict When the change request will produce a duplicate entry.
500, Internal Server Error An unexpected error occured.

Deleting Notes

Try me in Swagger

$ curl -X DELETE https://datastorage.dev.aw-au.bentley.com/{Context}/Notes/123
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function DeleteNotes( host, id) {
   let requestUrl = host + '/api/0/Notes/+id+
   const init = {
      method: 'DELETE',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = model.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Deletes the Note instance from the database.

Delete Note Request Info

Info Description
url http(s)://{server}/api/{context}/Notes/{id}
Request DELETE
Media Type text/json
Response status

Delete Note Responses

Status Description
204, No Content The deletion was successful.
400, Bad Request The Server could not delete the instance. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to Delete this instance or any instance of this type.
500, Internal Server Error An unexpected error occured.

Intents

Supported operations

Searching [GET] /api/{Context}/Intents

Retrieving [GET] /api/{Context}/Intents/{id}

Creating [POST] /api/{Context}/Intents

Changing [PATCH] /api/{Context}/Intents/{id}

Deleting [DELETE] /api/{Context}/Intents/{id}

Searching Intents

$ curl https://datastorage.dev.aw-au.bentley.com//api/{Context}/Intents/?include=Id,Name,Code&filter=Id=1&startAt=0&pageSize=20
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function searchIntents( host, include= 'Id,Name,Code', filter, order, startAt = 0, pageSize = 10) {
   let requestUrl = host + '/api/0/Intents?include=' + include +'&filter=' + filter +;&order=' + order +'&startAt=' + startAt + '&pageSize=' + pageSize;
   const init = {
      method: 'GET',
      headers: {
         Authorization: 'bearer {token}'
         }
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

[
{
  "code": "sample",
  "id": 998,
  "name": "sample"
},
{
  "code": "sample",
  "id": 999,
  "name": "sample"
}
]

Enables Searching on Intents using the EQL logic.

Use the GET request method to search for Intents that satisfy a set of search criteria.

GET /api/{Context}/Intents

Specify a context (community) to indicate the data source. The default value "0" references the current context.

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server.

  1. Set the "Authorization" parameter to a valid session bearer token.

  2. Use the parameters in the table below to control how the result set displays the returned properties.

The result set contains the selected list of properties for Intents satisfying the provided search criteria. The result set should include the "id" parameter to allow further operations, such as retrieving detailed information related to a Intent of interest.


Try me in EqlExplorer
Try me in Swagger

Search Intent Request Info

Info Description
url http(s)://{server}/api/{context}/Intents
Request GET
Media Type application/json
Response An Array of objects with the selected properties (key-value pairs).

Search Intent Request Parameters

Parameter Default Description
include Id,Name,Code The properties to include in the result.
filter Id>1 The search criteria
order Id How to order the results
startAt 1 The index of the first row to return. (Rows are determined base on order)
pageSize the number of rows to return The max number of row to return
context The session context The context (aka community) whose data are being accessed

Search Intent Responses

Status Description
200, OK When there is at least one record that satisfies the provided filter.
204, No Content When there is no record that satisfies the provided filter.
400, Bad Request When there is an error in the provided parameters (e.g. syntax error in filter).
401, Unauthorized When access is attempted with no authorization header (see #authentication).
500, Internal Server Error An unexpected error occured.

Retrieving Intents

$ curl https://datastorage.dev.aw-au.bentley.com/{Context}/Intents/242?include={RetrieveOptions}
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function retrieveIntents( host, id, retrieveOptions = 'Header') {
   let requestUrl = host + '/api/0/Intents/id/?include=' + retrieveOptions;
   const init = {
      method: 'GET',
      headers: {
         Authorization: 'bearer {token}'
         }
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

/* Sample request for Intent */
{
  "addedBy": {
    "id": 999
  },
  "changedBy": {
    "id": 999
  },
  "code": "sample",
  "dateAdded": "2020-09-10T12:09:03.7775915+01:00",
  "dateChanged": "2020-09-10T12:09:03.7777333+01:00",
  "description": "sample",
  "id": 999,
  "isEnabled": true,
  "name": "sample"
}

Retrieves a single Intent instance the properties of which are populated based on the request parameters.

This GET request method can retrieve more detailed information for the Intent identified by its "id". The syntax for this form of the GET request is as follows.

GET /api/{Context}/Intents/{id}

Use the "id" for the Intent to retrieve, and specify a context (community) to narrow the search. The default value "0" references the current context.

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server.

  1. Set the "Authorization" parameter to a valid session bearer token.

  2. Use the "include" parameter to specify the properties returned in the result set. (Defaults to "Header").

The GET method returns the properties specified in the HTTP request header for the document copy identified by "id".


Try me in RetrieveExplorer
Try me in Swagger

Search Intent Request Info

Info Description
url http(s)://{server}/api/{context}/Intents
Request GET
Media Type application/json
Response The Intent with the [name](#retrieve-intent-properties-per-include-option. properties populated.

Retrieve Intent Request Parameters

Parameter Default Description
Id NULL The Identifier of the object to Retrieve.
include Header Which Properties to include (see ).
context The session context The context (aka community) whose data are being accessed

Retrieve Intent Properties per include option.

Retrieve Option Property Type
Header Id int
Header Name string
Header Code string
Header Description string
Header IsEnabled bool
Header Scope Scope
Header DateAdded DateTime?
Header AddedBy Person
Header DateChanged DateTime?
Header ChangedBy Person
Header AuditDetails List of AuditDetail

RetrieveIntent Responses

Status Description
200, OK The operation was completed successfully and the response body contains the result.
204, No Content The operation resulted no records (e.g. filter does not produce any result).
400, Bad Request When there is an error in the provided parameters (e.g. syntax error in filter).
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to access this instance.
500, Internal Server Error An unexpected error occured.

Creating Intents

Try me in Swagger

Request Body (JSON)

{
  "code": "string value",
  "name": "string value",
  "description": "string value",
  "isEnabled": true
}

$ curl -X POST https://datastorage.dev.aw-au.bentley.com/{Context}/Intents
-H "Accept: application/json"
-H "Authorization: Bearer {token}"
-d "see json request body"

// the modelPost structure is described in the Request Json 
async function postIntents( host, modelPost) {
   let requestUrl = host + '/api/0/Intents
   const init = {
      method: 'POST',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = modelPost.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

{
  "id": 999
}

The following methods are available for creating a new instance of Intent.

  1. Calling the API directly providing the required data.

  2. Using a Template

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server. Set the "Authorization" parameter to a valid session bearer token.

Add Intent Request Info

Info Description
url http(s)://{server}/api/{context}/Intents
Request POST
Media Type application/json
Response The Id of the newly created item

Post Intent Contract Info

The POST request for Intent contract has the following properties

Name Type
Code string
Name string
Description string
IsEnabled bool

Add Intent Response Statuses

Status Description
201, Created A new instance was created and the result body contains the id of the instance.
400, Bad Request The Server could not create the instance. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to create new objects of this type.
409, Conflict When the provided record already exists.
500, Internal Server Error An unexpected error occured.

Changing Intents

Try me in Swagger

Request Body (JSON)

{
  "code": "string value",
  "name": "string value",
  "description": "string value",
  "isEnabled": true,
  "id": 999
}

$ curl -X PATCH https://datastorage.dev.aw-au.bentley.com/{Context}/Intents
-H "Accept: application/json"
-H "Authorization: Bearer {token}"
-d "see json request"

// the modelPatch structure is described in the Request Json 
async function patchIntents( host, id, modelPatch) {
   let requestUrl = host + '/api/0/Intents/'+id
   const init = {
      method: 'PATCH',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = modelPatch.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Try me in Swagger

Change Intent Request Info

Info Description
url http(s)://{server}/api/{context}/Intents
Request PATCH
Media Type application/json
Response status

Patch Intent Contract Info

The Intent properties for a PATCH requests are:

Name Type
Code string
Name string
Description string
IsEnabled bool
Id int

Patch Intent Responses

Status Description
204, No Content The change was successful.
400, Bad Request The Server could not apply the change. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to Modify this instance or any instance of this type.
409, Conflict When the change request will produce a duplicate entry.
500, Internal Server Error An unexpected error occured.

Deleting Intents

Try me in Swagger

$ curl -X DELETE https://datastorage.dev.aw-au.bentley.com/{Context}/Intents/123
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function DeleteIntents( host, id) {
   let requestUrl = host + '/api/0/Intents/+id+
   const init = {
      method: 'DELETE',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = model.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Delete Intent Request Info

Info Description
url http(s)://{server}/api/{context}/Intents/{id}
Request DELETE
Media Type text/json
Response status

Delete Intent Responses

Status Description
204, No Content The deletion was successful.
400, Bad Request The Server could not delete the instance. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to Delete this instance or any instance of this type.
500, Internal Server Error An unexpected error occured.

Relationships

Relationships define links between AssetWise objects representing business entities. The DataStorage Service provides several types of inherent (built-in) relationships, including:

Like the objects being linked, relationships belong to classes, have system (built-in) attributes, and can support custom attributes. Users can create custom relationships to meet their business requirements.

Searching Relationships

$ curl https://datastorage.dev.aw-au.bentley.com//api/{Context}/Relationships/?include=Id&filter=Id=1&startAt=0&pageSize=20
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function searchRelationships( host, include= 'Id', filter, order, startAt = 0, pageSize = 10) {
   let requestUrl = host + '/api/0/Relationships?include=' + include +'&filter=' + filter +;&order=' + order +'&startAt=' + startAt + '&pageSize=' + pageSize;
   const init = {
      method: 'GET',
      headers: {
         Authorization: 'bearer {token}'
         }
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

[
{
  "id": 998
},
{
  "id": 999
}
]

Enables Searching on Relationships using the EQL logic.

Use the GET request method to search for Relationships that satisfy a set of search criteria.

GET /api/{Context}/Relationships

Specify a context (community) to indicate the data source. The default value "0" references the current context.

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server.

  1. Set the "Authorization" parameter to a valid session bearer token.

  2. Use the parameters in the table below to control how the result set displays the returned properties.

The result set contains the selected list of properties for Relationships satisfying the provided search criteria. The result set should include the "id" parameter to allow further operations, such as retrieving detailed information related to a Relationship of interest.


Try me in EqlExplorer
Try me in Swagger

Search Relationship Request Info

Info Description
url http(s)://{server}/api/{context}/Relationships
Request GET
Media Type application/json
Response An Array of objects with the selected properties (key-value pairs).

Search Relationship Request Parameters

Parameter Default Description
include Id The properties to include in the result.
filter Id>1 The search criteria
order Id How to order the results
startAt 1 The index of the first row to return. (Rows are determined base on order)
pageSize the number of rows to return The max number of row to return
context The session context The context (aka community) whose data are being accessed

Search Relationship Responses

Status Description
200, OK When there is at least one record that satisfies the provided filter.
204, No Content When there is no record that satisfies the provided filter.
400, Bad Request When there is an error in the provided parameters (e.g. syntax error in filter).
401, Unauthorized When access is attempted with no authorization header (see #authentication).
500, Internal Server Error An unexpected error occured.

Retrieving Relationships

$ curl https://datastorage.dev.aw-au.bentley.com/{Context}/Relationships/242?include={RetrieveOptions}
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function retrieveRelationships( host, id, retrieveOptions = 'Header') {
   let requestUrl = host + '/api/0/Relationships/id/?include=' + retrieveOptions;
   const init = {
      method: 'GET',
      headers: {
         Authorization: 'bearer {token}'
         }
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

/* Sample request for Relationship */
{
  "scope": {
    "name": "sample",
    "id": 999
  },
  "guid": "00000000-0000-0000-0000-000000000000",
  "left": {
    "type": 999,
    "code": "sample",
    "revision": "sample",
    "scope": {
      "id": 999
    },
    "guid": "00000000-0000-0000-0000-000000000000",
    "id": 999
  },
  "right": {
    "type": 999,
    "code": "sample",
    "revision": "sample",
    "scope": {
      "id": 999
    },
    "guid": "00000000-0000-0000-0000-000000000000",
    "id": 999
  },
  "relationshipType": {
    "controlledBy": "sample",
    "guid": "00000000-0000-0000-0000-000000000000",
    "id": 999,
    "leftName": "sample",
    "presentation": "sample",
    "rightName": "sample"
  },
  "hasFlags": 9999,
  "permissionHint": 999,
  "isTemplate": true,
  "dateAdded": "2020-09-10T12:09:03.8331515+01:00",
  "addedBy": {
    "id": 999
  },
  "dateChanged": "2020-09-10T12:09:03.8332912+01:00",
  "changedBy": {
    "id": 999
  },
  "id": 999
}

Retrieves a single Relationship instance the properties of which are populated based on the request parameters.

This GET request method can retrieve more detailed information for the Relationship identified by its "id". The syntax for this form of the GET request is as follows.

GET /api/{Context}/Relationships/{id}

Use the "id" for the Relationship to retrieve, and specify a context (community) to narrow the search. The default value "0" references the current context.

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server.

  1. Set the "Authorization" parameter to a valid session bearer token.

  2. Use the "include" parameter to specify the properties returned in the result set. (Defaults to "Header").

The GET method returns the properties specified in the HTTP request header for the document copy identified by "id".


Try me in RetrieveExplorer
Try me in Swagger

Search Relationship Request Info

Info Description
url http(s)://{server}/api/{context}/Relationships
Request GET
Media Type application/json
Response The Relationship with the [name](#retrieve-relationship-properties-per-include-option. properties populated.

Retrieve Relationship Request Parameters

Parameter Default Description
Id NULL The Identifier of the object to Retrieve.
include Header Which Properties to include (see ).
context The session context The context (aka community) whose data are being accessed

Retrieve Relationship Properties per include option.

Retrieve Option Property Type
Header IsTemplate bool?
Header Id int
Header Scope Scope
Header Guid Guid?
Header Left Object
Header Right Object
Header RelationshipType RelationshipType
Header HasFlags long?
Header PermissionHint int?
AuditDetails AuditDetails List of AuditDetail
Attributes Attributes List of Attribute. Supported Filters
[StartAt=value]
[PageSize=value]
[IsLinked=value]
[CompleteMemo=value]
[AttributeDef.Id IN (comma delimited values)]
[AttributeDef.IsIntrinsic=value]
[AttributeDef.DataType IN (comma delimited values)]
[AttributeDef.DataType NOT IN (comma delimited values)]
[AttributeDef.Name=value]
Securities Securities List of Security. Supported Filters
[StartAt=value]
[PageSize=value]
[Permission&=value]
Header DateAdded DateTime?
Header AddedBy Person
Header DateChanged DateTime?
Header ChangedBy Person
ExternalObjects ExternalObjects List of RelationshipExternalObject. Supported Filters
[StartAt=value]
[PageSize=value]
CopyOptions CopyOptions List of CopyOption. Supported Filters
[HasData=value]
Header TemplateRef Template
Header InstanceOf Template

RetrieveRelationship Responses

Status Description
200, OK The operation was completed successfully and the response body contains the result.
204, No Content The operation resulted no records (e.g. filter does not produce any result).
400, Bad Request When there is an error in the provided parameters (e.g. syntax error in filter).
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to access this instance.
500, Internal Server Error An unexpected error occured.

Scopes

Supported operations

Searching [GET] /api/{Context}/Scopes

Retrieving [GET] /api/{Context}/Scopes/{id}

Creating [POST] /api/{Context}/Scopes

Changing [PATCH] /api/{Context}/Scopes/{id}

Deleting [DELETE] /api/{Context}/Scopes/{id}

A Scope is classified as a 'Data Domain Definition' which mean that it purpose is to define the type and value of an attribute rather than being a significant object in itself.

The read-only Id property is the unique identifier. This identifier is assigned on creation and used in subsequent actions like Retrieve .

A Scope supports Namespace identification.

A Scope is unique across ( parent_id, name, object_id, object_type ).

The ObjectType identifier for Scope is 227.

The Scope does not support Instance Permission (i.e. Permission to View/Add/Change/Delete are granted accross all records of this Type).

You can use Scope as the root [START WITH] type in a Search . A number of properties including: Id, Name, Namespace, Owner, Parent, IsEnabled etc. are available to the search. To find a full list of searchable properties use SearchableTypes .

Searching Scopes

$ curl https://datastorage.dev.aw-au.bentley.com//api/{Context}/Scopes/?include=Id,Name&filter=Id=1&startAt=0&pageSize=20
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function searchScopes( host, include= 'Id,Name', filter, order, startAt = 0, pageSize = 10) {
   let requestUrl = host + '/api/0/Scopes?include=' + include +'&filter=' + filter +;&order=' + order +'&startAt=' + startAt + '&pageSize=' + pageSize;
   const init = {
      method: 'GET',
      headers: {
         Authorization: 'bearer {token}'
         }
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

[
{
  "id": 998,
  "name": "sample"
},
{
  "id": 999,
  "name": "sample"
}
]

Enables Searching on Scopes using the EQL logic.

Use the GET request method to search for Scopes that satisfy a set of search criteria.

GET /api/{Context}/Scopes

Specify a context (community) to indicate the data source. The default value "0" references the current context.

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server.

  1. Set the "Authorization" parameter to a valid session bearer token.

  2. Use the parameters in the table below to control how the result set displays the returned properties.

The result set contains the selected list of properties for Scopes satisfying the provided search criteria. The result set should include the "id" parameter to allow further operations, such as retrieving detailed information related to a Scope of interest.


Try me in EqlExplorer
Try me in Swagger

Search Scope Request Info

Info Description
url http(s)://{server}/api/{context}/Scopes
Request GET
Media Type application/json
Response An Array of objects with the selected properties (key-value pairs).

Search Scope Request Parameters

Parameter Default Description
include Id,Name The properties to include in the result.
filter Id>1 The search criteria
order Id How to order the results
startAt 1 The index of the first row to return. (Rows are determined base on order)
pageSize the number of rows to return The max number of row to return
context The session context The context (aka community) whose data are being accessed

Search Scope Responses

Status Description
200, OK When there is at least one record that satisfies the provided filter.
204, No Content When there is no record that satisfies the provided filter.
400, Bad Request When there is an error in the provided parameters (e.g. syntax error in filter).
401, Unauthorized When access is attempted with no authorization header (see #authentication).
500, Internal Server Error An unexpected error occured.

Retrieving Scopes

$ curl https://datastorage.dev.aw-au.bentley.com/{Context}/Scopes/242?include={RetrieveOptions}
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function retrieveScopes( host, id, retrieveOptions = 'Header') {
   let requestUrl = host + '/api/0/Scopes/id/?include=' + retrieveOptions;
   const init = {
      method: 'GET',
      headers: {
         Authorization: 'bearer {token}'
         }
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

/* Sample request for Scope */
{
  "parent": {
    "name": "sample",
    "id": 999
  },
  "name": "sample",
  "owner": {
    "type": 999,
    "label": "sample",
    "guid": "00000000-0000-0000-0000-000000000000",
    "id": 999
  },
  "namespace": {
    "name": "sample",
    "id": 999
  },
  "isEnabled": true,
  "guid": "00000000-0000-0000-0000-000000000000",
  "description": "sample",
  "dateAdded": "2020-09-10T12:09:03.9037888+01:00",
  "addedBy": {
    "id": 999
  },
  "dateChanged": "2020-09-10T12:09:03.9038903+01:00",
  "changedBy": {
    "id": 999
  },
  "dateUsed": "2020-09-10T12:09:03.903981+01:00",
  "usedBy": {
    "id": 999
  },
  "usageCount": 999,
  "hasData": "sample",
  "id": 999
}

Retrieves a single Scope instance the properties of which are populated based on the request parameters.

This GET request method can retrieve more detailed information for the Scope identified by its "id". The syntax for this form of the GET request is as follows.

GET /api/{Context}/Scopes/{id}

Use the "id" for the Scope to retrieve, and specify a context (community) to narrow the search. The default value "0" references the current context.

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server.

  1. Set the "Authorization" parameter to a valid session bearer token.

  2. Use the "include" parameter to specify the properties returned in the result set. (Defaults to "Header").

The GET method returns the properties specified in the HTTP request header for the document copy identified by "id".


Try me in RetrieveExplorer
Try me in Swagger

Search Scope Request Info

Info Description
url http(s)://{server}/api/{context}/Scopes
Request GET
Media Type application/json
Response The Scope with the [name](#retrieve-scope-properties-per-include-option. properties populated.

Retrieve Scope Request Parameters

Parameter Default Description
Id NULL The Identifier of the object to Retrieve.
include Header Which Properties to include (see ).
context The session context The context (aka community) whose data are being accessed

Retrieve Scope Properties per include option.

Retrieve Option Property Type
Header Id int
Header Name string
Header Guid Guid?
Header Description string
Header Namespace Namespace
Header Owner Object
Header Parent Scope
Header IsEnabled bool?
Header DateAdded DateTime?
Header AddedBy Person
Header DateChanged DateTime?
Header ChangedBy Person
Header DateUsed DateTime?
Header UsedBy Person
Header UsageCount int?
Children Children List of Scope. Supported Filters
[StartAt=value]
[PageSize=value]
Header Path string
Header HasData string
Roles Roles List of Role. Supported Filters
[StartAt=value]
[PageSize=value]
Invites Invites List of ScopeInvite. Supported Filters
[StartAt=value]
[PageSize=value]
AuditDetails AuditDetails List of AuditDetail
Settings Settings List of Setting. Supported Filters
[StartAt=value]
[PageSize=value]
[SettingDef.Id=value]
[SettingDef.Code=value]
[SettingDef.Id IN (comma delimited values)]
[SettingDef.Code IN (comma delimited values)]
[SettingDef.Intent.Id=value]
[SettingDef.Intent.Code=value]
[SettingDef.Category.Id IN (comma delimited values)]
[SettingDef.Category.Name IN (comma delimited values)]
Services Services List of ScopeService. Supported Filters
[StartAt=value]
[PageSize=value]
SyncScopes SyncScopes List of SyncScope. Supported Filters
[StartAt=value]
[PageSize=value]

RetrieveScope Responses

Status Description
200, OK The operation was completed successfully and the response body contains the result.
204, No Content The operation resulted no records (e.g. filter does not produce any result).
400, Bad Request When there is an error in the provided parameters (e.g. syntax error in filter).
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to access this instance.
500, Internal Server Error An unexpected error occured.

Creating Scopes

Try me in Swagger

Request Body (JSON)

{
  "parent": {
    "id": 999
  },
  "name": "string value",
  "owner": {
    "type": 999,
    "id": 999
  },
  "namespace": {
    "id": 999
  }
}

$ curl -X POST https://datastorage.dev.aw-au.bentley.com/{Context}/Scopes
-H "Accept: application/json"
-H "Authorization: Bearer {token}"
-d "see json request body"

// the modelPost structure is described in the Request Json 
async function postScopes( host, modelPost) {
   let requestUrl = host + '/api/0/Scopes
   const init = {
      method: 'POST',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = modelPost.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

{
  "id": 999
}

The following methods are available for creating a new instance of Scope.

  1. Calling the API directly providing the required data.

  2. Using a Template

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server. Set the "Authorization" parameter to a valid session bearer token.

Add Scope Request Info

Info Description
url http(s)://{server}/api/{context}/Scopes
Request POST
Media Type application/json
Response The Id of the newly created item

Post Scope Contract Info

The POST request for Scope contract has the following properties

Name Type
Parent IdPost
Name string
Owner IdTypePost
Namespace IdPost

Add Scope Response Statuses

Status Description
201, Created A new instance was created and the result body contains the id of the instance.
400, Bad Request The Server could not create the instance. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to create new objects of this type.
409, Conflict When the provided record already exists.
500, Internal Server Error An unexpected error occured.

Changing Scopes

Try me in Swagger

Request Body (JSON)

{
  "name": "string value",
  "isEnabled": true,
  "owner": {
    "type": 999,
    "id": 999
  },
  "namespace": {
    "id": 999
  },
  "id": 999
}

$ curl -X PATCH https://datastorage.dev.aw-au.bentley.com/{Context}/Scopes
-H "Accept: application/json"
-H "Authorization: Bearer {token}"
-d "see json request"

// the modelPatch structure is described in the Request Json 
async function patchScopes( host, id, modelPatch) {
   let requestUrl = host + '/api/0/Scopes/'+id
   const init = {
      method: 'PATCH',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = modelPatch.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Saves the modification on the Scope instance to the database.

Try me in Swagger

Change Scope Request Info

Info Description
url http(s)://{server}/api/{context}/Scopes
Request PATCH
Media Type application/json
Response status

Patch Scope Contract Info

The Scope properties for a PATCH requests are:

Name Type
Name string
IsEnabled bool
Owner IdTypePatch
Namespace IdPatch
Id int

Patch Scope Responses

Status Description
204, No Content The change was successful.
400, Bad Request The Server could not apply the change. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to Modify this instance or any instance of this type.
409, Conflict When the change request will produce a duplicate entry.
500, Internal Server Error An unexpected error occured.

Deleting Scopes

Try me in Swagger

$ curl -X DELETE https://datastorage.dev.aw-au.bentley.com/{Context}/Scopes/123
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function DeleteScopes( host, id) {
   let requestUrl = host + '/api/0/Scopes/+id+
   const init = {
      method: 'DELETE',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = model.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Deletes the Scope instance from the database.

Delete Scope Request Info

Info Description
url http(s)://{server}/api/{context}/Scopes/{id}
Request DELETE
Media Type text/json
Response status

Delete Scope Responses

Status Description
204, No Content The deletion was successful.
400, Bad Request The Server could not delete the instance. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to Delete this instance or any instance of this type.
500, Internal Server Error An unexpected error occured.

Files

Supported operations

Adding to Documents and Getting Document Files Workflows

Removing from Documents [DELETE] /api/{Context}/Documents/{id}/Files

Searching [GET] /api/{Context}/Files

Retrieving [GET] /api/{Context}/Files/{id}

Downloading Files

The File object in Alim consists of

This allows all the complex relationships and dependencies that may exist between objects to be taken into account as part of the business logic before any action takes place on a file. The electronic media Content itself is stored in repositories. Each repository is served by the file-storage-service which provides the required Upload/Download functionality.

The following diagram shows a high-level overview of how the components logically fit together. More complex configurations might show multiple communities, with different file-storage servers serving different repositories. Both Data-Storage and File-Storage servers may serve multiple communities.

This diagram abstracts the physical location of the servers since the system will offer the required urls for the file upload/download. The client shall always attempt to read or write file contents to the closest repository. This is determined by the site the client is logged in and by several other factors including how communication links are configured (e.g. some links may be slower than others).
To make this process transparent to the Client the urls returned from the related request are ordered accordingly.

Files share the same principles as any other Common Object.

Adding a File to a Document

Example (see later in the document for functions)

 see detailed operations later in this section
    // Single upload file method example.
    async function uploadFile(host, context, id, inputFile) {
        allocateFile(host, context, id, inputFile)
            .then(pendingFile =>
                uploadFileToStorage(pendingFile.uploadFileUrls, inputFile)
                .then(fileResult => {
                    pendingFile.fileResult = fileResult; // apply the fileResult
                    pendingFile.uploadFileUrls = null; // drop the urls
                    secureFile(host, context, id, pendingFile);
                })
            ).catch(e => console.error(e));
    }

Adding new files to the system or making changes to file contents will require the contents to be uploaded to a storage server so it can be placed on the physical media defined by the repository where it is added. This process is achieved by executing the following steps:

  1. The client Posts the Allocate File Request from the DataStorage service.
  2. The DataStorage service responds with 202-Accepted with the PendingFile Json-content.
  3. The client Posts an Upload File Request to the FileStorage service using the provided url using the response location Header, or the UploadUrls property of the PendingFile.
  4. The FileStorage service returns the FileResult,
  5. The client adds the File-Result and/or any user FileMetadata in the Pendingfile and Posts a Secure File request.
  6. The Datastorage service response with 201-Created. When the upload is completed, the client adds the result of the Secure request to PendingFile and notifies the DataStorage. The following diagram shows the sequence.

The following sections provide detailed information for each individual command.

Allocate File Request

$ curl -X POST https://datastorage.dev.aw-au.bentley.com//api/{Context}/Documents/{id}/FileAllocations
-H "Accept: application/json"
-H "Authorization: Bearer {token}"
-d "see json request body"
    async function allocateFile(host, context, id, inputFile) {
        var allocateFilePost = {
            name: inputFile.name,
            size: inputFile.size,
            date: new Date(inputFile.lastModified),
            isAnnotation: false
        };
        let request = {
            method: 'POST',
            headers: {
                'Content-Type': 'application/json',
                Authorization: auth
            },
            body: JSON.stringify(allocateFilePost)
        };
        let url = `${host}/api/${context}/Documents/${id}/FileAllocations`;
        return await fetch(url, request)
            .then(response => {
                if (!response.ok) {
                    throw 'Failed to allocate file: ' + response.status;
                }
                return response.json();
            });
    }

Use the POST method to Allocate a file as the first step for adding a File to a Document

POST /api/{Context}/Documents/{id}/FileAllocations

Specify a context (community) to indicate the data source. The default value "0" references the current context.

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server.

Set the "Authorization" parameter to a valid session bearer token.

Info Description
url http(s)://{server}/api/{Context}/Documents/{id}/FileAllocations
Request POST
Media Type application/json
Response Information
Allocate File Contract Info

Request Body (JSON)

    {
        "name":"fileName",
        "size":4,
        "date":"2021-01-07T17:21:37.587Z",
        "isAnnotation":false
    }

The POST request for the File Allocation contract has the following properties

Name Type Description
Name string the name of the file to upload.
Size int the size in bytes of the file.
Date Date/Time The last modified date of the file.
IsAnnotation bool When true, the file will be handled as annotation file.
Allocate File Response Contract

Response Body (JSON)

// Step 2: Pending File
    {
        "id":205,
        "allocatedFile":{
            "name":"test4.txt",
            "size":4,
            "isAnnotation":false,
            "date":"2021-01-07T17:21:37.587Z"
            },
        "addFileMetadataUrl":"/api/0/Documents/1041/Files/205",
        "uploadFileUrls":["https://...."],
        "repositoryId":3,
        "repositoryGroupId":5,
    }
Name Type Description
Id int The identifier of the allocated file.
AllocatedFile AllocateFilePost the data provided on create
AddFileMetadataUrl url The url for posting metadata for the file.
UploadFileUrls url[] An array of urls to which the file can be uploaded.
RepositoryId int The identifier of the repository.
RepositortyGroupId int The identifier of the repository Group.
Allocate File Response Statuses
Status Description
202, Accepted A new instance was created and the result body contains the id of the instance.
400, Bad Request The Server could not create the instance. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to create new objects of this type.
409, Conflict When the provided record already exists.
500, Internal Server Error An unexpected error occured.

Upload File Request

Request Body (JSON)

$ curl -F "file=@path/to/local/file" URL
-H "Accept: application/json"
-H "Authorization: Bearer {token}"
    async function uploadFileToStorage(urls, file) {
        for (let i = 0; i < urls.length; i++) {
            let url = urls[i];
            let form = new FormData();
            form.append('file', file);
            let request = {
                method: 'POST',
                headers: {
                    Authorization: auth
                },
                body: form
            };
            let response = await fetch(url, request);
            if (response.ok) {
                return response.json();
            }
            console.log("failed to upload to: " + url);
        }
        throw 'Failed to upload file';
    }

The available urls for uploading a file will come from the Allocate File Request. The caller can use the url from the Location header parameter or use the values in the UploadFileUrls array.

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server.

Set the "Authorization" parameter to a valid session bearer token.

Upload File Response Contract

Response Body (JSON)

    {
    "fileId":"205",
    "fileName":"205",
    "fileLocation":"00/00/00",
    "fileFolder":"00/00/00",
    "fileSize":4,
    "fileHash":null,
    "metadata":null
    }
Name Type Description
FileId string The identifier of the file (must match that of the request).
FileName string The file storage internal file name.
FileLocation string The relative file location of the file.
FileFolder string The relative file folder of the file.
FileSize int The actual bytes uploaded.
FileHash int The hash of the file. This will be calculated as a background job.
Metadata Dictionary Additional metadata related to the File

Secure File Request

$ curl -X POST https://datastorage.dev.aw-au.bentley.com//api/{Context}/Documents/{document-id}/Files
-H "Accept: application/json"
-H "Authorization: Bearer {token}"
-d "see json request body"
    async function secureFile(host, context, id, pendingFile) {
        let request = {
            method: 'POST',
            headers: {
                'Content-Type': 'application/json',
                Authorization: auth
            },
            body: JSON.stringify(pendingFile)
        };
        let url = `${host}/api/${context}/Documents/${id}/Files`;
        return await fetch(url, request)
            .then(response => {
                if (!response.ok) {
                    throw 'Failed to secure file: ' + response.statusText;
                }
                return response;
            });
    }

Securing the file is the last step of adding a file to a Document. Use the POST method to Secure the file.

POST /api/{Context}/Documents/{id}/Files

Specify a context (community) to indicate the data source. The default value "0" references the current context.

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server.

Set the "Authorization" parameter to a valid session bearer token.

The body of the request is described in the following section.

Secure File Request Contract

Request (JSON)

    {
        "id":205,
        "fileMetadata":null,
        "allocatedFile":{
            "name":"test4.txt",
            "size":4,
            "isAnnotation":false,
            "date":"2020-01-07T17:21:37.587Z"},
            "addFileMetadataUrl":"/api/0/Documents/1041/Files/205",
            "repositoryId":3,
            "repositoryGroupId":5,
            "fileResult":{
                "fileId":"205",
                "fileName":"205",
                "fileLocation":"00/00/00",
                "fileFolder":"00/00/00",
                "fileSize":4
                }
    }

The request extends the response from the first step (allocate) after adding the File-Result (upload) in the properties. If additional -file related-metadata are needed, the caller can also populate the FileMetadata property using the FileMetadataPost contract.

See Adding a File to a Document for an example.

File Metadata Post Contract

Example (JSON)

    {
    "remarks":"remarks for the file",
    "viewSequence":0,
    "description":"description for the document",
    "PageNo":"page info"
    }

The File Metadata is used to provide additional information for a file.

Name Type Description
Remarks string Remarks for the file.
ViewSequence int Optional. Display order in the list of files for a document.
Description string A short description for the file.
PageNo string information on page (e.g. size)

Retrieving Files

$ curl -X GET "https://datastorage.dev.aw-au.bentley.com/api/0/Files/204?include=Header" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"
await(
    await fetch(
        'https://datastorage.dev.aw-au.bentley.com/api/0/Files/204?include=Header',
        {
            method: 'get',
            headers: {
                Authorization: 'bearer {token}'
            }
        })
).json()

Retrieves a single File instance the properties of which are populated based on the request parameters.

This GET request method can retrieve more detailed information for the File identified by its "id". The syntax for this form of the GET request is as follows.

GET /api/{Context}/Files/{id}

Use the "id" for the File to retrieve, and specify a context (community) to narrow the search. The default value "0" references the current context.

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server.

  1. Set the "Authorization" parameter to a valid session bearer token.

  2. Use the "include" parameter to specify the properties returned in the result set. (Defaults to "Header").

The GET method returns the properties specified in the HTTP request header for the File identified by "id".


Try me in RetrieveExplorer

Response Body (JSON)

{
    /*this sample contains only a subset of the actual response properties */
    "document": {
    /* document properties */
    },
    "id": 204,
    "fileFormat": {
        "id": 9,
        "name": "TEXT/PLAIN",
        "mimeType": "TEXT/PLAIN"
    },
    "scope": {
        "id": 1,
        "name": "Global"
    },
    "name": "test3.txt",
    "path": "00/00/00",
    "fileSize": 4,
    "fileDate": "2021-01-07T17:21:37.587",
    "isPending": false,
    "isCheckedOut": false,
    "isHistoric": false,
    "currentCheckout": {
        "id": 0
    },
    "urls": [
        "https://filestorage-vm.dev.aw-au.bentley.com/api/Repositories/4ee66d4f-1a2c-46f5-81b3-3b4e8365ac92/Files/204?ticket=eyJhbGciOiJTSEEyNTYiLCJtb2QiOiJQa2NzMSJ9.eyJ1aWQiOiI5OTA1Nzg2MS0yMDExLTQ2MzgtYmZiNy0yMDY0YzEzNmNhOGIiLCJpc3MiOiJEYXRhU3RvcmFnZSIsInNkdCI6MTYxNzc5MTQ4MTkwMSwiZWR0IjoxNjE3ODc3ODgxOTAxLCJhcmciOiJ7XHUwMDIyZmlsZW5hbWVcdTAwMjI6XHUwMDIydGVzdDMudHh0XHUwMDIyLFx1MDAyMnJpZFx1MDAyMjpcdTAwMjI0ZWU2NmQ0Zi0xYTJjLTQ2ZjUtODFiMy0zYjRlODM2NWFjOTJcdTAwMjIsXHUwMDIyZmlkXHUwMDIyOlx1MDAyMjIwNFx1MDAyMn0ifQ.GUB26YbVvrfTzMS5XUhM6f8aH1ws5R73z5D5_jSNLtLEVdrcAcHwZfResH3s7V9dOGmasIX2w7bVnesBGtt893ZViGcyAb0uE1Z270g6uKhWxZfd3rhHVi5YwEnKxdE4mtZV5LiUDygKqrwNfcBE45y2KfXYAAvg5D3byUJ_kcIT2oTbrxyna0erQ_-eTECMIFrlHlU8L014Xro9gzBeOPMiwh4g5ruPrcOb_rJKcUmRsWKzgEpKkpLdIieUVm9i86o3qIX-VCk4pHtH0hsLntkIY2rCjVZb0N8lr89L45YBRk7ofLcneyyoNlLGaaMqKVIYqsjmUpLGZnG348nIOA"
    ],
    "repositories": [
        {
            "repository": {
                "id": 3
            }
        }
    ]
}

Downloading Files

$ curl -X GET "https://datastorage.dev.aw-au.bentley.com/api/0/Files/204?include=Header" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"
    function downloadFile(file) {
        if (file.urls.length == 0) {
            throw 'No files found! Please contact your Administrator';
        }
        // use the browser dialog to download the file
        const a = document.createElement("a");
        a.style.display = "none";
        document.body.appendChild(a);
        a.href = file.urls[0];
        a.click();
        // Cleanup
        window.URL.revokeObjectURL(a.href);
        document.body.removeChild(a);
    }

    fetch(
        'https://datastorage.dev.aw-au.bentley.com/api/0/Files/204?include=Header',
            {
                method: 'get',
                headers: {
                    Authorization: auth
                }
            })
        .then(r => r.json())
        .then(file => downloadFile(file))
        .catch(e=>console.log(e));

Downloading files must be executed in two steps.

  1. Get the available urls, e.g. issue a Retrieve request including the Header. e.g. GET /api/{Context}/Files/{id}
  2. Download the file using one of the urls from the result. e.g. GET URL

Retrieve File Request Parameters

Parameter Default Description
Id NULL Mandatory. The Identifier of the object to Retrieve.
include Header Which Properties to include (see available request options).
context The session context The context (aka community) whose data are being accessed

Searching Files

$ curl -X GET \
    "https://datastorage.dev.aw-au.bentley.com/api/0/Files?\
    include=Name%2cDocument.Id&filter=Id+%3d+204&startAt=0&pageSize=10" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"
await(
    await fetch(
        'https://datastorage.dev.aw-au.bentley.com/api/0/Files?include=Name%2cDocument.Id&filter=Id+%3d+204&startAt=0&pageSize=10',
        {
            method: 'get',
            headers: {
                Authorization: 'Bearer {token}'
            }
        })
).json()

Enables Searching on Files using the EQL logic.

Use the GET request method to search for Files that satisfy a set of search criteria.

GET /api/{Context}/Files

Specify a context (community) to indicate the data source. The default value "0" references the current context.

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server.

Set the "Authorization" parameter to a valid session bearer token.

Use the parameters in the table below to control how the result set displays the returned properties.

The result set contains the selected list of properties for Files satisfying the provided search criteria. The result set should include the "id" parameter to allow further operations, such as retrieving detailed information related to a File of interest.

Response Body (JSON)

[
    {
        "Name": "test3.txt",
        "DocumentId": 1041
    }
]


Try me in EqlExplorer

Getting Document Files

$ curl -X GET \
    "https://datastorage.dev.aw-au.bentley.com/api/0/Documents/1041?\
    include=Files.Header" \
    -H "Accept: application/json" \
    -H "Authorization: Bearer {token}"
await(
    await fetch(
        'https://datastorage.dev.aw-au.bentley.com/api/0/Documents/1041?include=Files.Header',
        {
            method: 'get',
            headers: {
                Authorization: 'bearer {token}'
            }
        })
).json()

To get the urls for downloading a file, include Files.Header when retrieving a document. Then follow then instructions for Downloading Files for each file in the document.

Business Entities

Business entities store information and present it in context to convey its proper meaning. The DataStorage Service provides templates from which users can create instances of the business entities listed in the following sections and link them to related projects and processes.

The DataStorage Service allows users to manage business entities through their complete life cycles, from creation through active use, preservation, and eventual obsolescence.

Documents

Supported operations

Searching [GET] /api/{Context}/Documents

Retrieving [GET] /api/{Context}/Documents/{id}

Creating [POST] /api/{Context}/Documents

Changing [PATCH] /api/{Context}/Documents/{id}

Deleting [DELETE] /api/{Context}/Documents/{id}

Create From Template [POST] /api/{Context}/Templates/{id}/Instances

A Document is an 'Independent Object' and a key entity in the system.

A Document must be classified using Class and support Templates.

A Document may be created in any Scope .

The read-only Id property is the unique identifier. This identifier is assigned on creation and used in subsequent actions like Retrieve .

A Document supports Namespace identification.

A Document is unique across ( prefix, middle, revision, namespace_id ).

The ObjectType identifier for Document is 3.

The Document supports the instance permissions: View, Modify, Approve and Delete in addition to the Type permission that governs its creation.

A Document supports locking using Lock and Unlock .

You can use Document as the root [START WITH] type in a Search . A number of properties including: Id, Scope, Namespace, Code, Middle, Revision etc. are available to the search. To find a full list of searchable properties use SearchableTypes .

Documents are fundamental AssetWise entities that preserve and contextualize data to convey meaning. Documents can store data, which can be in textual, graphical and media formats, in linked document copies and files.

Searching Documents

$ curl https://datastorage.dev.aw-au.bentley.com//api/{Context}/Documents/?include=Id,Name,Code,Class.Id&filter=Id=1&startAt=0&pageSize=20
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function searchDocuments( host, include= 'Id,Name,Code,Class.Id', filter, order, startAt = 0, pageSize = 10) {
   let requestUrl = host + '/api/0/Documents?include=' + include +'&filter=' + filter +;&order=' + order +'&startAt=' + startAt + '&pageSize=' + pageSize;
   const init = {
      method: 'GET',
      headers: {
         Authorization: 'bearer {token}'
         }
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

[
{
  "classId": 998,
  "code": "sample",
  "id": 998,
  "name": "sample"
},
{
  "classId": 999,
  "code": "sample",
  "id": 999,
  "name": "sample"
}
]

Enables Searching on Documents using the EQL logic.

Use the GET request method to search for Documents that satisfy a set of search criteria.

GET /api/{Context}/Documents

Specify a context (community) to indicate the data source. The default value "0" references the current context.

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server.

  1. Set the "Authorization" parameter to a valid session bearer token.

  2. Use the parameters in the table below to control how the result set displays the returned properties.

The result set contains the selected list of properties for Documents satisfying the provided search criteria. The result set should include the "id" parameter to allow further operations, such as retrieving detailed information related to a Document of interest.


Try me in EqlExplorer
Try me in Swagger

Search Document Request Info

Info Description
url http(s)://{server}/api/{context}/Documents
Request GET
Media Type application/json
Response An Array of objects with the selected properties (key-value pairs).

Search Document Request Parameters

Parameter Default Description
include Id,Name,Code,Class The properties to include in the result.
filter Id>1 The search criteria
order Id How to order the results
startAt 1 The index of the first row to return. (Rows are determined base on order)
pageSize the number of rows to return The max number of row to return
context The session context The context (aka community) whose data are being accessed

Search Document Responses

Status Description
200, OK When there is at least one record that satisfies the provided filter.
204, No Content When there is no record that satisfies the provided filter.
400, Bad Request When there is an error in the provided parameters (e.g. syntax error in filter).
401, Unauthorized When access is attempted with no authorization header (see #authentication).
500, Internal Server Error An unexpected error occured.

Retrieving Documents

$ curl https://datastorage.dev.aw-au.bentley.com/{Context}/Documents/242?include={RetrieveOptions}
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function retrieveDocuments( host, id, retrieveOptions = 'Header') {
   let requestUrl = host + '/api/0/Documents/id/?include=' + retrieveOptions;
   const init = {
      method: 'GET',
      headers: {
         Authorization: 'bearer {token}'
         }
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

/* Sample request for Document */
{
  "addedBy": {
    "code": "sample",
    "surname": "sample",
    "firstName": "sample",
    "class": {
      "code": "sample",
      "name": "sample",
      "isSyncTracked": false,
      "id": 999
    },
    "scope": {
      "id": 999
    },
    "id": 999
  },
  "approvalStatus": "sample",
  "assembly": {
    "physicalItem": {
      "code": "sample",
      "version": "sample",
      "name": "sample",
      "isTemplate": true,
      "id": 999
    },
    "productStructureType": {
      "name": "sample",
      "id": 999
    },
    "id": 999
  },
  "changeControlled": true,
  "changedBy": {
    "code": "sample",
    "surname": "sample",
    "firstName": "sample",
    "class": {
      "code": "sample",
      "name": "sample",
      "isSyncTracked": false,
      "id": 999
    },
    "scope": {
      "id": 999
    },
    "id": 999
  },
  "class": {
    "code": "sample",
    "name": "sample",
    "sysType": "sample",
    "isSyncTracked": false,
    "path": "sample",
    "id": 999
  },
  "code": "sample",
  "currentCheckout": {
    "person": {
      "code": "sample",
      "surname": "sample",
      "initial": "sample",
      "title": "sample",
      "scope": {
        "id": 999
      },
      "id": 999
    },
    "checkoutDate": "2020-09-10T12:08:59.8647226+01:00",
    "id": 0
  },
  "dateAdded": "2020-09-10T12:08:59.8653826+01:00",
  "dateChanged": "2020-09-10T12:08:59.8655292+01:00",
  "dateEffective": "2020-09-10T12:08:59.8656626+01:00",
  "dateObsolete": "2020-09-10T12:08:59.8658175+01:00",
  "guid": "00000000-0000-0000-0000-000000000000",
  "hasFlags": 9999,
  "hasPendingChange": true,
  "id": 999,
  "isCheckedOut": true,
  "isLatestApprovedRevision": true,
  "isLatestRevision": true,
  "isLocked": true,
  "isPrototype": true,
  "isSnapshot": true,
  "isSuperseded": true,
  "isTemplate": true,
  "isUnderChange": true,
  "lock": {
    "lockType": 999,
    "person": {
      "code": "sample",
      "surname": "sample",
      "initial": "sample",
      "title": "sample",
      "scope": {
        "id": 999
      },
      "id": 999
    },
    "transactionName": "sample"
  },
  "middle": "sample",
  "name": "sample",
  "namespace": {
    "name": "sample",
    "id": 999
  },
  "permissionHint": 999,
  "prototypeRef": {
    "status": "sample",
    "baseObject": {
      "id": 999
    },
    "changeRequest": {
      "id": 999
    },
    "control": {
      "type": 999,
      "id": 999
    },
    "id": 999
  },
  "remark": "sample",
  "revision": "sample",
  "revisionSeqNo": 999,
  "revisionSetId": 999,
  "scope": {
    "name": "sample",
    "id": 999
  },
  "snapshotOf": {
    "type": 999,
    "code": "sample",
    "label": "sample",
    "id": 999
  },
  "state": "sample",
  "synopsis": "sample",
  "warningFlags": 999
}

Retrieves a single Document instance the properties of which are populated based on the request parameters.

This GET request method can retrieve more detailed information for the Document identified by its "id". The syntax for this form of the GET request is as follows.

GET /api/{Context}/Documents/{id}

Use the "id" for the Document to retrieve, and specify a context (community) to narrow the search. The default value "0" references the current context.

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server.

  1. Set the "Authorization" parameter to a valid session bearer token.

  2. Use the "include" parameter to specify the properties returned in the result set. (Defaults to "Header").

The GET method returns the properties specified in the HTTP request header for the document copy identified by "id".


Try me in RetrieveExplorer
Try me in Swagger

Search Document Request Info

Info Description
url http(s)://{server}/api/{context}/Documents
Request GET
Media Type application/json
Response The Document with the [name](#retrieve-document-properties-per-include-option. properties populated.

Retrieve Document Request Parameters

Parameter Default Description
Id NULL The Identifier of the object to Retrieve.
include Header Which Properties to include (see ).
context The session context The context (aka community) whose data are being accessed

Retrieve Document Properties per include option.

Retrieve Option Property Type
Header Id int
Header Scope Scope
Header Namespace Namespace
Header Guid Guid?
Header Code string
Header Middle string
Header Revision string
Header RevisionSetId int?
Header RevisionSeqNo int?
Header Name string
Header Class Class
Header ApprovalStatus string
Header State string
Header DateEffective DateTime?
Header DateObsolete DateTime?
Header Remark string
Header Synopsis string
Header ChangeControlled bool?
Header HasFlags long?
Header PermissionHint int?
Header WarningFlags int?
Header IsUnderChange bool?
Header IsCheckedOut bool?
Header IsLatestRevision bool?
Header IsLatestApprovedRevision bool?
Header IsSuperseded bool?
Header HasPendingChange bool?
Header IsTemplate bool?
Header IsPrototype bool?
Header IsSnapshot bool?
Header IsLocked bool?
Header Lock ObjectLock
Header CurrentCheckout DocumentCheckoutHistory
Header DateAdded DateTime?
Header AddedBy Person
Header DateChanged DateTime?
Header ChangedBy Person
Header FileContainerOf ObjectFileContainer
Attributes Attributes List of Attribute. Supported Filters
[StartAt=value]
[PageSize=value]
[IsLinked=value]
[CompleteMemo=value]
[AttributeDef.Id IN (comma delimited values)]
[AttributeDef.IsIntrinsic=value]
[AttributeDef.DataType IN (comma delimited values)]
[AttributeDef.DataType NOT IN (comma delimited values)]
[AttributeDef.Name=value]
Prototypes Prototypes List of Prototype. Supported Filters
[StartAt=value]
[PageSize=value]
Copies Copies List of DocumentCopy. Supported Filters
[StartAt=value]
[PageSize=value]
[CopyType IN (comma delimited values)]
Files Files List of File. Supported Filters
[StartAt=value]
[PageSize=value]
[IsHistoric=value]
PendingFiles PendingFiles List of File. Supported Filters
[StartAt=value]
[PageSize=value]
Keywords Keywords List of ObjectKeyword. Supported Filters
[StartAt=value]
[PageSize=value]
Notes Notes List of Note. Supported Filters
[StartAt=value]
[PageSize=value]
Securities Securities List of Security. Supported Filters
[StartAt=value]
[PageSize=value]
[Permission&=value]
Responsibilities Responsibilities List of Responsibility. Supported Filters
[StartAt=value]
[PageSize=value]
[ResponsibilityType.Id IN (comma delimited values)]
SuggestedDistributions SuggestedDistributions List of SuggestedDistribution. Supported Filters
[StartAt=value]
[PageSize=value]
CrossReferences CrossReferences List of CrossReference. Supported Filters
[StartAt=value]
[PageSize=value]
[CrossReferenceType.Id IN (comma delimited values)]
Fileplans Fileplans List of DocumentFileplan. Supported Filters
[StartAt=value]
[PageSize=value]
ProjectWiseItemRefs ProjectWiseItemRefs List of ProjectWiseItem. Supported Filters
[StartAt=value]
[PageSize=value]
AuditDetails AuditDetails List of AuditDetail
Snapshots Snapshots List of ObjectSnapshot. Supported Filters
[StartAt=value]
[PageSize=value]
LinearLocations LinearLocations List of LinearLocation
LinearGeometry LinearGeometry Geometry
Budgets Budgets List of BudgetDocument. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Contracts Contracts List of ContractDocument. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
DeviationWaivers DeviationWaivers List of DeviationWaiverDocument. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Modifications Modifications List of DocumentModification. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
ChangeRequests ChangeRequests List of ChangeRequestDocument. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Documents Documents List of DocumentDocument. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Events Events List of DocumentEvent. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
GroupedVirtualItems GroupedVirtualItems List of DocumentGroupedVirtualItem. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Locations Locations List of DocumentLocation. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Organizations Organizations List of DocumentOrganization. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Persons Persons List of DocumentPerson. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
PhysicalItems PhysicalItems List of DocumentPhysicalItem. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Projects Projects List of DocumentProject. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Restrictions Restrictions List of DocumentRestriction. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
SerializedItems SerializedItems List of DocumentSerializedItem. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
SharePointItems SharePointItems List of DocumentSharePointItem. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Tags Tags List of DocumentTag. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
VirtualItemGroups VirtualItemGroups List of DocumentVirtualItemGroup. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
ProjectWiseItems ProjectWiseItems List of DocumentProjectWiseItem. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
ExternalObjects ExternalObjects List of DocumentExternalObject. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Conditions Conditions List of ConditionDocument. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Programs Programs List of DocumentProgram. Supported Filters
[StartAt=value]
[PageSize=value]
[RelationshipType.Id IN (comma delimited values)]
CopyOptions CopyOptions List of CopyOption. Supported Filters
[HasData=value]
RevisionHistory RevisionHistory List of Document
ChangeHistory ChangeHistory List of DocumentChangeHistory. Supported Filters
[StartAt=value]
[PageSize=value]
CheckoutHistory CheckoutHistory List of DocumentCheckoutHistory. Supported Filters
[StartAt=value]
[PageSize=value]
Holders Holders List of DistributionItem. Supported Filters
[StartAt=value]
[PageSize=value]
Superseding Superseding List of SupersedingDocument. Supported Filters
[StartAt=value]
[PageSize=value]
WorkOrders WorkOrders List of WorkOrderDocument. Supported Filters
[StartAt=value]
[PageSize=value]
WorkTasks WorkTasks List of WorkTaskDocument. Supported Filters
[StartAt=value]
[PageSize=value]
TaskOrders TaskOrders List of DocumentTaskOrder. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
AffectedChangeRequests AffectedChangeRequests List of AffectedDocument. Supported Filters
[StartAt=value]
[PageSize=value]
Folders Folders List of FolderDocument. Supported Filters
[StartAt=value]
[PageSize=value]
Header ModelOf Template
PrototypeRef PrototypeRef Prototype
Header SnapshotOf Object
Header Assembly Assembly
ContextualReports ContextualReports List of ReportContext. Supported Filters
[StartAt=value]
[PageSize=value]
InheritanceHierarchy InheritanceHierarchy List of OrdinalObject
Tasks Tasks List of TaskDocument. Supported Filters
[StartAt=value]
[PageSize=value]
Subscriptions Subscriptions List of Subscription. Supported Filters
[StartAt=value]
[PageSize=value]
SurveyInstanceRefs SurveyInstanceRefs List of SurveyInstance. Supported Filters
[StartAt=value]
[PageSize=value]

RetrieveDocument Responses

Status Description
200, OK The operation was completed successfully and the response body contains the result.
204, No Content The operation resulted no records (e.g. filter does not produce any result).
400, Bad Request When there is an error in the provided parameters (e.g. syntax error in filter).
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to access this instance.
500, Internal Server Error An unexpected error occured.

Creating Documents

Try me in Swagger

Request Body (JSON)

{
  "code": "string value",
  "middle": "string value",
  "revision": "string value",
  "class": {
    "id": 999
  },
  "name": "string value",
  "changeControlled": true,
  "approvalStatus": "string value",
  "remark": "string value",
  "synopsis": "string value",
  "dateEffective": "2020-05-07T16:25:12Z",
  "dateObsolete": "2020-05-07T16:25:12Z"
}

$ curl -X POST https://datastorage.dev.aw-au.bentley.com/{Context}/Documents
-H "Accept: application/json"
-H "Authorization: Bearer {token}"
-d "see json request body"

// the modelPost structure is described in the Request Json 
async function postDocuments( host, modelPost) {
   let requestUrl = host + '/api/0/Documents
   const init = {
      method: 'POST',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = modelPost.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

{
  "id": 999
}

The following methods are available for creating a new instance of Document.

  1. Calling the API directly providing the required data.

  2. Using a Template

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server. Set the "Authorization" parameter to a valid session bearer token.

Add Document Request Info

Info Description
url http(s)://{server}/api/{context}/Documents
Request POST
Media Type application/json
Response The Id of the newly created item

Post Document Contract Info

The POST request for Document contract has the following properties

Name Type
Code string
Middle string
Revision string
Class IdPost
Name string
ChangeControlled bool
ApprovalStatus string
Remark string
Synopsis string
DateEffective DateTime?
DateObsolete DateTime?

Add Document Response Statuses

Status Description
201, Created A new instance was created and the result body contains the id of the instance.
400, Bad Request The Server could not create the instance. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to create new objects of this type.
409, Conflict When the provided record already exists.
500, Internal Server Error An unexpected error occured.

Changing Documents

Try me in Swagger

Request Body (JSON)

{
  "code": "string value",
  "middle": "string value",
  "revision": "string value",
  "class": {
    "id": 999
  },
  "name": "string value",
  "changeControlled": true,
  "approvalStatus": "string value",
  "remark": "string value",
  "synopsis": "string value",
  "dateEffective": "2020-05-07T16:25:12Z",
  "dateObsolete": "2020-05-07T16:25:12Z",
  "id": 999
}

$ curl -X PATCH https://datastorage.dev.aw-au.bentley.com/{Context}/Documents
-H "Accept: application/json"
-H "Authorization: Bearer {token}"
-d "see json request"

// the modelPatch structure is described in the Request Json 
async function patchDocuments( host, id, modelPatch) {
   let requestUrl = host + '/api/0/Documents/'+id
   const init = {
      method: 'PATCH',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = modelPatch.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Saves the modification on the Document instance to the database.

Try me in Swagger

Change Document Request Info

Info Description
url http(s)://{server}/api/{context}/Documents
Request PATCH
Media Type application/json
Response status

Patch Document Contract Info

The Document properties for a PATCH requests are:

Name Type
Code string
Middle string
Revision string
Class IdPatch
Name string
ChangeControlled bool
ApprovalStatus string
Remark string
Synopsis string
DateEffective DateTime?
DateObsolete DateTime?
Id int

Patch Document Responses

Status Description
204, No Content The change was successful.
400, Bad Request The Server could not apply the change. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to Modify this instance or any instance of this type.
409, Conflict When the change request will produce a duplicate entry.
500, Internal Server Error An unexpected error occured.

Deleting Documents

Try me in Swagger

$ curl -X DELETE https://datastorage.dev.aw-au.bentley.com/{Context}/Documents/123
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function DeleteDocuments( host, id) {
   let requestUrl = host + '/api/0/Documents/+id+
   const init = {
      method: 'DELETE',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = model.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Deletes the Document instance from the database.

Delete Document Request Info

Info Description
url http(s)://{server}/api/{context}/Documents/{id}
Request DELETE
Media Type text/json
Response status

Delete Document Responses

Status Description
204, No Content The deletion was successful.
400, Bad Request The Server could not delete the instance. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to Delete this instance or any instance of this type.
500, Internal Server Error An unexpected error occured.

Copying Documents

Try me in Swagger

Request Body (JSON)

{
  "prefix": "string value",
  "middle": "string value",
  "revnName": "string value",
  "toId": 999,
  "batchSize": 999,
  "options": "string value"
}

// the modelCopyPost structure is described in the Request Json 
async function copyDocuments( host, id, modelCopyPost) {
   let requestUrl = host + '/api/0/Documents/'+id+'/InstanceCopies'
   const init = {
      method: 'POST',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = modelCopyPost.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

{
  "id": 999
}

Creates a Copy of the Selected Document Resource

Copy Document Request Info

Info Description
url http(s)://{server}/api/{context}/Documents/{id}/InstanceCopies
Request POST
Media Type application/json
Response The Id of the newly created item

Copy Document Responses

Status Description
201, Created A Copy of the object was created. The response body contains the id of the new instance.
400, Bad Request The Server could not create a copy. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to Create or Copy this instance or any instance of this type.
409, Conflict When the copy request will produce a duplicate entry. The response body contains the error info.
500, Internal Server Error An unexpected error occured.

ChangeRequests

Supported operations

Searching [GET] /api/{Context}/ChangeRequests

Retrieving [GET] /api/{Context}/ChangeRequests/{id}

Creating [POST] /api/{Context}/ChangeRequests

Changing [PATCH] /api/{Context}/ChangeRequests/{id}

Deleting [DELETE] /api/{Context}/ChangeRequests/{id}

Create From Template [POST] /api/{Context}/Templates/{id}/Instances

A ChangeRequest is an 'Independent Object' and a key entity in the system.

A ChangeRequest can be classified using Class and support Templates.

A ChangeRequest may be created in any Scope .

The read-only Id property is the unique identifier. This identifier is assigned on creation and used in subsequent actions like Retrieve .

A ChangeRequest is unique across ( req_by_org, change_number ).

The ObjectType identifier for ChangeRequest is 6.

The ChangeRequest supports the instance permissions: View, Modify, Approve and Delete in addition to the Type permission that governs its creation.

A ChangeRequest supports locking using Lock and Unlock .

You can use ChangeRequest as the root [START WITH] type in a Search . A number of properties including: Id, Scope, Code, Description, Class, RequestedBy etc. are available to the search. To find a full list of searchable properties use SearchableTypes .

Searching ChangeRequests

$ curl https://datastorage.dev.aw-au.bentley.com//api/{Context}/ChangeRequests/?include=Id,Code,Class.Id&filter=Id=1&startAt=0&pageSize=20
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function searchChangeRequests( host, include= 'Id,Code,Class.Id', filter, order, startAt = 0, pageSize = 10) {
   let requestUrl = host + '/api/0/ChangeRequests?include=' + include +'&filter=' + filter +;&order=' + order +'&startAt=' + startAt + '&pageSize=' + pageSize;
   const init = {
      method: 'GET',
      headers: {
         Authorization: 'bearer {token}'
         }
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

[
{
  "classId": 998,
  "code": "sample",
  "id": 998
},
{
  "classId": 999,
  "code": "sample",
  "id": 999
}
]

Enables Searching on ChangeRequests using the EQL logic.

Use the GET request method to search for ChangeRequests that satisfy a set of search criteria.

GET /api/{Context}/ChangeRequests

Specify a context (community) to indicate the data source. The default value "0" references the current context.

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server.

  1. Set the "Authorization" parameter to a valid session bearer token.

  2. Use the parameters in the table below to control how the result set displays the returned properties.

The result set contains the selected list of properties for ChangeRequests satisfying the provided search criteria. The result set should include the "id" parameter to allow further operations, such as retrieving detailed information related to a ChangeRequest of interest.


Try me in EqlExplorer
Try me in Swagger

Search ChangeRequest Request Info

Info Description
url http(s)://{server}/api/{context}/ChangeRequests
Request GET
Media Type application/json
Response An Array of objects with the selected properties (key-value pairs).

Search ChangeRequest Request Parameters

Parameter Default Description
include Id,Code,Class The properties to include in the result.
filter Id>1 The search criteria
order Id How to order the results
startAt 1 The index of the first row to return. (Rows are determined base on order)
pageSize the number of rows to return The max number of row to return
context The session context The context (aka community) whose data are being accessed

Search ChangeRequest Responses

Status Description
200, OK When there is at least one record that satisfies the provided filter.
204, No Content When there is no record that satisfies the provided filter.
400, Bad Request When there is an error in the provided parameters (e.g. syntax error in filter).
401, Unauthorized When access is attempted with no authorization header (see #authentication).
500, Internal Server Error An unexpected error occured.

Retrieving ChangeRequests

$ curl https://datastorage.dev.aw-au.bentley.com/{Context}/ChangeRequests/242?include={RetrieveOptions}
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function retrieveChangeRequests( host, id, retrieveOptions = 'Header') {
   let requestUrl = host + '/api/0/ChangeRequests/id/?include=' + retrieveOptions;
   const init = {
      method: 'GET',
      headers: {
         Authorization: 'bearer {token}'
         }
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

/* Sample request for ChangeRequest */
{
  "code": "sample",
  "organization": {
    "code": "sample",
    "name": "sample",
    "isTemplate": true,
    "id": 999
  },
  "requestedBy": {
    "code": "sample",
    "surname": "sample",
    "initial": "sample",
    "firstName": "sample",
    "class": {
      "code": "sample",
      "name": "sample",
      "isSyncTracked": false,
      "id": 999
    },
    "id": 999
  },
  "priority": {
    "priority": 999,
    "name": "sample",
    "id": 999
  },
  "category": "sample",
  "description": "sample",
  "reason": "sample",
  "dateRegistered": "2020-09-10T12:09:00.6146382+01:00",
  "class": {
    "code": "sample",
    "name": "sample",
    "isSyncTracked": false,
    "guid": "00000000-0000-0000-0000-000000000000",
    "path": "sample",
    "id": 999
  },
  "status": "sample",
  "dateApprOrReject": "2020-09-10T12:09:00.6143877+01:00",
  "apprOrRejectBy": {
    "code": "sample",
    "surname": "sample",
    "initial": "sample",
    "firstName": "sample",
    "class": {
      "code": "sample",
      "name": "sample",
      "isSyncTracked": false,
      "id": 999
    },
    "id": 999
  },
  "apprOrRejectReason": "sample",
  "scope": {
    "name": "sample",
    "id": 999
  },
  "guid": "00000000-0000-0000-0000-000000000000",
  "warningFlags": 999,
  "isTemplate": true,
  "hasFlags": 9999,
  "permissionHint": 999,
  "isLocked": true,
  "lock": {
    "lockType": 999,
    "person": {
      "code": "sample",
      "surname": "sample",
      "initial": "sample",
      "title": "sample",
      "scope": {
        "id": 999
      },
      "id": 999
    },
    "transactionName": "sample"
  },
  "fileContainer": {
    "document": {
      "id": 999
    }
  },
  "dateAdded": "2020-09-10T12:09:00.6142717+01:00",
  "addedBy": {
    "id": 999
  },
  "dateChanged": "2020-09-10T12:09:00.614542+01:00",
  "changedBy": {
    "id": 999
  },
  "id": 999
}

Retrieves a single ChangeRequest instance the properties of which are populated based on the request parameters.

This GET request method can retrieve more detailed information for the ChangeRequest identified by its "id". The syntax for this form of the GET request is as follows.

GET /api/{Context}/ChangeRequests/{id}

Use the "id" for the ChangeRequest to retrieve, and specify a context (community) to narrow the search. The default value "0" references the current context.

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server.

  1. Set the "Authorization" parameter to a valid session bearer token.

  2. Use the "include" parameter to specify the properties returned in the result set. (Defaults to "Header").

The GET method returns the properties specified in the HTTP request header for the document copy identified by "id".


Try me in RetrieveExplorer
Try me in Swagger

Search ChangeRequest Request Info

Info Description
url http(s)://{server}/api/{context}/ChangeRequests
Request GET
Media Type application/json
Response The ChangeRequest with the [name](#retrieve-changerequest-properties-per-include-option. properties populated.

Retrieve ChangeRequest Request Parameters

Parameter Default Description
Id NULL The Identifier of the object to Retrieve.
include Header Which Properties to include (see ).
context The session context The context (aka community) whose data are being accessed

Retrieve ChangeRequest Properties per include option.

Retrieve Option Property Type
Header Id int
Header Scope Scope
Header Guid Guid?
Header Code string
Header Description string
Header Class Class
Header RequestedBy Person
Header Reason string
Header Status string
Header DateRegistered DateTime?
Header DateRequested DateTime?
Header Organization Organization
Header Priority ChangeRequestPriority
Header Category string
Header DateApprOrReject DateTime?
Header ApprOrRejectBy Person
Header ApprOrRejectReason string
Header WarningFlags int?
Header IsTemplate bool?
Header HasFlags long?
Header PermissionHint int?
Header IsLocked bool?
Header Lock ObjectLock
Header FileContainer ObjectFileContainer
Attributes Attributes List of Attribute. Supported Filters
[StartAt=value]
[PageSize=value]
[IsLinked=value]
[CompleteMemo=value]
[AttributeDef.Id IN (comma delimited values)]
[AttributeDef.IsIntrinsic=value]
[AttributeDef.DataType IN (comma delimited values)]
[AttributeDef.DataType NOT IN (comma delimited values)]
[AttributeDef.Name=value]
Snapshots Snapshots List of ObjectSnapshot. Supported Filters
[StartAt=value]
[PageSize=value]
Keywords Keywords List of ObjectKeyword. Supported Filters
[StartAt=value]
[PageSize=value]
Notes Notes List of Note. Supported Filters
[StartAt=value]
[PageSize=value]
Securities Securities List of Security. Supported Filters
[StartAt=value]
[PageSize=value]
[Permission&=value]
AuditDetails AuditDetails List of AuditDetail
Responsibilities Responsibilities List of Responsibility. Supported Filters
[StartAt=value]
[PageSize=value]
[ResponsibilityType.Id IN (comma delimited values)]
AffectedDocuments AffectedDocuments List of AffectedDocument. Supported Filters
[StartAt=value]
[PageSize=value]
AffectedPhysicalItems AffectedPhysicalItems List of AffectedPhysicalItem. Supported Filters
[StartAt=value]
[PageSize=value]
AffectedTags AffectedTags List of AffectedTag. Supported Filters
[StartAt=value]
[PageSize=value]
AffectedVirtualItemGroups AffectedVirtualItemGroups List of AffectedVirtualItemGroup. Supported Filters
[StartAt=value]
[PageSize=value]
Header DateAdded DateTime?
Header AddedBy Person
Header DateChanged DateTime?
Header ChangedBy Person
ChangeRequests ChangeRequests List of ChangeRequestChangeRequest. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Documents Documents List of ChangeRequestDocument. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Events Events List of ChangeRequestEvent. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
GroupedVirtualItems GroupedVirtualItems List of ChangeRequestGroupedVirtualItem. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Locations Locations List of ChangeRequestLocation. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Organizations Organizations List of ChangeRequestOrganization. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Persons Persons List of ChangeRequestPerson. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
PhysicalItems PhysicalItems List of ChangeRequestPhysicalItem. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Projects Projects List of ChangeRequestProject. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
SerializedItems SerializedItems List of ChangeRequestSerializedItem. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
SharePointItems SharePointItems List of ChangeRequestSharePointItem. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Tags Tags List of ChangeRequestTag. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
VirtualItemGroups VirtualItemGroups List of ChangeRequestVirtualItemGroup. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
ProjectWiseItems ProjectWiseItems List of ChangeRequestProjectWiseItem. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
ExternalObjects ExternalObjects List of ChangeRequestExternalObject. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
CopyOptions CopyOptions List of CopyOption. Supported Filters
[HasData=value]
WorkOrders WorkOrders List of WorkOrderChangeRequest. Supported Filters
[StartAt=value]
[PageSize=value]
WorkTasks WorkTasks List of WorkTaskChangeRequest. Supported Filters
[StartAt=value]
[PageSize=value]
ImpactedModifications ImpactedModifications List of ModificationImpactedChangeRequest. Supported Filters
[StartAt=value]
[PageSize=value]
ChangeProgress ChangeProgress List of ChangeProgress. Supported Filters
[StartAt=value]
[PageSize=value]
ImplementedDocuments ImplementedDocuments List of AffectedDocument. Supported Filters
[StartAt=value]
[PageSize=value]
ImplementedPhysicalItems ImplementedPhysicalItems List of AffectedPhysicalItem. Supported Filters
[StartAt=value]
[PageSize=value]
ImplementedTags ImplementedTags List of AffectedTag. Supported Filters
[StartAt=value]
[PageSize=value]
ImplementedVirtualItemGroups ImplementedVirtualItemGroups List of AffectedVirtualItemGroup. Supported Filters
[StartAt=value]
[PageSize=value]
ContextualReports ContextualReports List of ReportContext. Supported Filters
[StartAt=value]
[PageSize=value]
InheritanceHierarchy InheritanceHierarchy List of OrdinalObject
Folders Folders List of FolderChangeRequest. Supported Filters
[StartAt=value]
[PageSize=value]
Tasks Tasks List of TaskChangeRequest. Supported Filters
[StartAt=value]
[PageSize=value]

RetrieveChangeRequest Responses

Status Description
200, OK The operation was completed successfully and the response body contains the result.
204, No Content The operation resulted no records (e.g. filter does not produce any result).
400, Bad Request When there is an error in the provided parameters (e.g. syntax error in filter).
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to access this instance.
500, Internal Server Error An unexpected error occured.

Creating ChangeRequests

Try me in Swagger

Request Body (JSON)

{
  "code": "string value",
  "organization": {
    "id": 999
  },
  "requestedBy": {
    "id": 999
  },
  "priority": {
    "priority": 999
  },
  "category": "string value",
  "description": "string value",
  "reason": "string value",
  "dateRegistered": "2020-05-07T16:25:12Z",
  "class": {
    "id": 999
  }
}

$ curl -X POST https://datastorage.dev.aw-au.bentley.com/{Context}/ChangeRequests
-H "Accept: application/json"
-H "Authorization: Bearer {token}"
-d "see json request body"

// the modelPost structure is described in the Request Json 
async function postChangeRequests( host, modelPost) {
   let requestUrl = host + '/api/0/ChangeRequests
   const init = {
      method: 'POST',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = modelPost.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

{
  "id": 999
}

The following methods are available for creating a new instance of ChangeRequest.

  1. Calling the API directly providing the required data.

  2. Using a Template

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server. Set the "Authorization" parameter to a valid session bearer token.

Add ChangeRequest Request Info

Info Description
url http(s)://{server}/api/{context}/ChangeRequests
Request POST
Media Type application/json
Response The Id of the newly created item

Post ChangeRequest Contract Info

The POST request for ChangeRequest contract has the following properties

Name Type
Code string
Organization IdPost
RequestedBy IdPost
Priority PriorityRefPost
Category string
Description string
Reason string
DateRegistered DateTime?
Class IdPost

Add ChangeRequest Response Statuses

Status Description
201, Created A new instance was created and the result body contains the id of the instance.
400, Bad Request The Server could not create the instance. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to create new objects of this type.
409, Conflict When the provided record already exists.
500, Internal Server Error An unexpected error occured.

Changing ChangeRequests

Try me in Swagger

Request Body (JSON)

{
  "code": "string value",
  "organization": {
    "id": 999
  },
  "requestedBy": {
    "id": 999
  },
  "priority": {
    "priority": 999
  },
  "category": "string value",
  "status": "string value",
  "description": "string value",
  "reason": "string value",
  "dateRegistered": "2020-05-07T16:25:12Z",
  "class": {
    "id": 999
  },
  "dateApprOrReject": "2020-05-07T16:25:12Z",
  "apprOrRejectBy": {
    "id": 999
  },
  "apprOrRejectReason": "string value",
  "id": 999
}

$ curl -X PATCH https://datastorage.dev.aw-au.bentley.com/{Context}/ChangeRequests
-H "Accept: application/json"
-H "Authorization: Bearer {token}"
-d "see json request"

// the modelPatch structure is described in the Request Json 
async function patchChangeRequests( host, id, modelPatch) {
   let requestUrl = host + '/api/0/ChangeRequests/'+id
   const init = {
      method: 'PATCH',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = modelPatch.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Saves the modification on the ChangeRequest instance to the database.

Try me in Swagger

Change ChangeRequest Request Info

Info Description
url http(s)://{server}/api/{context}/ChangeRequests
Request PATCH
Media Type application/json
Response status

Patch ChangeRequest Contract Info

The ChangeRequest properties for a PATCH requests are:

Name Type
Code string
Organization IdPatch
RequestedBy IdPatch
Priority PriorityRefPatch
Category string
Status string
Description string
Reason string
DateRegistered DateTime?
Class IdPatch
DateApprOrReject DateTime?
ApprOrRejectBy IdPatch
ApprOrRejectReason string
Id int

Patch ChangeRequest Responses

Status Description
204, No Content The change was successful.
400, Bad Request The Server could not apply the change. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to Modify this instance or any instance of this type.
409, Conflict When the change request will produce a duplicate entry.
500, Internal Server Error An unexpected error occured.

Deleting ChangeRequests

Try me in Swagger

$ curl -X DELETE https://datastorage.dev.aw-au.bentley.com/{Context}/ChangeRequests/123
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function DeleteChangeRequests( host, id) {
   let requestUrl = host + '/api/0/ChangeRequests/+id+
   const init = {
      method: 'DELETE',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = model.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Deletes the ChangeRequest instance from the database.

Delete ChangeRequest Request Info

Info Description
url http(s)://{server}/api/{context}/ChangeRequests/{id}
Request DELETE
Media Type text/json
Response status

Delete ChangeRequest Responses

Status Description
204, No Content The deletion was successful.
400, Bad Request The Server could not delete the instance. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to Delete this instance or any instance of this type.
500, Internal Server Error An unexpected error occured.

Copying ChangeRequests

Try me in Swagger

Request Body (JSON)

{
  "code": "string value",
  "toId": 999,
  "batchSize": 999,
  "options": "string value"
}

// the modelCopyPost structure is described in the Request Json 
async function copyChangeRequests( host, id, modelCopyPost) {
   let requestUrl = host + '/api/0/ChangeRequests/'+id+'/InstanceCopies'
   const init = {
      method: 'POST',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = modelCopyPost.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

{
  "id": 999
}

Creates a Copy of the Selected ChangeRequest Resource

Copy ChangeRequest Request Info

Info Description
url http(s)://{server}/api/{context}/ChangeRequests/{id}/InstanceCopies
Request POST
Media Type application/json
Response The Id of the newly created item

Copy ChangeRequest Responses

Status Description
201, Created A Copy of the object was created. The response body contains the id of the new instance.
400, Bad Request The Server could not create a copy. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to Create or Copy this instance or any instance of this type.
409, Conflict When the copy request will produce a duplicate entry. The response body contains the error info.
500, Internal Server Error An unexpected error occured.

GroupedVirtualItems

Supported operations

Searching [GET] /api/{Context}/GroupedVirtualItems

Retrieving [GET] /api/{Context}/GroupedVirtualItems/{id}

Creating [POST] /api/{Context}/GroupedVirtualItems

Changing [PATCH] /api/{Context}/GroupedVirtualItems/{id}

Deleting [DELETE] /api/{Context}/GroupedVirtualItems/{id}

A GroupedVirtualItem is a 'Dependent Object' which mean which mean that although it has most of the characteristics of an Object it depends on the existence of an Independent Object. If the 'parent' Object gets deleted it gets deleted too.

A GroupedVirtualItem may be created in any Scope .

The read-only Id property is the unique identifier. This identifier is assigned on creation and used in subsequent actions like Retrieve .

A GroupedVirtualItem is unique across ( control_id, vitem_id ).

The ObjectType identifier for GroupedVirtualItem is 123.

The GroupedVirtualItem does not support Instance Permission (i.e. Permission to View/Add/Change/Delete are granted accross all records of this Type).

A GroupedVirtualItem supports locking using Lock and Unlock .

You can use GroupedVirtualItem as the root [START WITH] type in a Search . A number of properties including: VirtualItemGroup, Scope, Id, Description, HasFlags, VirtualItem etc. are available to the search. To find a full list of searchable properties use SearchableTypes .

Searching GroupedVirtualItems

$ curl https://datastorage.dev.aw-au.bentley.com//api/{Context}/GroupedVirtualItems/?include=Id&filter=Id=1&startAt=0&pageSize=20
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function searchGroupedVirtualItems( host, include= 'Id', filter, order, startAt = 0, pageSize = 10) {
   let requestUrl = host + '/api/0/GroupedVirtualItems?include=' + include +'&filter=' + filter +;&order=' + order +'&startAt=' + startAt + '&pageSize=' + pageSize;
   const init = {
      method: 'GET',
      headers: {
         Authorization: 'bearer {token}'
         }
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

[
{
  "id": 998
},
{
  "id": 999
}
]

Enables Searching on GroupedVirtualItems using the EQL logic.

Use the GET request method to search for GroupedVirtualItems that satisfy a set of search criteria.

GET /api/{Context}/GroupedVirtualItems

Specify a context (community) to indicate the data source. The default value "0" references the current context.

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server.

  1. Set the "Authorization" parameter to a valid session bearer token.

  2. Use the parameters in the table below to control how the result set displays the returned properties.

The result set contains the selected list of properties for GroupedVirtualItems satisfying the provided search criteria. The result set should include the "id" parameter to allow further operations, such as retrieving detailed information related to a GroupedVirtualItem of interest.


Try me in EqlExplorer
Try me in Swagger

Search GroupedVirtualItem Request Info

Info Description
url http(s)://{server}/api/{context}/GroupedVirtualItems
Request GET
Media Type application/json
Response An Array of objects with the selected properties (key-value pairs).

Search GroupedVirtualItem Request Parameters

Parameter Default Description
include Id The properties to include in the result.
filter Id>1 The search criteria
order Id How to order the results
startAt 1 The index of the first row to return. (Rows are determined base on order)
pageSize the number of rows to return The max number of row to return
context The session context The context (aka community) whose data are being accessed

Search GroupedVirtualItem Responses

Status Description
200, OK When there is at least one record that satisfies the provided filter.
204, No Content When there is no record that satisfies the provided filter.
400, Bad Request When there is an error in the provided parameters (e.g. syntax error in filter).
401, Unauthorized When access is attempted with no authorization header (see #authentication).
500, Internal Server Error An unexpected error occured.

Retrieving GroupedVirtualItems

$ curl https://datastorage.dev.aw-au.bentley.com/{Context}/GroupedVirtualItems/242?include={RetrieveOptions}
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function retrieveGroupedVirtualItems( host, id, retrieveOptions = 'Header') {
   let requestUrl = host + '/api/0/GroupedVirtualItems/id/?include=' + retrieveOptions;
   const init = {
      method: 'GET',
      headers: {
         Authorization: 'bearer {token}'
         }
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

/* Sample request for GroupedVirtualItem */
{
  "addedBy": {
    "id": 999
  },
  "changedBy": {
    "id": 999
  },
  "dateAdded": "2020-09-10T12:09:00.874286+01:00",
  "dateChanged": "2020-09-10T12:09:00.8744038+01:00",
  "guid": "00000000-0000-0000-0000-000000000000",
  "hasFlags": 9999,
  "id": 999,
  "isLocked": true,
  "lock": {
    "lockType": 999,
    "person": {
      "code": "sample",
      "surname": "sample",
      "initial": "sample",
      "title": "sample",
      "scope": {
        "id": 999
      },
      "id": 999
    },
    "transactionName": "sample"
  },
  "permissionHint": 999,
  "scope": {
    "name": "sample",
    "id": 999
  },
  "virtualItem": {
    "code": "sample",
    "description": "sample",
    "class": {
      "code": "sample",
      "name": "sample",
      "isSyncTracked": false,
      "path": "sample",
      "id": 999
    },
    "id": 999
  },
  "virtualItemGroup": {
    "code": "sample",
    "middle": "sample",
    "revision": "sample",
    "class": {
      "code": "sample",
      "name": "sample",
      "isSyncTracked": false,
      "path": "sample",
      "id": 999
    },
    "name": "sample",
    "isTemplate": true,
    "id": 999
  }
}

Retrieves a single GroupedVirtualItem instance the properties of which are populated based on the request parameters.

This GET request method can retrieve more detailed information for the GroupedVirtualItem identified by its "id". The syntax for this form of the GET request is as follows.

GET /api/{Context}/GroupedVirtualItems/{id}

Use the "id" for the GroupedVirtualItem to retrieve, and specify a context (community) to narrow the search. The default value "0" references the current context.

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server.

  1. Set the "Authorization" parameter to a valid session bearer token.

  2. Use the "include" parameter to specify the properties returned in the result set. (Defaults to "Header").

The GET method returns the properties specified in the HTTP request header for the document copy identified by "id".


Try me in RetrieveExplorer
Try me in Swagger

Search GroupedVirtualItem Request Info

Info Description
url http(s)://{server}/api/{context}/GroupedVirtualItems
Request GET
Media Type application/json
Response The GroupedVirtualItem with the [name](#retrieve-groupedvirtualitem-properties-per-include-option. properties populated.

Retrieve GroupedVirtualItem Request Parameters

Parameter Default Description
Id NULL The Identifier of the object to Retrieve.
include Header Which Properties to include (see ).
context The session context The context (aka community) whose data are being accessed

Retrieve GroupedVirtualItem Properties per include option.

Retrieve Option Property Type
Header VirtualItemGroup VirtualItemGroup
Header Scope Scope
Header Guid Guid?
Header Id int
Header Description string
Header HasFlags long?
Header PermissionHint int?
Header IsLocked bool?
Header Lock ObjectLock
Header VirtualItem VirtualItem
CrossReferences CrossReferences List of CrossReference. Supported Filters
[StartAt=value]
[PageSize=value]
Attributes Attributes List of Attribute. Supported Filters
[StartAt=value]
[PageSize=value]
[IsLinked=value]
[CompleteMemo=value]
[AttributeDef.Id IN (comma delimited values)]
[AttributeDef.IsIntrinsic=value]
[AttributeDef.DataType IN (comma delimited values)]
[AttributeDef.DataType NOT IN (comma delimited values)]
[AttributeDef.Name=value]
Keywords Keywords List of ObjectKeyword. Supported Filters
[StartAt=value]
[PageSize=value]
Notes Notes List of Note. Supported Filters
[StartAt=value]
[PageSize=value]
Securities Securities List of Security. Supported Filters
[StartAt=value]
[PageSize=value]
[Permission&=value]
AuditDetails AuditDetails List of AuditDetail
Responsibilities Responsibilities List of Responsibility. Supported Filters
[StartAt=value]
[PageSize=value]
[ResponsibilityType.Id IN (comma delimited values)]
Snapshots Snapshots List of ObjectSnapshot. Supported Filters
[StartAt=value]
[PageSize=value]
Header DateAdded DateTime?
Header AddedBy Person
Header DateChanged DateTime?
Header ChangedBy Person
Parents Parents List of GroupedVirtualItemStructure. Supported Filters
[StartAt=value]
[PageSize=value]
Children Children List of GroupedVirtualItemStructure. Supported Filters
[StartAt=value]
[PageSize=value]
ChangeRequests ChangeRequests List of ChangeRequestGroupedVirtualItem. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Documents Documents List of DocumentGroupedVirtualItem. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Events Events List of EventGroupedVirtualItem. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
GroupedVirtualItems GroupedVirtualItems List of GroupedVirtualItemGroupedVirtualItem. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Locations Locations List of GroupedVirtualItemLocation. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Organizations Organizations List of GroupedVirtualItemOrganization. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Persons Persons List of GroupedVirtualItemPerson. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
PhysicalItems PhysicalItems List of GroupedVirtualItemPhysicalItem. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Projects Projects List of GroupedVirtualItemProject. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
SerializedItems SerializedItems List of GroupedVirtualItemSerializedItem. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
SharePointItems SharePointItems List of GroupedVirtualItemSharePointItem. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Tags Tags List of GroupedVirtualItemTag. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
VirtualItemGroups VirtualItemGroups List of GroupedVirtualItemVirtualItemGroup. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
ProjectWiseItems ProjectWiseItems List of GroupedVirtualItemProjectWiseItem. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
ExternalObjects ExternalObjects List of ExternalObjectGroupedVirtualItem. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
WorkOrders WorkOrders List of WorkOrderGroupedVirtualItem. Supported Filters
[StartAt=value]
[PageSize=value]
WorkTasks WorkTasks List of WorkTaskGroupedVirtualItem. Supported Filters
[StartAt=value]
[PageSize=value]
Folders Folders List of FolderGroupedVirtualItem. Supported Filters
[StartAt=value]
[PageSize=value]
Tasks Tasks List of TaskGroupedVirtualItem. Supported Filters
[StartAt=value]
[PageSize=value]

RetrieveGroupedVirtualItem Responses

Status Description
200, OK The operation was completed successfully and the response body contains the result.
204, No Content The operation resulted no records (e.g. filter does not produce any result).
400, Bad Request When there is an error in the provided parameters (e.g. syntax error in filter).
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to access this instance.
500, Internal Server Error An unexpected error occured.

Creating GroupedVirtualItems

Try me in Swagger

Request Body (JSON)

{
  "virtualItemGroup": {
    "id": 999
  },
  "virtualItem": {
    "id": 999
  }
}

$ curl -X POST https://datastorage.dev.aw-au.bentley.com/{Context}/GroupedVirtualItems
-H "Accept: application/json"
-H "Authorization: Bearer {token}"
-d "see json request body"

// the modelPost structure is described in the Request Json 
async function postGroupedVirtualItems( host, modelPost) {
   let requestUrl = host + '/api/0/GroupedVirtualItems
   const init = {
      method: 'POST',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = modelPost.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

{
  "id": 999
}

The following methods are available for creating a new instance of GroupedVirtualItem.

  1. Calling the API directly providing the required data.

  2. Using a Template

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server. Set the "Authorization" parameter to a valid session bearer token.

Add GroupedVirtualItem Request Info

Info Description
url http(s)://{server}/api/{context}/GroupedVirtualItems
Request POST
Media Type application/json
Response The Id of the newly created item

Post GroupedVirtualItem Contract Info

The POST request for GroupedVirtualItem contract has the following properties

Name Type
VirtualItemGroup IdPost
VirtualItem IdPost

Add GroupedVirtualItem Response Statuses

Status Description
201, Created A new instance was created and the result body contains the id of the instance.
400, Bad Request The Server could not create the instance. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to create new objects of this type.
409, Conflict When the provided record already exists.
500, Internal Server Error An unexpected error occured.

Deleting GroupedVirtualItems

Try me in Swagger

$ curl -X DELETE https://datastorage.dev.aw-au.bentley.com/{Context}/GroupedVirtualItems/123
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function DeleteGroupedVirtualItems( host, id) {
   let requestUrl = host + '/api/0/GroupedVirtualItems/+id+
   const init = {
      method: 'DELETE',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = model.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Deletes the GroupedVirtualItem instance from the database.

Delete GroupedVirtualItem Request Info

Info Description
url http(s)://{server}/api/{context}/GroupedVirtualItems/{id}
Request DELETE
Media Type text/json
Response status

Delete GroupedVirtualItem Responses

Status Description
204, No Content The deletion was successful.
400, Bad Request The Server could not delete the instance. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to Delete this instance or any instance of this type.
500, Internal Server Error An unexpected error occured.

Locations

Supported operations

Searching [GET] /api/{Context}/Locations

Retrieving [GET] /api/{Context}/Locations/{id}

Creating [POST] /api/{Context}/Locations

Changing [PATCH] /api/{Context}/Locations/{id}

Deleting [DELETE] /api/{Context}/Locations/{id}

Create From Template [POST] /api/{Context}/Templates/{id}/Instances

A Location is an 'Independent Object' and a key entity in the system.

A Location must be classified using Class and support Templates.

A Location may be created in any Scope .

The read-only Id property is the unique identifier. This identifier is assigned on creation and used in subsequent actions like Retrieve .

A Location supports Namespace identification.

A Location is unique across ( code, namespace_id ).

The ObjectType identifier for Location is 12.

The Location supports the instance permissions: View, Modify and Delete in addition to the Type permission that governs its creation.

A Location supports locking using Lock and Unlock .

You can use Location as the root [START WITH] type in a Search . A number of properties including: Id, Scope, Namespace, Code, Name, Class etc. are available to the search. To find a full list of searchable properties use SearchableTypes .

Searching Locations

$ curl https://datastorage.dev.aw-au.bentley.com//api/{Context}/Locations/?include=Id,Name,Code,Class.Id&filter=Id=1&startAt=0&pageSize=20
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function searchLocations( host, include= 'Id,Name,Code,Class.Id', filter, order, startAt = 0, pageSize = 10) {
   let requestUrl = host + '/api/0/Locations?include=' + include +'&filter=' + filter +;&order=' + order +'&startAt=' + startAt + '&pageSize=' + pageSize;
   const init = {
      method: 'GET',
      headers: {
         Authorization: 'bearer {token}'
         }
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

[
{
  "id": 998,
  "classId": 998,
  "code": "sample",
  "name": "sample"
},
{
  "id": 999,
  "classId": 999,
  "code": "sample",
  "name": "sample"
}
]

Enables Searching on Locations using the EQL logic.

Use the GET request method to search for Locations that satisfy a set of search criteria.

GET /api/{Context}/Locations

Specify a context (community) to indicate the data source. The default value "0" references the current context.

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server.

  1. Set the "Authorization" parameter to a valid session bearer token.

  2. Use the parameters in the table below to control how the result set displays the returned properties.

The result set contains the selected list of properties for Locations satisfying the provided search criteria. The result set should include the "id" parameter to allow further operations, such as retrieving detailed information related to a Location of interest.


Try me in EqlExplorer
Try me in Swagger

Search Location Request Info

Info Description
url http(s)://{server}/api/{context}/Locations
Request GET
Media Type application/json
Response An Array of objects with the selected properties (key-value pairs).

Search Location Request Parameters

Parameter Default Description
include Id,Name,Code,Class The properties to include in the result.
filter Id>1 The search criteria
order Id How to order the results
startAt 1 The index of the first row to return. (Rows are determined base on order)
pageSize the number of rows to return The max number of row to return
context The session context The context (aka community) whose data are being accessed

Search Location Responses

Status Description
200, OK When there is at least one record that satisfies the provided filter.
204, No Content When there is no record that satisfies the provided filter.
400, Bad Request When there is an error in the provided parameters (e.g. syntax error in filter).
401, Unauthorized When access is attempted with no authorization header (see #authentication).
500, Internal Server Error An unexpected error occured.

Retrieving Locations

$ curl https://datastorage.dev.aw-au.bentley.com/{Context}/Locations/242?include={RetrieveOptions}
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function retrieveLocations( host, id, retrieveOptions = 'Header') {
   let requestUrl = host + '/api/0/Locations/id/?include=' + retrieveOptions;
   const init = {
      method: 'GET',
      headers: {
         Authorization: 'bearer {token}'
         }
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

/* Sample request for Location */
{
  "addedBy": {
    "id": 999
  },
  "changedBy": {
    "id": 999
  },
  "class": {
    "code": "sample",
    "name": "sample",
    "sysType": "sample",
    "isSyncTracked": false,
    "path": "sample",
    "id": 999
  },
  "code": "sample",
  "dateAdded": "2020-09-10T12:09:01.005302+01:00",
  "dateChanged": "2020-09-10T12:09:01.0054921+01:00",
  "hasFlags": 9999,
  "id": 999,
  "isLocked": true,
  "isTemplate": true,
  "lock": {
    "lockType": 999,
    "person": {
      "code": "sample",
      "surname": "sample",
      "initial": "sample",
      "title": "sample",
      "scope": {
        "id": 999
      },
      "id": 999
    },
    "transactionName": "sample"
  },
  "name": "sample",
  "namespace": {
    "name": "sample",
    "id": 999
  },
  "parent": {
    "code": "sample",
    "id": 999,
    "name": "sample"
  },
  "path": "sample",
  "permissionHint": 999,
  "scope": {
    "name": "sample",
    "id": 999
  }
}

Retrieves a single Location instance the properties of which are populated based on the request parameters.

This GET request method can retrieve more detailed information for the Location identified by its "id". The syntax for this form of the GET request is as follows.

GET /api/{Context}/Locations/{id}

Use the "id" for the Location to retrieve, and specify a context (community) to narrow the search. The default value "0" references the current context.

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server.

  1. Set the "Authorization" parameter to a valid session bearer token.

  2. Use the "include" parameter to specify the properties returned in the result set. (Defaults to "Header").

The GET method returns the properties specified in the HTTP request header for the document copy identified by "id".


Try me in RetrieveExplorer
Try me in Swagger

Search Location Request Info

Info Description
url http(s)://{server}/api/{context}/Locations
Request GET
Media Type application/json
Response The Location with the [name](#retrieve-location-properties-per-include-option. properties populated.

Retrieve Location Request Parameters

Parameter Default Description
Id NULL The Identifier of the object to Retrieve.
include Header Which Properties to include (see ).
context The session context The context (aka community) whose data are being accessed

Retrieve Location Properties per include option.

Retrieve Option Property Type
Header Id int
Header Scope Scope
Header Namespace Namespace
Header Code string
Header Name string
Header Class Class
Header Parent Location
Header HasFlags long?
Header PermissionHint int?
Header IsLocked bool?
Header Lock ObjectLock
Header IsTemplate bool?
Header Path string
Children Children List of Location. Supported Filters
[StartAt=value]
[PageSize=value]
Attributes Attributes List of Attribute. Supported Filters
[StartAt=value]
[PageSize=value]
[IsLinked=value]
[CompleteMemo=value]
[AttributeDef.Id IN (comma delimited values)]
[AttributeDef.IsIntrinsic=value]
[AttributeDef.DataType IN (comma delimited values)]
[AttributeDef.DataType NOT IN (comma delimited values)]
[AttributeDef.Name=value]
AuditDetails AuditDetails List of AuditDetail
Securities Securities List of Security. Supported Filters
[StartAt=value]
[PageSize=value]
[Permission&=value]
Snapshots Snapshots List of ObjectSnapshot. Supported Filters
[StartAt=value]
[PageSize=value]
Header DateAdded DateTime?
Header AddedBy Person
Header DateChanged DateTime?
Header ChangedBy Person
ChangeRequests ChangeRequests List of ChangeRequestLocation. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Documents Documents List of DocumentLocation. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Events Events List of EventLocation. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
GroupedVirtualItems GroupedVirtualItems List of GroupedVirtualItemLocation. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Locations Locations List of LocationLocation. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Organizations Organizations List of LocationOrganization. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Persons Persons List of LocationPerson. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
PhysicalItems PhysicalItems List of LocationPhysicalItem. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Projects Projects List of LocationProject. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
SerializedItems SerializedItems List of LocationSerializedItem. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
SharePointItems SharePointItems List of LocationSharePointItem. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Tags Tags List of LocationTag. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
VirtualItemGroups VirtualItemGroups List of LocationVirtualItemGroup. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
ProjectWiseItems ProjectWiseItems List of LocationProjectWiseItem. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
ExternalObjects ExternalObjects List of ExternalObjectLocation. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
CopyOptions CopyOptions List of CopyOption. Supported Filters
[HasData=value]
Copies Copies List of DocumentCopy. Supported Filters
[StartAt=value]
[PageSize=value]
Header PositionOnTags List of TagPosition
Header ModelOf Template
ContextualReports ContextualReports List of ReportContext. Supported Filters
[StartAt=value]
[PageSize=value]
InheritanceHierarchy InheritanceHierarchy List of OrdinalObject
Folders Folders List of FolderLocation. Supported Filters
[StartAt=value]
[PageSize=value]

RetrieveLocation Responses

Status Description
200, OK The operation was completed successfully and the response body contains the result.
204, No Content The operation resulted no records (e.g. filter does not produce any result).
400, Bad Request When there is an error in the provided parameters (e.g. syntax error in filter).
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to access this instance.
500, Internal Server Error An unexpected error occured.

Creating Locations

Try me in Swagger

Request Body (JSON)

{
  "code": "string value",
  "name": "string value",
  "class": {
    "id": 999
  }
}

$ curl -X POST https://datastorage.dev.aw-au.bentley.com/{Context}/Locations
-H "Accept: application/json"
-H "Authorization: Bearer {token}"
-d "see json request body"

// the modelPost structure is described in the Request Json 
async function postLocations( host, modelPost) {
   let requestUrl = host + '/api/0/Locations
   const init = {
      method: 'POST',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = modelPost.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

{
  "id": 999
}

The following methods are available for creating a new instance of Location.

  1. Calling the API directly providing the required data.

  2. Using a Template

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server. Set the "Authorization" parameter to a valid session bearer token.

Add Location Request Info

Info Description
url http(s)://{server}/api/{context}/Locations
Request POST
Media Type application/json
Response The Id of the newly created item

Post Location Contract Info

The POST request for Location contract has the following properties

Name Type
Code string
Name string
Class IdPost

Add Location Response Statuses

Status Description
201, Created A new instance was created and the result body contains the id of the instance.
400, Bad Request The Server could not create the instance. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to create new objects of this type.
409, Conflict When the provided record already exists.
500, Internal Server Error An unexpected error occured.

Changing Locations

Try me in Swagger

Request Body (JSON)

{
  "code": "string value",
  "name": "string value",
  "class": {
    "id": 999
  },
  "id": 999
}

$ curl -X PATCH https://datastorage.dev.aw-au.bentley.com/{Context}/Locations
-H "Accept: application/json"
-H "Authorization: Bearer {token}"
-d "see json request"

// the modelPatch structure is described in the Request Json 
async function patchLocations( host, id, modelPatch) {
   let requestUrl = host + '/api/0/Locations/'+id
   const init = {
      method: 'PATCH',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = modelPatch.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Saves the modification on the Location instance to the database.

Try me in Swagger

Change Location Request Info

Info Description
url http(s)://{server}/api/{context}/Locations
Request PATCH
Media Type application/json
Response status

Patch Location Contract Info

The Location properties for a PATCH requests are:

Name Type
Code string
Name string
Class IdPatch
Id int

Patch Location Responses

Status Description
204, No Content The change was successful.
400, Bad Request The Server could not apply the change. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to Modify this instance or any instance of this type.
409, Conflict When the change request will produce a duplicate entry.
500, Internal Server Error An unexpected error occured.

Deleting Locations

Try me in Swagger

$ curl -X DELETE https://datastorage.dev.aw-au.bentley.com/{Context}/Locations/123
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function DeleteLocations( host, id) {
   let requestUrl = host + '/api/0/Locations/+id+
   const init = {
      method: 'DELETE',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = model.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Deletes the Location instance from the database.

Delete Location Request Info

Info Description
url http(s)://{server}/api/{context}/Locations/{id}
Request DELETE
Media Type text/json
Response status

Delete Location Responses

Status Description
204, No Content The deletion was successful.
400, Bad Request The Server could not delete the instance. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to Delete this instance or any instance of this type.
500, Internal Server Error An unexpected error occured.

Copying Locations

Try me in Swagger

Request Body (JSON)

{
  "code": "string value",
  "toId": 999,
  "batchSize": 999,
  "options": "string value"
}

// the modelCopyPost structure is described in the Request Json 
async function copyLocations( host, id, modelCopyPost) {
   let requestUrl = host + '/api/0/Locations/'+id+'/InstanceCopies'
   const init = {
      method: 'POST',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = modelCopyPost.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

{
  "id": 999
}

Creates a Copy of the Selected Location Resource

Copy Location Request Info

Info Description
url http(s)://{server}/api/{context}/Locations/{id}/InstanceCopies
Request POST
Media Type application/json
Response The Id of the newly created item

Copy Location Responses

Status Description
201, Created A Copy of the object was created. The response body contains the id of the new instance.
400, Bad Request The Server could not create a copy. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to Create or Copy this instance or any instance of this type.
409, Conflict When the copy request will produce a duplicate entry. The response body contains the error info.
500, Internal Server Error An unexpected error occured.

Organizations

Supported operations

Searching [GET] /api/{Context}/Organizations

Retrieving [GET] /api/{Context}/Organizations/{id}

Creating [POST] /api/{Context}/Organizations

Changing [PATCH] /api/{Context}/Organizations/{id}

Deleting [DELETE] /api/{Context}/Organizations/{id}

Create From Template [POST] /api/{Context}/Templates/{id}/Instances

An Organization is an 'Independent Object' and a key entity in the system.

An Organization can be classified using Class and support Templates.

An Organization may be created in any Scope .

The read-only Id property is the unique identifier. This identifier is assigned on creation and used in subsequent actions like Retrieve .

An Organization supports Namespace identification.

An Organization is unique across ( organisation_code, namespace_id ).

The ObjectType identifier for Organization is 5.

The Organization supports the instance permissions: View, Modify and Delete in addition to the Type permission that governs its creation.

An Organization supports locking using Lock and Unlock .

You can use Organization as the root [START WITH] type in a Search . A number of properties including: Id, Namespace, Scope, Code, Name, Class etc. are available to the search. To find a full list of searchable properties use SearchableTypes .

Searching Organizations

$ curl https://datastorage.dev.aw-au.bentley.com//api/{Context}/Organizations/?include=Id,Name,Code,Class.Id&filter=Id=1&startAt=0&pageSize=20
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function searchOrganizations( host, include= 'Id,Name,Code,Class.Id', filter, order, startAt = 0, pageSize = 10) {
   let requestUrl = host + '/api/0/Organizations?include=' + include +'&filter=' + filter +;&order=' + order +'&startAt=' + startAt + '&pageSize=' + pageSize;
   const init = {
      method: 'GET',
      headers: {
         Authorization: 'bearer {token}'
         }
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

[
{
  "classId": 998,
  "code": "sample",
  "id": 998,
  "name": "sample"
},
{
  "classId": 999,
  "code": "sample",
  "id": 999,
  "name": "sample"
}
]

Enables Searching on Organizations using the EQL logic.

Use the GET request method to search for Organizations that satisfy a set of search criteria.

GET /api/{Context}/Organizations

Specify a context (community) to indicate the data source. The default value "0" references the current context.

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server.

  1. Set the "Authorization" parameter to a valid session bearer token.

  2. Use the parameters in the table below to control how the result set displays the returned properties.

The result set contains the selected list of properties for Organizations satisfying the provided search criteria. The result set should include the "id" parameter to allow further operations, such as retrieving detailed information related to a Organization of interest.


Try me in EqlExplorer
Try me in Swagger

Search Organization Request Info

Info Description
url http(s)://{server}/api/{context}/Organizations
Request GET
Media Type application/json
Response An Array of objects with the selected properties (key-value pairs).

Search Organization Request Parameters

Parameter Default Description
include Id,Name,Code,Class The properties to include in the result.
filter Id>1 The search criteria
order Id How to order the results
startAt 1 The index of the first row to return. (Rows are determined base on order)
pageSize the number of rows to return The max number of row to return
context The session context The context (aka community) whose data are being accessed

Search Organization Responses

Status Description
200, OK When there is at least one record that satisfies the provided filter.
204, No Content When there is no record that satisfies the provided filter.
400, Bad Request When there is an error in the provided parameters (e.g. syntax error in filter).
401, Unauthorized When access is attempted with no authorization header (see #authentication).
500, Internal Server Error An unexpected error occured.

Retrieving Organizations

$ curl https://datastorage.dev.aw-au.bentley.com/{Context}/Organizations/242?include={RetrieveOptions}
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function retrieveOrganizations( host, id, retrieveOptions = 'Header') {
   let requestUrl = host + '/api/0/Organizations/id/?include=' + retrieveOptions;
   const init = {
      method: 'GET',
      headers: {
         Authorization: 'bearer {token}'
         }
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

/* Sample request for Organization */
{
  "addedBy": {
    "id": 999
  },
  "changedBy": {
    "id": 999
  },
  "class": {
    "code": "sample",
    "name": "sample",
    "sysType": "sample",
    "isSyncTracked": false,
    "path": "sample",
    "id": 999
  },
  "code": "sample",
  "dateAdded": "2020-09-10T12:09:01.1706177+01:00",
  "dateChanged": "2020-09-10T12:09:01.1707519+01:00",
  "guid": "00000000-0000-0000-0000-000000000000",
  "hasFlags": 9999,
  "id": 999,
  "isLocked": true,
  "isTemplate": true,
  "lock": {
    "lockType": 999,
    "person": {
      "code": "sample",
      "surname": "sample",
      "initial": "sample",
      "title": "sample",
      "scope": {
        "id": 999
      },
      "id": 999
    },
    "transactionName": "sample"
  },
  "name": "sample",
  "namespace": {
    "name": "sample",
    "id": 999
  },
  "permissionHint": 999,
  "registrationNo": "sample",
  "remark": "sample",
  "scope": {
    "name": "sample",
    "id": 999
  },
  "status": "sample",
  "taxNo": "sample",
  "totalSpent": 9.999
}

Retrieves a single Organization instance the properties of which are populated based on the request parameters.

This GET request method can retrieve more detailed information for the Organization identified by its "id". The syntax for this form of the GET request is as follows.

GET /api/{Context}/Organizations/{id}

Use the "id" for the Organization to retrieve, and specify a context (community) to narrow the search. The default value "0" references the current context.

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server.

  1. Set the "Authorization" parameter to a valid session bearer token.

  2. Use the "include" parameter to specify the properties returned in the result set. (Defaults to "Header").

The GET method returns the properties specified in the HTTP request header for the document copy identified by "id".


Try me in RetrieveExplorer
Try me in Swagger

Search Organization Request Info

Info Description
url http(s)://{server}/api/{context}/Organizations
Request GET
Media Type application/json
Response The Organization with the [name](#retrieve-organization-properties-per-include-option. properties populated.

Retrieve Organization Request Parameters

Parameter Default Description
Id NULL The Identifier of the object to Retrieve.
include Header Which Properties to include (see ).
context The session context The context (aka community) whose data are being accessed

Retrieve Organization Properties per include option.

Retrieve Option Property Type
Header IsTemplate bool?
Header Id int
Header Name string
Header Code string
Header Class Class
Header Namespace Namespace
Header Scope Scope
Header Guid Guid?
Header Status string
Header Remark string
Header RegistrationNo string
Header TaxNo string
Header TotalSpent decimal?
Header HasFlags long?
Header PermissionHint int?
Header IsLocked bool?
Header Lock ObjectLock
Attributes Attributes List of Attribute. Supported Filters
[StartAt=value]
[PageSize=value]
[IsLinked=value]
[CompleteMemo=value]
[AttributeDef.Id IN (comma delimited values)]
[AttributeDef.IsIntrinsic=value]
[AttributeDef.DataType IN (comma delimited values)]
[AttributeDef.DataType NOT IN (comma delimited values)]
[AttributeDef.Name=value]
AuditDetails AuditDetails List of AuditDetail
Keywords Keywords List of ObjectKeyword. Supported Filters
[StartAt=value]
[PageSize=value]
Securities Securities List of Security. Supported Filters
[StartAt=value]
[PageSize=value]
[Permission&=value]
DirectoryEntries DirectoryEntries List of DirectoryEntry. Supported Filters
[StartAt=value]
[PageSize=value]
[DirectoryEntryType.Id=value]
[DirectoryEntryType.SysType=value]
[DirectoryEntryType.Id IN (comma delimited values)]
[DirectoryEntryType.SysType IN (comma delimited values)]
Expenditures Expenditures List of Expenditure. Supported Filters
[StartAt=value]
[PageSize=value]
Snapshots Snapshots List of ObjectSnapshot. Supported Filters
[StartAt=value]
[PageSize=value]
Header DateAdded DateTime?
Header AddedBy Person
Header DateChanged DateTime?
Header ChangedBy Person
Members Members List of OrganizationMember. Supported Filters
[StartAt=value]
[PageSize=value]
ChangeRequests ChangeRequests List of ChangeRequestOrganization. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Documents Documents List of DocumentOrganization. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Events Events List of EventOrganization. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
GroupedVirtualItems GroupedVirtualItems List of GroupedVirtualItemOrganization. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Locations Locations List of LocationOrganization. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Organizations Organizations List of OrganizationOrganization. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Persons Persons List of OrganizationPerson. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
PhysicalItems PhysicalItems List of OrganizationPhysicalItem. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Projects Projects List of OrganizationProject. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
SerializedItems SerializedItems List of OrganizationSerializedItem. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
SharePointItems SharePointItems List of OrganizationSharePointItem. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Tags Tags List of OrganizationTag. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
VirtualItemGroups VirtualItemGroups List of OrganizationVirtualItemGroup. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
ProjectWiseItems ProjectWiseItems List of OrganizationProjectWiseItem. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
ExternalObjects ExternalObjects List of ExternalObjectOrganization. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
CopyOptions CopyOptions List of CopyOption. Supported Filters
[HasData=value]
ResponsibleFor ResponsibleFor List of Responsibility. Supported Filters
[StartAt=value]
[PageSize=value]
[ResponsibilityType.Id IN (comma delimited values)]
[Object.Type=value]
ManufacturerOf ManufacturerOf List of Manufacturer. Supported Filters
[StartAt=value]
[PageSize=value]
Header ModelOf Template
ContextualReports ContextualReports List of ReportContext. Supported Filters
[StartAt=value]
[PageSize=value]
InheritanceHierarchy InheritanceHierarchy List of OrdinalObject
ProjectRefs ProjectRefs List of Project. Supported Filters
[StartAt=value]
[PageSize=value]
Folders Folders List of FolderOrganization. Supported Filters
[StartAt=value]
[PageSize=value]
ContractRefs ContractRefs List of CommercialContract. Supported Filters
[StartAt=value]
[PageSize=value]
Subscriptions Subscriptions List of Subscription. Supported Filters
[StartAt=value]
[PageSize=value]
Subscribers Subscribers List of Subscriber. Supported Filters
[StartAt=value]
[PageSize=value]

RetrieveOrganization Responses

Status Description
200, OK The operation was completed successfully and the response body contains the result.
204, No Content The operation resulted no records (e.g. filter does not produce any result).
400, Bad Request When there is an error in the provided parameters (e.g. syntax error in filter).
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to access this instance.
500, Internal Server Error An unexpected error occured.

Creating Organizations

Try me in Swagger

Request Body (JSON)

{
  "code": "string value",
  "name": "string value",
  "registrationNo": "string value",
  "taxNo": "string value",
  "remark": "string value",
  "class": {
    "id": 999
  }
}

$ curl -X POST https://datastorage.dev.aw-au.bentley.com/{Context}/Organizations
-H "Accept: application/json"
-H "Authorization: Bearer {token}"
-d "see json request body"

// the modelPost structure is described in the Request Json 
async function postOrganizations( host, modelPost) {
   let requestUrl = host + '/api/0/Organizations
   const init = {
      method: 'POST',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = modelPost.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

{
  "id": 999
}

The following methods are available for creating a new instance of Organization.

  1. Calling the API directly providing the required data.

  2. Using a Template

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server. Set the "Authorization" parameter to a valid session bearer token.

Add Organization Request Info

Info Description
url http(s)://{server}/api/{context}/Organizations
Request POST
Media Type application/json
Response The Id of the newly created item

Post Organization Contract Info

The POST request for Organization contract has the following properties

Name Type
Code string
Name string
RegistrationNo string
TaxNo string
Remark string
Class IdPost

Add Organization Response Statuses

Status Description
201, Created A new instance was created and the result body contains the id of the instance.
400, Bad Request The Server could not create the instance. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to create new objects of this type.
409, Conflict When the provided record already exists.
500, Internal Server Error An unexpected error occured.

Changing Organizations

Try me in Swagger

Request Body (JSON)

{
  "code": "string value",
  "name": "string value",
  "status": "string value",
  "registrationNo": "string value",
  "taxNo": "string value",
  "remark": "string value",
  "class": {
    "id": 999
  },
  "id": 999
}

$ curl -X PATCH https://datastorage.dev.aw-au.bentley.com/{Context}/Organizations
-H "Accept: application/json"
-H "Authorization: Bearer {token}"
-d "see json request"

// the modelPatch structure is described in the Request Json 
async function patchOrganizations( host, id, modelPatch) {
   let requestUrl = host + '/api/0/Organizations/'+id
   const init = {
      method: 'PATCH',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = modelPatch.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Saves the modification on the Organization instance to the database.

Try me in Swagger

Change Organization Request Info

Info Description
url http(s)://{server}/api/{context}/Organizations
Request PATCH
Media Type application/json
Response status

Patch Organization Contract Info

The Organization properties for a PATCH requests are:

Name Type
Code string
Name string
Status string
RegistrationNo string
TaxNo string
Remark string
Class IdPatch
Id int

Patch Organization Responses

Status Description
204, No Content The change was successful.
400, Bad Request The Server could not apply the change. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to Modify this instance or any instance of this type.
409, Conflict When the change request will produce a duplicate entry.
500, Internal Server Error An unexpected error occured.

Deleting Organizations

Try me in Swagger

$ curl -X DELETE https://datastorage.dev.aw-au.bentley.com/{Context}/Organizations/123
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function DeleteOrganizations( host, id) {
   let requestUrl = host + '/api/0/Organizations/+id+
   const init = {
      method: 'DELETE',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = model.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Deletes the Organization instance from the database.

Delete Organization Request Info

Info Description
url http(s)://{server}/api/{context}/Organizations/{id}
Request DELETE
Media Type text/json
Response status

Delete Organization Responses

Status Description
204, No Content The deletion was successful.
400, Bad Request The Server could not delete the instance. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to Delete this instance or any instance of this type.
500, Internal Server Error An unexpected error occured.

Copying Organizations

Try me in Swagger

Request Body (JSON)

{
  "code": "string value",
  "toId": 999,
  "batchSize": 999,
  "options": "string value"
}

// the modelCopyPost structure is described in the Request Json 
async function copyOrganizations( host, id, modelCopyPost) {
   let requestUrl = host + '/api/0/Organizations/'+id+'/InstanceCopies'
   const init = {
      method: 'POST',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = modelCopyPost.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

{
  "id": 999
}

Creates a Copy of the Selected Organization Resource

Copy Organization Request Info

Info Description
url http(s)://{server}/api/{context}/Organizations/{id}/InstanceCopies
Request POST
Media Type application/json
Response The Id of the newly created item

Copy Organization Responses

Status Description
201, Created A Copy of the object was created. The response body contains the id of the new instance.
400, Bad Request The Server could not create a copy. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to Create or Copy this instance or any instance of this type.
409, Conflict When the copy request will produce a duplicate entry. The response body contains the error info.
500, Internal Server Error An unexpected error occured.

Persons

Supported operations

Searching [GET] /api/{Context}/Persons

Retrieving [GET] /api/{Context}/Persons/{id}

Creating [POST] /api/{Context}/Persons

Changing [PATCH] /api/{Context}/Persons/{id}

Deleting [DELETE] /api/{Context}/Persons/{id}

Create From Template [POST] /api/{Context}/Templates/{id}/Instances

A Person is an 'Independent Object' and a key entity in the system.

A Person can be classified using Class and support Templates.

A Person may be created in any Scope .

The read-only Id property is the unique identifier. This identifier is assigned on creation and used in subsequent actions like Retrieve .

A Person supports Namespace identification.

A Person is unique across ( person_code, namespace_id ).

The ObjectType identifier for Person is 4.

The Person supports the instance permissions: View, Modify and Delete in addition to the Type permission that governs its creation.

A Person supports locking using Lock and Unlock .

You can use Person as the root [START WITH] type in a Search . A number of properties including: Id, Namespace, Scope, Code, Surname, Initial etc. are available to the search. To find a full list of searchable properties use SearchableTypes .

Searching Persons

$ curl https://datastorage.dev.aw-au.bentley.com//api/{Context}/Persons/?include=Id,Code,Class.Id&filter=Id=1&startAt=0&pageSize=20
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function searchPersons( host, include= 'Id,Code,Class.Id', filter, order, startAt = 0, pageSize = 10) {
   let requestUrl = host + '/api/0/Persons?include=' + include +'&filter=' + filter +;&order=' + order +'&startAt=' + startAt + '&pageSize=' + pageSize;
   const init = {
      method: 'GET',
      headers: {
         Authorization: 'bearer {token}'
         }
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

[
{
  "classId": 998,
  "code": "sample",
  "id": 998
},
{
  "classId": 999,
  "code": "sample",
  "id": 999
}
]

Enables Searching on Persons using the EQL logic.

Use the GET request method to search for Persons that satisfy a set of search criteria.

GET /api/{Context}/Persons

Specify a context (community) to indicate the data source. The default value "0" references the current context.

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server.

  1. Set the "Authorization" parameter to a valid session bearer token.

  2. Use the parameters in the table below to control how the result set displays the returned properties.

The result set contains the selected list of properties for Persons satisfying the provided search criteria. The result set should include the "id" parameter to allow further operations, such as retrieving detailed information related to a Person of interest.


Try me in EqlExplorer
Try me in Swagger

Search Person Request Info

Info Description
url http(s)://{server}/api/{context}/Persons
Request GET
Media Type application/json
Response An Array of objects with the selected properties (key-value pairs).

Search Person Request Parameters

Parameter Default Description
include Id,Code,Class The properties to include in the result.
filter Id>1 The search criteria
order Id How to order the results
startAt 1 The index of the first row to return. (Rows are determined base on order)
pageSize the number of rows to return The max number of row to return
context The session context The context (aka community) whose data are being accessed

Search Person Responses

Status Description
200, OK When there is at least one record that satisfies the provided filter.
204, No Content When there is no record that satisfies the provided filter.
400, Bad Request When there is an error in the provided parameters (e.g. syntax error in filter).
401, Unauthorized When access is attempted with no authorization header (see #authentication).
500, Internal Server Error An unexpected error occured.

Retrieving Persons

$ curl https://datastorage.dev.aw-au.bentley.com/{Context}/Persons/242?include={RetrieveOptions}
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function retrievePersons( host, id, retrieveOptions = 'Header') {
   let requestUrl = host + '/api/0/Persons/id/?include=' + retrieveOptions;
   const init = {
      method: 'GET',
      headers: {
         Authorization: 'bearer {token}'
         }
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

/* Sample request for Person */
{
  "code": "sample",
  "surname": "sample",
  "initial": "sample",
  "title": "sample",
  "fullName": "sample",
  "firstName": "sample",
  "nationalId": "sample",
  "additionalCode": "sample",
  "securityRefNo": "sample",
  "securityExpDate": "2020-09-10T12:09:01.3242667+01:00",
  "remark": "sample",
  "class": {
    "code": "sample",
    "name": "sample",
    "sysType": "sample",
    "isSyncTracked": false,
    "path": "sample",
    "id": 999
  },
  "status": "sample",
  "namespace": {
    "name": "sample",
    "id": 999
  },
  "scope": {
    "name": "sample",
    "id": 999
  },
  "guid": "00000000-0000-0000-0000-000000000000",
  "isTemplate": true,
  "hasFlags": 9999,
  "permissionHint": 999,
  "isLocked": true,
  "lock": {
    "lockType": 999,
    "person": {
      "code": "sample",
      "surname": "sample",
      "initial": "sample",
      "title": "sample",
      "scope": {
        "id": 999
      },
      "id": 999
    },
    "transactionName": "sample"
  },
  "dateAdded": "2020-09-10T12:09:01.323037+01:00",
  "addedBy": {
    "id": 999
  },
  "dateChanged": "2020-09-10T12:09:01.3231443+01:00",
  "changedBy": {
    "id": 999
  },
  "rootFolder": {
    "id": 999,
    "name": "sample"
  },
  "basketFolder": {
    "id": 999,
    "name": "sample"
  },
  "temporaryFileContainer": {
    "id": 999
  },
  "id": 999
}

Retrieves a single Person instance the properties of which are populated based on the request parameters.

This GET request method can retrieve more detailed information for the Person identified by its "id". The syntax for this form of the GET request is as follows.

GET /api/{Context}/Persons/{id}

Use the "id" for the Person to retrieve, and specify a context (community) to narrow the search. The default value "0" references the current context.

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server.

  1. Set the "Authorization" parameter to a valid session bearer token.

  2. Use the "include" parameter to specify the properties returned in the result set. (Defaults to "Header").

The GET method returns the properties specified in the HTTP request header for the document copy identified by "id".


Try me in RetrieveExplorer
Try me in Swagger

Search Person Request Info

Info Description
url http(s)://{server}/api/{context}/Persons
Request GET
Media Type application/json
Response The Person with the [name](#retrieve-person-properties-per-include-option. properties populated.

Retrieve Person Request Parameters

Parameter Default Description
Id NULL The Identifier of the object to Retrieve.
include Header Which Properties to include (see ).
context The session context The context (aka community) whose data are being accessed

Retrieve Person Properties per include option.

Retrieve Option Property Type
Header IsTemplate bool?
Header Id int
Header Code string
Header Class Class
Header Namespace Namespace
Header Scope Scope
Header Guid Guid?
Header Surname string
Header Initial string
Header FirstName string
Header Title string
Header Status string
Header FullName string
Header Remark string
Header AdditionalCode string
Header NationalId string
Header SecurityRefNo string
Header HasFlags long?
Header PermissionHint int?
Header IsLocked bool?
Header Lock ObjectLock
Attributes Attributes List of Attribute. Supported Filters
[StartAt=value]
[PageSize=value]
[IsLinked=value]
[CompleteMemo=value]
[AttributeDef.Id IN (comma delimited values)]
[AttributeDef.IsIntrinsic=value]
[AttributeDef.DataType IN (comma delimited values)]
[AttributeDef.DataType NOT IN (comma delimited values)]
[AttributeDef.Name=value]
AuditDetails AuditDetails List of AuditDetail
Keywords Keywords List of ObjectKeyword. Supported Filters
[StartAt=value]
[PageSize=value]
Securities Securities List of Security. Supported Filters
[StartAt=value]
[PageSize=value]
[Permission&=value]
Settings Settings List of Setting. Supported Filters
[StartAt=value]
[PageSize=value]
[SettingDef.Id=value]
[SettingDef.Code=value]
[SettingDef.Id IN (comma delimited values)]
[SettingDef.Code IN (comma delimited values)]
[SettingDef.Intent.Id=value]
[SettingDef.Intent.Code=value]
[SettingDef.Category.Id IN (comma delimited values)]
[SettingDef.Category.Name IN (comma delimited values)]
Header SecurityExpDate DateTime?
UserAccounts UserAccounts List of UserAccount
Skills Skills List of PersonSkill. Supported Filters
[StartAt=value]
[PageSize=value]
DirectoryEntries DirectoryEntries List of DirectoryEntry. Supported Filters
[StartAt=value]
[PageSize=value]
[DirectoryEntryType.Id=value]
[DirectoryEntryType.SysType=value]
[DirectoryEntryType.Id IN (comma delimited values)]
[DirectoryEntryType.SysType IN (comma delimited values)]
Permissions Permissions List of PersonPermission. Supported Filters
[StartAt=value]
[PageSize=value]
Roles Roles List of RolePerson. Supported Filters
[StartAt=value]
[PageSize=value]
Snapshots Snapshots List of ObjectSnapshot. Supported Filters
[StartAt=value]
[PageSize=value]
Header DateAdded DateTime?
Header AddedBy Person
Header DateChanged DateTime?
Header ChangedBy Person
MemberOf MemberOf List of OrganizationMember. Supported Filters
[StartAt=value]
[PageSize=value]
ChangeRequests ChangeRequests List of ChangeRequestPerson. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Documents Documents List of DocumentPerson. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Events Events List of EventPerson. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
GroupedVirtualItems GroupedVirtualItems List of GroupedVirtualItemPerson. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Locations Locations List of LocationPerson. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Organizations Organizations List of OrganizationPerson. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Persons Persons List of PersonPerson. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
PhysicalItems PhysicalItems List of PersonPhysicalItem. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Projects Projects List of PersonProject. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
SerializedItems SerializedItems List of PersonSerializedItem. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
SharePointItems SharePointItems List of PersonSharePointItem. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Tags Tags List of PersonTag. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
VirtualItemGroups VirtualItemGroups List of PersonVirtualItemGroup. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
ProjectWiseItems ProjectWiseItems List of PersonProjectWiseItem. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
ExternalObjects ExternalObjects List of ExternalObjectPerson. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
CopyOptions CopyOptions List of CopyOption. Supported Filters
[HasData=value]
ResponsibleFor ResponsibleFor List of Responsibility. Supported Filters
[StartAt=value]
[PageSize=value]
[ResponsibilityType.Id IN (comma delimited values)]
[Object.Type=value]
DocumentsHeld DocumentsHeld List of DistributionItem. Supported Filters
[StartAt=value]
[PageSize=value]
AssignedWorkTasks AssignedWorkTasks List of WorkTask. Supported Filters
[StartAt=value]
[PageSize=value]
Header ModelOf Template
Header SecurityRefs List of Security
LocksHeld LocksHeld List of ObjectLock. Supported Filters
[StartAt=value]
[PageSize=value]
ContextualReports ContextualReports List of ReportContext. Supported Filters
[StartAt=value]
[PageSize=value]
InheritanceHierarchy InheritanceHierarchy List of OrdinalObject
ScopeInvites ScopeInvites List of ScopeInvite. Supported Filters
[StartAt=value]
[PageSize=value]
Folders Folders List of FolderPerson. Supported Filters
[StartAt=value]
[PageSize=value]
Subscriptions Subscriptions List of Subscription. Supported Filters
[StartAt=value]
[PageSize=value]
Subscribers Subscribers List of Subscriber. Supported Filters
[StartAt=value]
[PageSize=value]
Tasks Tasks List of TaskPerson. Supported Filters
[StartAt=value]
[PageSize=value]
Header RootFolder Folder
Header BasketFolder Folder
Header TemporaryFileContainer Document

RetrievePerson Responses

Status Description
200, OK The operation was completed successfully and the response body contains the result.
204, No Content The operation resulted no records (e.g. filter does not produce any result).
400, Bad Request When there is an error in the provided parameters (e.g. syntax error in filter).
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to access this instance.
500, Internal Server Error An unexpected error occured.

Creating Persons

Try me in Swagger

Request Body (JSON)

{
  "code": "string value",
  "surname": "string value",
  "initial": "string value",
  "title": "string value",
  "fullName": "string value",
  "firstName": "string value",
  "nationalId": "string value",
  "additionalCode": "string value",
  "securityRefNo": "string value",
  "securityExpDate": "2020-05-07T16:25:12Z",
  "remark": "string value",
  "class": {
    "id": 999
  }
}

$ curl -X POST https://datastorage.dev.aw-au.bentley.com/{Context}/Persons
-H "Accept: application/json"
-H "Authorization: Bearer {token}"
-d "see json request body"

// the modelPost structure is described in the Request Json 
async function postPersons( host, modelPost) {
   let requestUrl = host + '/api/0/Persons
   const init = {
      method: 'POST',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = modelPost.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

{
  "id": 999
}

The following methods are available for creating a new instance of Person.

  1. Calling the API directly providing the required data.

  2. Using a Template

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server. Set the "Authorization" parameter to a valid session bearer token.

Add Person Request Info

Info Description
url http(s)://{server}/api/{context}/Persons
Request POST
Media Type application/json
Response The Id of the newly created item

Post Person Contract Info

The POST request for Person contract has the following properties

Name Type
Code string
Surname string
Initial string
Title string
FullName string
FirstName string
NationalId string
AdditionalCode string
SecurityRefNo string
SecurityExpDate DateTime?
Remark string
Class IdPost

Add Person Response Statuses

Status Description
201, Created A new instance was created and the result body contains the id of the instance.
400, Bad Request The Server could not create the instance. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to create new objects of this type.
409, Conflict When the provided record already exists.
500, Internal Server Error An unexpected error occured.

Changing Persons

Try me in Swagger

Request Body (JSON)

{
  "code": "string value",
  "surname": "string value",
  "initial": "string value",
  "title": "string value",
  "fullName": "string value",
  "firstName": "string value",
  "nationalId": "string value",
  "additionalCode": "string value",
  "securityRefNo": "string value",
  "securityExpDate": "2020-05-07T16:25:12Z",
  "status": "string value",
  "remark": "string value",
  "class": {
    "id": 999
  },
  "id": 999
}

$ curl -X PATCH https://datastorage.dev.aw-au.bentley.com/{Context}/Persons
-H "Accept: application/json"
-H "Authorization: Bearer {token}"
-d "see json request"

// the modelPatch structure is described in the Request Json 
async function patchPersons( host, id, modelPatch) {
   let requestUrl = host + '/api/0/Persons/'+id
   const init = {
      method: 'PATCH',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = modelPatch.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Saves the modification on the Person instance to the database.

Try me in Swagger

Change Person Request Info

Info Description
url http(s)://{server}/api/{context}/Persons
Request PATCH
Media Type application/json
Response status

Patch Person Contract Info

The Person properties for a PATCH requests are:

Name Type
Code string
Surname string
Initial string
Title string
FullName string
FirstName string
NationalId string
AdditionalCode string
SecurityRefNo string
SecurityExpDate DateTime?
Status string
Remark string
Class IdPatch
Id int

Patch Person Responses

Status Description
204, No Content The change was successful.
400, Bad Request The Server could not apply the change. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to Modify this instance or any instance of this type.
409, Conflict When the change request will produce a duplicate entry.
500, Internal Server Error An unexpected error occured.

Deleting Persons

Try me in Swagger

$ curl -X DELETE https://datastorage.dev.aw-au.bentley.com/{Context}/Persons/123
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function DeletePersons( host, id) {
   let requestUrl = host + '/api/0/Persons/+id+
   const init = {
      method: 'DELETE',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = model.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Deletes the Person instance from the database.

Delete Person Request Info

Info Description
url http(s)://{server}/api/{context}/Persons/{id}
Request DELETE
Media Type text/json
Response status

Delete Person Responses

Status Description
204, No Content The deletion was successful.
400, Bad Request The Server could not delete the instance. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to Delete this instance or any instance of this type.
500, Internal Server Error An unexpected error occured.

Copying Persons

Try me in Swagger

Request Body (JSON)

{
  "code": "string value",
  "toId": 999,
  "batchSize": 999,
  "options": "string value"
}

// the modelCopyPost structure is described in the Request Json 
async function copyPersons( host, id, modelCopyPost) {
   let requestUrl = host + '/api/0/Persons/'+id+'/InstanceCopies'
   const init = {
      method: 'POST',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = modelCopyPost.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

{
  "id": 999
}

Creates a Copy of the Selected Person Resource

Copy Person Request Info

Info Description
url http(s)://{server}/api/{context}/Persons/{id}/InstanceCopies
Request POST
Media Type application/json
Response The Id of the newly created item

Copy Person Responses

Status Description
201, Created A Copy of the object was created. The response body contains the id of the new instance.
400, Bad Request The Server could not create a copy. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to Create or Copy this instance or any instance of this type.
409, Conflict When the copy request will produce a duplicate entry. The response body contains the error info.
500, Internal Server Error An unexpected error occured.

PhysicalItems

Supported operations

Searching [GET] /api/{Context}/PhysicalItems

Retrieving [GET] /api/{Context}/PhysicalItems/{id}

Creating [POST] /api/{Context}/PhysicalItems

Changing [PATCH] /api/{Context}/PhysicalItems/{id}

Deleting [DELETE] /api/{Context}/PhysicalItems/{id}

Create From Template [POST] /api/{Context}/Templates/{id}/Instances

A PhysicalItem is an 'Independent Object' and a key entity in the system.

A PhysicalItem can be classified using Class and support Templates.

A PhysicalItem may be created in any Scope .

The read-only Id property is the unique identifier. This identifier is assigned on creation and used in subsequent actions like Retrieve .

A PhysicalItem supports Namespace identification.

A PhysicalItem is unique across ( item_number, ver, namespace_id ).

The ObjectType identifier for PhysicalItem is 1.

The PhysicalItem supports the instance permissions: View, Modify, Approve and Delete in addition to the Type permission that governs its creation.

A PhysicalItem supports locking using Lock and Unlock .

You can use PhysicalItem as the root [START WITH] type in a Search . A number of properties including: Id, Scope, Code, Version, Name, IsTemplate etc. are available to the search. To find a full list of searchable properties use SearchableTypes .

Physical items represent real-world objects with specific physical or functional characteristics. The following are examples of physical items. - Products that a company builds and sells. - Components assembled into products. - Equipment or assets used to run a business. - Software sold or used in manufacturing. - Batch materials such as paint, chemicals and powders.

Searching PhysicalItems

$ curl https://datastorage.dev.aw-au.bentley.com//api/{Context}/PhysicalItems/?include=Id,Name,Code,Class.Id&filter=Id=1&startAt=0&pageSize=20
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function searchPhysicalItems( host, include= 'Id,Name,Code,Class.Id', filter, order, startAt = 0, pageSize = 10) {
   let requestUrl = host + '/api/0/PhysicalItems?include=' + include +'&filter=' + filter +;&order=' + order +'&startAt=' + startAt + '&pageSize=' + pageSize;
   const init = {
      method: 'GET',
      headers: {
         Authorization: 'bearer {token}'
         }
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

[
{
  "classId": 998,
  "code": "sample",
  "id": 998,
  "name": "sample"
},
{
  "classId": 999,
  "code": "sample",
  "id": 999,
  "name": "sample"
}
]

Enables Searching on PhysicalItems using the EQL logic.

Use the GET request method to search for PhysicalItems that satisfy a set of search criteria.

GET /api/{Context}/PhysicalItems

Specify a context (community) to indicate the data source. The default value "0" references the current context.

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server.

  1. Set the "Authorization" parameter to a valid session bearer token.

  2. Use the parameters in the table below to control how the result set displays the returned properties.

The result set contains the selected list of properties for PhysicalItems satisfying the provided search criteria. The result set should include the "id" parameter to allow further operations, such as retrieving detailed information related to a PhysicalItem of interest.


Try me in EqlExplorer
Try me in Swagger

Search PhysicalItem Request Info

Info Description
url http(s)://{server}/api/{context}/PhysicalItems
Request GET
Media Type application/json
Response An Array of objects with the selected properties (key-value pairs).

Search PhysicalItem Request Parameters

Parameter Default Description
include Id,Name,Code,Class The properties to include in the result.
filter Id>1 The search criteria
order Id How to order the results
startAt 1 The index of the first row to return. (Rows are determined base on order)
pageSize the number of rows to return The max number of row to return
context The session context The context (aka community) whose data are being accessed

Search PhysicalItem Responses

Status Description
200, OK When there is at least one record that satisfies the provided filter.
204, No Content When there is no record that satisfies the provided filter.
400, Bad Request When there is an error in the provided parameters (e.g. syntax error in filter).
401, Unauthorized When access is attempted with no authorization header (see #authentication).
500, Internal Server Error An unexpected error occured.

Retrieving PhysicalItems

$ curl https://datastorage.dev.aw-au.bentley.com/{Context}/PhysicalItems/242?include={RetrieveOptions}
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function retrievePhysicalItems( host, id, retrieveOptions = 'Header') {
   let requestUrl = host + '/api/0/PhysicalItems/id/?include=' + retrieveOptions;
   const init = {
      method: 'GET',
      headers: {
         Authorization: 'bearer {token}'
         }
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

/* Sample request for PhysicalItem */
{
  "code": "sample",
  "version": "sample",
  "name": "sample",
  "status": "sample",
  "changeControlled": true,
  "unit": {
    "baseUnit": {
      "id": 999
    },
    "id": 999,
    "code": "sample",
    "conversionFactor": 9.999,
    "conversionOffSet": 9.999,
    "converter": 999,
    "dateObsolete": "2020-09-10T12:09:01.4860064+01:00",
    "description": "sample",
    "dimension": {
      "id": 999
    },
    "name": "sample",
    "symbol": "sample",
    "unitSystem": {
      "id": 999
    }
  },
  "itemClass": "sample",
  "isSerialized": true,
  "isPhantom": true,
  "isMainEquipment": true,
  "isSoftware": true,
  "physicalItemType": {
    "legacyId": "sample",
    "name": "sample"
  },
  "class": {
    "code": "sample",
    "name": "sample",
    "isSyncTracked": false,
    "path": "sample",
    "id": 999
  },
  "dateObsolete": "2020-09-10T12:09:01.4830826+01:00",
  "extendedDescription": "sample",
  "scope": {
    "name": "sample",
    "id": 999
  },
  "namespace": {
    "name": "sample",
    "id": 999
  },
  "guid": "00000000-0000-0000-0000-000000000000",
  "isTemplate": true,
  "hasFlags": 9999,
  "permissionHint": 999,
  "warningFlags": 999,
  "isLocked": true,
  "lock": {
    "lockType": 999,
    "person": {
      "code": "sample",
      "surname": "sample",
      "initial": "sample",
      "title": "sample",
      "scope": {
        "id": 999
      },
      "isTemplate": true,
      "id": 999
    },
    "transactionName": "sample"
  },
  "fileContainer": {
    "document": {
      "id": 999
    }
  },
  "state": "sample",
  "isUnderChange": true,
  "hasPendingChange": true,
  "dateAdded": "2020-09-10T12:09:01.4828781+01:00",
  "addedBy": {
    "id": 999
  },
  "dateChanged": "2020-09-10T12:09:01.4829913+01:00",
  "changedBy": {
    "id": 999
  },
  "id": 999
}

Retrieves a single PhysicalItem instance the properties of which are populated based on the request parameters.

This GET request method can retrieve more detailed information for the PhysicalItem identified by its "id". The syntax for this form of the GET request is as follows.

GET /api/{Context}/PhysicalItems/{id}

Use the "id" for the PhysicalItem to retrieve, and specify a context (community) to narrow the search. The default value "0" references the current context.

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server.

  1. Set the "Authorization" parameter to a valid session bearer token.

  2. Use the "include" parameter to specify the properties returned in the result set. (Defaults to "Header").

The GET method returns the properties specified in the HTTP request header for the document copy identified by "id".


Try me in RetrieveExplorer
Try me in Swagger

Search PhysicalItem Request Info

Info Description
url http(s)://{server}/api/{context}/PhysicalItems
Request GET
Media Type application/json
Response The PhysicalItem with the [name](#retrieve-physicalitem-properties-per-include-option. properties populated.

Retrieve PhysicalItem Request Parameters

Parameter Default Description
Id NULL The Identifier of the object to Retrieve.
include Header Which Properties to include (see ).
context The session context The context (aka community) whose data are being accessed

Retrieve PhysicalItem Properties per include option.

Retrieve Option Property Type
Header Id int
Header Scope Scope
Header Namespace Namespace
Header Guid Guid?
Header Code string
Header Version string
Header Name string
Header IsTemplate bool?
Header HasFlags long?
Header PermissionHint int?
Header WarningFlags int?
Header Class Class
Header IsLocked bool?
Header Lock ObjectLock
Header FileContainer ObjectFileContainer
Attributes Attributes List of Attribute. Supported Filters
[StartAt=value]
[PageSize=value]
[IsLinked=value]
[CompleteMemo=value]
[AttributeDef.Id IN (comma delimited values)]
[AttributeDef.IsIntrinsic=value]
[AttributeDef.DataType IN (comma delimited values)]
[AttributeDef.DataType NOT IN (comma delimited values)]
[AttributeDef.Name=value]
AuditDetails AuditDetails List of AuditDetail
Keywords Keywords List of ObjectKeyword. Supported Filters
[StartAt=value]
[PageSize=value]
Notes Notes List of Note. Supported Filters
[StartAt=value]
[PageSize=value]
Responsibilities Responsibilities List of Responsibility. Supported Filters
[StartAt=value]
[PageSize=value]
[ResponsibilityType.Id IN (comma delimited values)]
Securities Securities List of Security. Supported Filters
[StartAt=value]
[PageSize=value]
[Permission&=value]
Header Status string
Header State string
Header Unit Unit
Header PhysicalItemType PhysicalItemType
Header ExtendedDescription string
Header ChangeControlled bool?
Header IsUnderChange bool?
Header HasPendingChange bool?
Header DateObsolete DateTime?
Header ItemClass string
Header IsSerialized bool?
Header IsMainEquipment bool?
Header IsSoftware bool?
Header IsPhantom bool?
CrossReferences CrossReferences List of CrossReference. Supported Filters
[StartAt=value]
[PageSize=value]
Interfaces Interfaces List of Interface. Supported Filters
[StartAt=value]
[PageSize=value]
Manufacturers Manufacturers List of Manufacturer. Supported Filters
[StartAt=value]
[PageSize=value]
Baselines Baselines List of Document. Supported Filters
[StartAt=value]
[PageSize=value]
DependantSerializedItems DependantSerializedItems List of SerializedItem. Supported Filters
[StartAt=value]
[PageSize=value]
DependantTags DependantTags List of Tag. Supported Filters
[StartAt=value]
[PageSize=value]
EquivalentPhysicalItems EquivalentPhysicalItems List of EquivalentPhysicalItem. Supported Filters
[StartAt=value]
[PageSize=value]
Snapshots Snapshots List of ObjectSnapshot. Supported Filters
[StartAt=value]
[PageSize=value]
Header DateAdded DateTime?
Header AddedBy Person
Header DateChanged DateTime?
Header ChangedBy Person
LinearLocations LinearLocations List of LinearLocation
LinearGeometry LinearGeometry Geometry
ChangeRequests ChangeRequests List of ChangeRequestPhysicalItem. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Documents Documents List of DocumentPhysicalItem. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Events Events List of EventPhysicalItem. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
GroupedVirtualItems GroupedVirtualItems List of GroupedVirtualItemPhysicalItem. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Locations Locations List of LocationPhysicalItem. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Organizations Organizations List of OrganizationPhysicalItem. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Persons Persons List of PersonPhysicalItem. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
PhysicalItems PhysicalItems List of PhysicalItemPhysicalItem. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Projects Projects List of PhysicalItemProject. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
SerializedItems SerializedItems List of PhysicalItemSerializedItem. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
SharePointItems SharePointItems List of PhysicalItemSharePointItem. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Tags Tags List of PhysicalItemTag. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
VirtualItemGroups VirtualItemGroups List of PhysicalItemVirtualItemGroup. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
ProjectWiseItems ProjectWiseItems List of PhysicalItemProjectWiseItem. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
ExternalObjects ExternalObjects List of ExternalObjectPhysicalItem. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Tasks Tasks List of TaskPhysicalItem. Supported Filters
[StartAt=value]
[PageSize=value]
CopyOptions CopyOptions List of CopyOption. Supported Filters
[HasData=value]
WorkOrders WorkOrders List of WorkOrderPhysicalItem. Supported Filters
[StartAt=value]
[PageSize=value]
WorkTasks WorkTasks List of WorkTaskPhysicalItem. Supported Filters
[StartAt=value]
[PageSize=value]
AffectedChangeRequests AffectedChangeRequests List of AffectedPhysicalItem. Supported Filters
[StartAt=value]
[PageSize=value]
ImpactedDeviationWaivers ImpactedDeviationWaivers List of DeviationWaiverImpactedPhysicalItem. Supported Filters
[StartAt=value]
[PageSize=value]
ImpactedModifications ImpactedModifications List of ModificationImpactedPhysicalItem. Supported Filters
[StartAt=value]
[PageSize=value]
ContextualReports ContextualReports List of ReportContext. Supported Filters
[StartAt=value]
[PageSize=value]
InheritanceHierarchy InheritanceHierarchy List of OrdinalObject
Folders Folders List of FolderPhysicalItem. Supported Filters
[StartAt=value]
[PageSize=value]
TaskItemRefs TaskItemRefs List of TaskItem. Supported Filters
[StartAt=value]
[PageSize=value]

RetrievePhysicalItem Responses

Status Description
200, OK The operation was completed successfully and the response body contains the result.
204, No Content The operation resulted no records (e.g. filter does not produce any result).
400, Bad Request When there is an error in the provided parameters (e.g. syntax error in filter).
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to access this instance.
500, Internal Server Error An unexpected error occured.

Creating PhysicalItems

Try me in Swagger

Request Body (JSON)

{
  "code": "string value",
  "version": "string value",
  "name": "string value",
  "status": "string value",
  "changeControlled": true,
  "unit": {
    "id": 999
  },
  "itemClass": "string value",
  "isSerialized": true,
  "isPhantom": true,
  "isMainEquipment": true,
  "isSoftware": true,
  "physicalItemType": {
    "code": "string value"
  },
  "class": {
    "id": 999
  },
  "dateObsolete": "2020-05-07T16:25:12Z",
  "extendedDescription": "string value"
}

$ curl -X POST https://datastorage.dev.aw-au.bentley.com/{Context}/PhysicalItems
-H "Accept: application/json"
-H "Authorization: Bearer {token}"
-d "see json request body"

// the modelPost structure is described in the Request Json 
async function postPhysicalItems( host, modelPost) {
   let requestUrl = host + '/api/0/PhysicalItems
   const init = {
      method: 'POST',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = modelPost.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

{
  "id": 999
}

The following methods are available for creating a new instance of PhysicalItem.

  1. Calling the API directly providing the required data.

  2. Using a Template

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server. Set the "Authorization" parameter to a valid session bearer token.

Add PhysicalItem Request Info

Info Description
url http(s)://{server}/api/{context}/PhysicalItems
Request POST
Media Type application/json
Response The Id of the newly created item

Post PhysicalItem Contract Info

The POST request for PhysicalItem contract has the following properties

Name Type
Code string
Version string
Name string
Status string
ChangeControlled bool
Unit IdPost
ItemClass string
IsSerialized bool
IsPhantom bool
IsMainEquipment bool
IsSoftware bool
PhysicalItemType CodeRefPost
Class IdPost
DateObsolete DateTime?
ExtendedDescription string

Add PhysicalItem Response Statuses

Status Description
201, Created A new instance was created and the result body contains the id of the instance.
400, Bad Request The Server could not create the instance. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to create new objects of this type.
409, Conflict When the provided record already exists.
500, Internal Server Error An unexpected error occured.

Changing PhysicalItems

Try me in Swagger

Request Body (JSON)

{
  "code": "string value",
  "version": "string value",
  "name": "string value",
  "status": "string value",
  "changeControlled": true,
  "unit": {
    "id": 999
  },
  "itemClass": "string value",
  "isSerialized": true,
  "isPhantom": true,
  "isMainEquipment": true,
  "isSoftware": true,
  "physicalItemType": {
    "code": "string value"
  },
  "class": {
    "id": 999
  },
  "dateObsolete": "2020-05-07T16:25:12Z",
  "extendedDescription": "string value",
  "id": 999
}

$ curl -X PATCH https://datastorage.dev.aw-au.bentley.com/{Context}/PhysicalItems
-H "Accept: application/json"
-H "Authorization: Bearer {token}"
-d "see json request"

// the modelPatch structure is described in the Request Json 
async function patchPhysicalItems( host, id, modelPatch) {
   let requestUrl = host + '/api/0/PhysicalItems/'+id
   const init = {
      method: 'PATCH',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = modelPatch.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Saves the modification on the PhysicalItem instance to the database.

Try me in Swagger

Change PhysicalItem Request Info

Info Description
url http(s)://{server}/api/{context}/PhysicalItems
Request PATCH
Media Type application/json
Response status

Patch PhysicalItem Contract Info

The PhysicalItem properties for a PATCH requests are:

Name Type
Code string
Version string
Name string
Status string
ChangeControlled bool
Unit IdPatch
ItemClass string
IsSerialized bool
IsPhantom bool
IsMainEquipment bool
IsSoftware bool
PhysicalItemType CodeRefPatch
Class IdPatch
DateObsolete DateTime?
ExtendedDescription string
Id int

Patch PhysicalItem Responses

Status Description
204, No Content The change was successful.
400, Bad Request The Server could not apply the change. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to Modify this instance or any instance of this type.
409, Conflict When the change request will produce a duplicate entry.
500, Internal Server Error An unexpected error occured.

Deleting PhysicalItems

Try me in Swagger

$ curl -X DELETE https://datastorage.dev.aw-au.bentley.com/{Context}/PhysicalItems/123
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function DeletePhysicalItems( host, id) {
   let requestUrl = host + '/api/0/PhysicalItems/+id+
   const init = {
      method: 'DELETE',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = model.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Deletes the PhysicalItem instance from the database.

Delete PhysicalItem Request Info

Info Description
url http(s)://{server}/api/{context}/PhysicalItems/{id}
Request DELETE
Media Type text/json
Response status

Delete PhysicalItem Responses

Status Description
204, No Content The deletion was successful.
400, Bad Request The Server could not delete the instance. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to Delete this instance or any instance of this type.
500, Internal Server Error An unexpected error occured.

Copying PhysicalItems

Try me in Swagger

Request Body (JSON)

{
  "itemNumber": "string value",
  "ver": "string value",
  "toId": 999,
  "batchSize": 999,
  "options": "string value"
}

// the modelCopyPost structure is described in the Request Json 
async function copyPhysicalItems( host, id, modelCopyPost) {
   let requestUrl = host + '/api/0/PhysicalItems/'+id+'/InstanceCopies'
   const init = {
      method: 'POST',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = modelCopyPost.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

{
  "id": 999
}

Creates a Copy of the Selected PhysicalItem Resource

Copy PhysicalItem Request Info

Info Description
url http(s)://{server}/api/{context}/PhysicalItems/{id}/InstanceCopies
Request POST
Media Type application/json
Response The Id of the newly created item

Copy PhysicalItem Responses

Status Description
201, Created A Copy of the object was created. The response body contains the id of the new instance.
400, Bad Request The Server could not create a copy. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to Create or Copy this instance or any instance of this type.
409, Conflict When the copy request will produce a duplicate entry. The response body contains the error info.
500, Internal Server Error An unexpected error occured.

Projects

Supported operations

Searching [GET] /api/{Context}/Projects

Retrieving [GET] /api/{Context}/Projects/{id}

Creating [POST] /api/{Context}/Projects

Changing [PATCH] /api/{Context}/Projects/{id}

Deleting [DELETE] /api/{Context}/Projects/{id}

Create From Template [POST] /api/{Context}/Templates/{id}/Instances

A Project is an 'Independent Object' and a key entity in the system.

A Project can be classified using Class and support Templates.

A Project may be created in any Scope .

The read-only Id property is the unique identifier. This identifier is assigned on creation and used in subsequent actions like Retrieve .

A Project is unique across ( code, namespace_id ).

The ObjectType identifier for Project is 9.

The Project supports the instance permissions: View, Modify and Delete in addition to the Type permission that governs its creation.

A Project supports locking using Lock and Unlock .

You can use Project as the root [START WITH] type in a Search . A number of properties including: Id, Scope, Code, Name, Class, IsTemplate etc. are available to the search. To find a full list of searchable properties use SearchableTypes .

Searching Projects

$ curl https://datastorage.dev.aw-au.bentley.com//api/{Context}/Projects/?include=Id,Name,Code,Class.Id&filter=Id=1&startAt=0&pageSize=20
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function searchProjects( host, include= 'Id,Name,Code,Class.Id', filter, order, startAt = 0, pageSize = 10) {
   let requestUrl = host + '/api/0/Projects?include=' + include +'&filter=' + filter +;&order=' + order +'&startAt=' + startAt + '&pageSize=' + pageSize;
   const init = {
      method: 'GET',
      headers: {
         Authorization: 'bearer {token}'
         }
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

[
{
  "classId": 998,
  "code": "sample",
  "id": 998,
  "name": "sample"
},
{
  "classId": 999,
  "code": "sample",
  "id": 999,
  "name": "sample"
}
]

Enables Searching on Projects using the EQL logic.

Use the GET request method to search for Projects that satisfy a set of search criteria.

GET /api/{Context}/Projects

Specify a context (community) to indicate the data source. The default value "0" references the current context.

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server.

  1. Set the "Authorization" parameter to a valid session bearer token.

  2. Use the parameters in the table below to control how the result set displays the returned properties.

The result set contains the selected list of properties for Projects satisfying the provided search criteria. The result set should include the "id" parameter to allow further operations, such as retrieving detailed information related to a Project of interest.


Try me in EqlExplorer
Try me in Swagger

Search Project Request Info

Info Description
url http(s)://{server}/api/{context}/Projects
Request GET
Media Type application/json
Response An Array of objects with the selected properties (key-value pairs).

Search Project Request Parameters

Parameter Default Description
include Id,Name,Code,Class The properties to include in the result.
filter Id>1 The search criteria
order Id How to order the results
startAt 1 The index of the first row to return. (Rows are determined base on order)
pageSize the number of rows to return The max number of row to return
context The session context The context (aka community) whose data are being accessed

Search Project Responses

Status Description
200, OK When there is at least one record that satisfies the provided filter.
204, No Content When there is no record that satisfies the provided filter.
400, Bad Request When there is an error in the provided parameters (e.g. syntax error in filter).
401, Unauthorized When access is attempted with no authorization header (see #authentication).
500, Internal Server Error An unexpected error occured.

Retrieving Projects

$ curl https://datastorage.dev.aw-au.bentley.com/{Context}/Projects/242?include={RetrieveOptions}
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function retrieveProjects( host, id, retrieveOptions = 'Header') {
   let requestUrl = host + '/api/0/Projects/id/?include=' + retrieveOptions;
   const init = {
      method: 'GET',
      headers: {
         Authorization: 'bearer {token}'
         }
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

/* Sample request for Project */
{
  "actualEndDate": "2020-09-10T12:09:01.7033779+01:00",
  "actualStartDate": "2020-09-10T12:09:01.7034821+01:00",
  "addedBy": {
    "id": 999
  },
  "changedBy": {
    "id": 999
  },
  "class": {
    "code": "sample",
    "name": "sample",
    "sysType": "sample",
    "isSyncTracked": false,
    "guid": "00000000-0000-0000-0000-000000000000",
    "path": "sample",
    "id": 999
  },
  "code": "sample",
  "dateAdded": "2020-09-10T12:09:01.7040076+01:00",
  "dateChanged": "2020-09-10T12:09:01.7040957+01:00",
  "description": "sample",
  "fileContainer": {
    "document": {
      "id": 999
    }
  },
  "guid": "00000000-0000-0000-0000-000000000000",
  "hasData": "sample",
  "hasFlags": 9999,
  "id": 999,
  "isLocked": true,
  "isTemplate": true,
  "lock": {
    "lockType": 999,
    "person": {
      "code": "sample",
      "surname": "sample",
      "initial": "sample",
      "title": "sample",
      "scope": {
        "id": 999
      },
      "isTemplate": true,
      "id": 999
    },
    "transactionName": "sample"
  },
  "name": "sample",
  "permissionHint": 999,
  "responsibleOrg": {
    "code": "sample",
    "name": "sample",
    "class": {
      "code": "sample",
      "name": "sample",
      "isSyncTracked": false,
      "id": 999
    },
    "isTemplate": true,
    "id": 999
  },
  "scope": {
    "name": "sample",
    "id": 999
  },
  "status": "sample"
}

Retrieves a single Project instance the properties of which are populated based on the request parameters.

This GET request method can retrieve more detailed information for the Project identified by its "id". The syntax for this form of the GET request is as follows.

GET /api/{Context}/Projects/{id}

Use the "id" for the Project to retrieve, and specify a context (community) to narrow the search. The default value "0" references the current context.

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server.

  1. Set the "Authorization" parameter to a valid session bearer token.

  2. Use the "include" parameter to specify the properties returned in the result set. (Defaults to "Header").

The GET method returns the properties specified in the HTTP request header for the document copy identified by "id".


Try me in RetrieveExplorer
Try me in Swagger

Search Project Request Info

Info Description
url http(s)://{server}/api/{context}/Projects
Request GET
Media Type application/json
Response The Project with the [name](#retrieve-project-properties-per-include-option. properties populated.

Retrieve Project Request Parameters

Parameter Default Description
Id NULL The Identifier of the object to Retrieve.
include Header Which Properties to include (see ).
context The session context The context (aka community) whose data are being accessed

Retrieve Project Properties per include option.

Retrieve Option Property Type
Header Id int
Header Scope Scope
Header Guid Guid?
Header Code string
Header Name string
Header Description string
Header Class Class
Header IsTemplate bool?
Header HasFlags long?
Header HasData string
Header PermissionHint int?
Header IsLocked bool?
Header Lock ObjectLock
Header FileContainer ObjectFileContainer
Attributes Attributes List of Attribute. Supported Filters
[StartAt=value]
[PageSize=value]
[IsLinked=value]
[CompleteMemo=value]
[AttributeDef.Id IN (comma delimited values)]
[AttributeDef.IsIntrinsic=value]
[AttributeDef.DataType IN (comma delimited values)]
[AttributeDef.DataType NOT IN (comma delimited values)]
[AttributeDef.Name=value]
AuditDetails AuditDetails List of AuditDetail
Keywords Keywords List of ObjectKeyword. Supported Filters
[StartAt=value]
[PageSize=value]
Securities Securities List of Security. Supported Filters
[StartAt=value]
[PageSize=value]
[Permission&=value]
Header ResponsibleOrg Organization
Header Status string
Header ActualStartDate DateTime?
Header ActualEndDate DateTime?
Snapshots Snapshots List of ObjectSnapshot. Supported Filters
[StartAt=value]
[PageSize=value]
Responsibilities Responsibilities List of Responsibility. Supported Filters
[StartAt=value]
[PageSize=value]
[ResponsibilityType.Id IN (comma delimited values)]
Header DateAdded DateTime?
Header AddedBy Person
Header DateChanged DateTime?
Header ChangedBy Person
LinearLocations LinearLocations List of LinearLocation
LinearGeometry LinearGeometry Geometry
WorkOrders WorkOrders List of ProjectWorkOrder. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Tasks Tasks List of ProjectTask. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
ChangeRequests ChangeRequests List of ChangeRequestProject. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Documents Documents List of DocumentProject. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Events Events List of EventProject. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
GroupedVirtualItems GroupedVirtualItems List of GroupedVirtualItemProject. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Locations Locations List of LocationProject. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Organizations Organizations List of OrganizationProject. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Persons Persons List of PersonProject. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
PhysicalItems PhysicalItems List of PhysicalItemProject. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Projects Projects List of ProjectProject. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
SerializedItems SerializedItems List of ProjectSerializedItem. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
SharePointItems SharePointItems List of ProjectSharePointItem. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Tags Tags List of ProjectTag. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
VirtualItemGroups VirtualItemGroups List of ProjectVirtualItemGroup. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
ProjectWiseItems ProjectWiseItems List of ProjectProjectWiseItem. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
ExternalObjects ExternalObjects List of ExternalObjectProject. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
CopyOptions CopyOptions List of CopyOption. Supported Filters
[HasData=value]
RequestedDocuments RequestedDocuments List of DistributionItem. Supported Filters
[StartAt=value]
[PageSize=value]
ContextualReports ContextualReports List of ReportContext. Supported Filters
[StartAt=value]
[PageSize=value]
InheritanceHierarchy InheritanceHierarchy List of OrdinalObject
Folders Folders List of FolderProject. Supported Filters
[StartAt=value]
[PageSize=value]
References References List of ActivityReference. Supported Filters
[StartAt=value]
[PageSize=value]
TaskOrders TaskOrders List of TaskOrderProject. Supported Filters
[StartAt=value]
[PageSize=value]

RetrieveProject Responses

Status Description
200, OK The operation was completed successfully and the response body contains the result.
204, No Content The operation resulted no records (e.g. filter does not produce any result).
400, Bad Request When there is an error in the provided parameters (e.g. syntax error in filter).
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to access this instance.
500, Internal Server Error An unexpected error occured.

Creating Projects

Try me in Swagger

Request Body (JSON)

{
  "code": "string value",
  "name": "string value",
  "description": "string value",
  "responsibleOrg": {
    "id": 999
  },
  "actualStartDate": "2020-05-07T16:25:12Z",
  "actualEndDate": "2020-05-07T16:25:12Z",
  "class": {
    "id": 999
  }
}

$ curl -X POST https://datastorage.dev.aw-au.bentley.com/{Context}/Projects
-H "Accept: application/json"
-H "Authorization: Bearer {token}"
-d "see json request body"

// the modelPost structure is described in the Request Json 
async function postProjects( host, modelPost) {
   let requestUrl = host + '/api/0/Projects
   const init = {
      method: 'POST',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = modelPost.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

{
  "id": 999
}

The following methods are available for creating a new instance of Project.

  1. Calling the API directly providing the required data.

  2. Using a Template

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server. Set the "Authorization" parameter to a valid session bearer token.

Add Project Request Info

Info Description
url http(s)://{server}/api/{context}/Projects
Request POST
Media Type application/json
Response The Id of the newly created item

Post Project Contract Info

The POST request for Project contract has the following properties

Name Type
Code string
Name string
Description string
ResponsibleOrg IdPost
ActualStartDate DateTime?
ActualEndDate DateTime?
Class IdPost

Add Project Response Statuses

Status Description
201, Created A new instance was created and the result body contains the id of the instance.
400, Bad Request The Server could not create the instance. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to create new objects of this type.
409, Conflict When the provided record already exists.
500, Internal Server Error An unexpected error occured.

Changing Projects

Try me in Swagger

Request Body (JSON)

{
  "code": "string value",
  "name": "string value",
  "description": "string value",
  "responsibleOrg": {
    "id": 999
  },
  "status": "string value",
  "actualStartDate": "2020-05-07T16:25:12Z",
  "actualEndDate": "2020-05-07T16:25:12Z",
  "class": {
    "id": 999
  },
  "id": 999
}

$ curl -X PATCH https://datastorage.dev.aw-au.bentley.com/{Context}/Projects
-H "Accept: application/json"
-H "Authorization: Bearer {token}"
-d "see json request"

// the modelPatch structure is described in the Request Json 
async function patchProjects( host, id, modelPatch) {
   let requestUrl = host + '/api/0/Projects/'+id
   const init = {
      method: 'PATCH',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = modelPatch.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Saves the modification on the Project instance to the database.

Try me in Swagger

Change Project Request Info

Info Description
url http(s)://{server}/api/{context}/Projects
Request PATCH
Media Type application/json
Response status

Patch Project Contract Info

The Project properties for a PATCH requests are:

Name Type
Code string
Name string
Description string
ResponsibleOrg IdPatch
Status string
ActualStartDate DateTime?
ActualEndDate DateTime?
Class IdPatch
Id int

Patch Project Responses

Status Description
204, No Content The change was successful.
400, Bad Request The Server could not apply the change. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to Modify this instance or any instance of this type.
409, Conflict When the change request will produce a duplicate entry.
500, Internal Server Error An unexpected error occured.

Deleting Projects

Try me in Swagger

$ curl -X DELETE https://datastorage.dev.aw-au.bentley.com/{Context}/Projects/123
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function DeleteProjects( host, id) {
   let requestUrl = host + '/api/0/Projects/+id+
   const init = {
      method: 'DELETE',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = model.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Deletes the Project instance from the database.

Delete Project Request Info

Info Description
url http(s)://{server}/api/{context}/Projects/{id}
Request DELETE
Media Type text/json
Response status

Delete Project Responses

Status Description
204, No Content The deletion was successful.
400, Bad Request The Server could not delete the instance. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to Delete this instance or any instance of this type.
500, Internal Server Error An unexpected error occured.

Copying Projects

Try me in Swagger

Request Body (JSON)

{
  "code": "string value",
  "toId": 999,
  "batchSize": 999,
  "options": "string value"
}

// the modelCopyPost structure is described in the Request Json 
async function copyProjects( host, id, modelCopyPost) {
   let requestUrl = host + '/api/0/Projects/'+id+'/InstanceCopies'
   const init = {
      method: 'POST',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = modelCopyPost.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

{
  "id": 999
}

Creates a Copy of the Selected Project Resource

Copy Project Request Info

Info Description
url http(s)://{server}/api/{context}/Projects/{id}/InstanceCopies
Request POST
Media Type application/json
Response The Id of the newly created item

Copy Project Responses

Status Description
201, Created A Copy of the object was created. The response body contains the id of the new instance.
400, Bad Request The Server could not create a copy. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to Create or Copy this instance or any instance of this type.
409, Conflict When the copy request will produce a duplicate entry. The response body contains the error info.
500, Internal Server Error An unexpected error occured.

Tags

Supported operations

Searching [GET] /api/{Context}/Tags

Retrieving [GET] /api/{Context}/Tags/{id}

Creating [POST] /api/{Context}/Tags

Changing [PATCH] /api/{Context}/Tags/{id}

Deleting [DELETE] /api/{Context}/Tags/{id}

Create From Template [POST] /api/{Context}/Templates/{id}/Instances

A Tag is a 'Dependent Object' which mean which mean that although it has most of the characteristics of an Object it depends on the existence of an Independent Object. If the 'parent' Object gets deleted it gets deleted too.

A Tag can be classified using Class and support Templates.

A Tag may be created in any Scope .

The read-only Id property is the unique identifier. This identifier is assigned on creation and used in subsequent actions like Retrieve .

A Tag is unique across ( item_id, code, revision ), ( item_id, code, revn_name ).

The ObjectType identifier for Tag is 212.

The Tag supports the instance permissions: View, Modify, Approve and Delete in addition to the Type permission that governs its creation.

A Tag supports locking using Lock and Unlock .

You can use Tag as the root [START WITH] type in a Search . A number of properties including: PrimaryPhysicalItem, Id, Scope, Code, Name, Revision etc. are available to the search. To find a full list of searchable properties use SearchableTypes .

Tags define positions in process networks where physical items perform specific functions. Tag definitions always relate to physical items such as plants or units.

Searching Tags

$ curl https://datastorage.dev.aw-au.bentley.com//api/{Context}/Tags/?include=Id,Name,Code,Class.Id&filter=Id=1&startAt=0&pageSize=20
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function searchTags( host, include= 'Id,Name,Code,Class.Id', filter, order, startAt = 0, pageSize = 10) {
   let requestUrl = host + '/api/0/Tags?include=' + include +'&filter=' + filter +;&order=' + order +'&startAt=' + startAt + '&pageSize=' + pageSize;
   const init = {
      method: 'GET',
      headers: {
         Authorization: 'bearer {token}'
         }
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

[
{
  "classId": 998,
  "code": "sample",
  "id": 998,
  "name": "sample"
},
{
  "classId": 999,
  "code": "sample",
  "id": 999,
  "name": "sample"
}
]

Enables Searching on Tags using the EQL logic.

Use the GET request method to search for Tags that satisfy a set of search criteria.

GET /api/{Context}/Tags

Specify a context (community) to indicate the data source. The default value "0" references the current context.

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server.

  1. Set the "Authorization" parameter to a valid session bearer token.

  2. Use the parameters in the table below to control how the result set displays the returned properties.

The result set contains the selected list of properties for Tags satisfying the provided search criteria. The result set should include the "id" parameter to allow further operations, such as retrieving detailed information related to a Tag of interest.


Try me in EqlExplorer
Try me in Swagger

Search Tag Request Info

Info Description
url http(s)://{server}/api/{context}/Tags
Request GET
Media Type application/json
Response An Array of objects with the selected properties (key-value pairs).

Search Tag Request Parameters

Parameter Default Description
include Id,Name,Code,Class The properties to include in the result.
filter Id>1 The search criteria
order Id How to order the results
startAt 1 The index of the first row to return. (Rows are determined base on order)
pageSize the number of rows to return The max number of row to return
context The session context The context (aka community) whose data are being accessed

Search Tag Responses

Status Description
200, OK When there is at least one record that satisfies the provided filter.
204, No Content When there is no record that satisfies the provided filter.
400, Bad Request When there is an error in the provided parameters (e.g. syntax error in filter).
401, Unauthorized When access is attempted with no authorization header (see #authentication).
500, Internal Server Error An unexpected error occured.

Retrieving Tags

$ curl https://datastorage.dev.aw-au.bentley.com/{Context}/Tags/242?include={RetrieveOptions}
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function retrieveTags( host, id, retrieveOptions = 'Header') {
   let requestUrl = host + '/api/0/Tags/id/?include=' + retrieveOptions;
   const init = {
      method: 'GET',
      headers: {
         Authorization: 'bearer {token}'
         }
      }
   return (await fetch(requestUrl, init)).json();
}

Retrieves a single Tag instance the properties of which are populated based on the request parameters.

This GET request method can retrieve more detailed information for the Tag identified by its "id". The syntax for this form of the GET request is as follows.

GET /api/{Context}/Tags/{id}

Use the "id" for the Tag to retrieve, and specify a context (community) to narrow the search. The default value "0" references the current context.

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server.

  1. Set the "Authorization" parameter to a valid session bearer token.

  2. Use the "include" parameter to specify the properties returned in the result set. (Defaults to "Header").

The GET method returns the properties specified in the HTTP request header for the document copy identified by "id".


Try me in RetrieveExplorer
Try me in Swagger

Search Tag Request Info

Info Description
url http(s)://{server}/api/{context}/Tags
Request GET
Media Type application/json
Response The Tag with the [name](#retrieve-tag-properties-per-include-option. properties populated.

Retrieve Tag Request Parameters

Parameter Default Description
Id NULL The Identifier of the object to Retrieve.
include Header Which Properties to include (see ).
context The session context The context (aka community) whose data are being accessed

Retrieve Tag Properties per include option.

Retrieve Option Property Type
Header IsTemplate bool?
Header Id int
Header Name string
Header Code string
Header Class Class
Header PrimaryPhysicalItem PhysicalItem
Header Scope Scope
Header Guid Guid?
Header RevisionSeq int?
Header Revision string
Header Description string
Header ApprovalStatus string
Header StateHint int?
Header DateEffective DateTime?
Header DateObsolete DateTime?
Header OperationalStatus string
Header ChangeControlled bool?
Header IsLatestRevision bool?
Header IsLatestApprovedRevision bool?
Header IsUnderChange bool?
Header HasPendingChange bool?
Header IsSuperseded bool?
Header Function GroupedVirtualItem
Header Quantity decimal?
Header InstalledItem TagInstalledItemLog
Header IsPrototype bool?
Header HasFlags long?
Header PermissionHint int?
Header WarningFlags int?
Header IsLocked bool?
Header Lock ObjectLock
Header URI string
Header FileContainer ObjectFileContainer
Attributes Attributes List of Attribute. Supported Filters
[StartAt=value]
[PageSize=value]
[IsLinked=value]
[CompleteMemo=value]
[AttributeDef.Id IN (comma delimited values)]
[AttributeDef.IsIntrinsic=value]
[AttributeDef.DataType IN (comma delimited values)]
[AttributeDef.DataType NOT IN (comma delimited values)]
[AttributeDef.Name=value]
ConditionRefs ConditionRefs List of Condition. Supported Filters
[StartAt=value]
[PageSize=value]
AlternativeNumbers AlternativeNumbers List of AlternativeNumber. Supported Filters
[StartAt=value]
[PageSize=value]
AuditDetails AuditDetails List of AuditDetail
Interfaces Interfaces List of Interface. Supported Filters
[StartAt=value]
[PageSize=value]
Keywords Keywords List of ObjectKeyword. Supported Filters
[StartAt=value]
[PageSize=value]
Notes Notes List of Note. Supported Filters
[StartAt=value]
[PageSize=value]
Responsibilities Responsibilities List of Responsibility. Supported Filters
[StartAt=value]
[PageSize=value]
[ResponsibilityType.Id IN (comma delimited values)]
Securities Securities List of Security. Supported Filters
[StartAt=value]
[PageSize=value]
[Permission&=value]
ControlledObjects ControlledObjects List of ControlledObject. Supported Filters
[StartAt=value]
[PageSize=value]
[Permission&=value]
CrossReferences CrossReferences List of CrossReference. Supported Filters
[StartAt=value]
[PageSize=value]
[CrossReferenceType.Id IN (comma delimited values)]
InstalledSerials InstalledSerials List of TagInstalledSerialLog. Supported Filters
[StartAt=value]
[PageSize=value]
Positions Positions List of TagPosition. Supported Filters
[StartAt=value]
[PageSize=value]
InstallableItems InstallableItems List of TagInstallableItem. Supported Filters
[StartAt=value]
[PageSize=value]
InstallableSerials InstallableSerials List of TagInstallableSerial. Supported Filters
[StartAt=value]
[PageSize=value]
Baselines Baselines List of ObjectBaseline. Supported Filters
[StartAt=value]
[PageSize=value]
Prototypes Prototypes List of Prototype. Supported Filters
[StartAt=value]
[PageSize=value]
Snapshots Snapshots List of ObjectSnapshot. Supported Filters
[StartAt=value]
[PageSize=value]
Header DateAdded DateTime?
Header AddedBy Person
Header DateChanged DateTime?
Header ChangedBy Person
ChangeRequests ChangeRequests List of ChangeRequestTag. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Conditions Conditions List of ConditionTag. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Documents Documents List of DocumentTag. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Events Events List of EventTag. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
GroupedVirtualItems GroupedVirtualItems List of GroupedVirtualItemTag. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Locations Locations List of LocationTag. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Organizations Organizations List of OrganizationTag. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Persons Persons List of PersonTag. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
PhysicalItems PhysicalItems List of PhysicalItemTag. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Projects Projects List of ProjectTag. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
SerializedItems SerializedItems List of SerializedItemTag. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
SharePointItems SharePointItems List of SharePointItemTag. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Tags Tags List of TagTag. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
VirtualItemGroups VirtualItemGroups List of TagVirtualItemGroup. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
ProjectWiseItems ProjectWiseItems List of ProjectWiseItemTag. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
ExternalObjects ExternalObjects List of ExternalObjectTag. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
CopyOptions CopyOptions List of CopyOption. Supported Filters
[HasData=value]
WorkOrders WorkOrders List of WorkOrderTag. Supported Filters
[StartAt=value]
[PageSize=value]
WorkTasks WorkTasks List of WorkTaskTag. Supported Filters
[StartAt=value]
[PageSize=value]
InstalledItemHistory InstalledItemHistory List of TagInstalledItemLog. Supported Filters
[StartAt=value]
[PageSize=value]
InstalledSerialHistory InstalledSerialHistory List of TagInstalledSerialLog. Supported Filters
[StartAt=value]
[PageSize=value]
AffectedChangeRequests AffectedChangeRequests List of AffectedTag. Supported Filters
[StartAt=value]
[PageSize=value]
Header ModelOf Template
PrototypeRef PrototypeRef Prototype
ContextualReports ContextualReports List of ReportContext. Supported Filters
[StartAt=value]
[PageSize=value]
InheritanceHierarchy InheritanceHierarchy List of OrdinalObject
SetPoints SetPoints List of SetPoint. Supported Filters
[StartAt=value]
[PageSize=value]
Folders Folders List of FolderSerializedItem. Supported Filters
[StartAt=value]
[PageSize=value]
RevisionHistory RevisionHistory List of Tag
Tasks Tasks List of TaskTag. Supported Filters
[StartAt=value]
[PageSize=value]
Activities Activities List of ActivityReference. Supported Filters
[StartAt=value]
[PageSize=value]
Header Parent Tag
Header Root Tag
LinearLocations LinearLocations List of LinearLocation
Restrictions Restrictions List of RestrictionTag
ScheduleDefs ScheduleDefs List of ScheduleDef. Supported Filters
[StartAt=value]
[PageSize=value]
[AppliesToClass.Id IN (comma delimited values)]
[TaskClass.Id IN (comma delimited values)]
[MonthMask&=value]
`[MonthMask
ActivityTypeSets ActivityTypeSets List of ActivityTypeSet. Supported Filters
[StartAt=value]
[PageSize=value]
LinearGeometry LinearGeometry Geometry

RetrieveTag Responses

Status Description
200, OK The operation was completed successfully and the response body contains the result.
204, No Content The operation resulted no records (e.g. filter does not produce any result).
400, Bad Request When there is an error in the provided parameters (e.g. syntax error in filter).
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to access this instance.
500, Internal Server Error An unexpected error occured.

Creating Tags

Try me in Swagger

Request Body (JSON)

{
  "primaryPhysicalItem": {
    "id": 999
  },
  "code": "string value",
  "revision": "string value",
  "class": {
    "id": 999
  },
  "name": "string value",
  "description": "string value",
  "changeControlled": true,
  "operationalStatus": "string value",
  "function": {
    "id": 999
  },
  "quantity": 9.999
}

$ curl -X POST https://datastorage.dev.aw-au.bentley.com/{Context}/Tags
-H "Accept: application/json"
-H "Authorization: Bearer {token}"
-d "see json request body"

// the modelPost structure is described in the Request Json 
async function postTags( host, modelPost) {
   let requestUrl = host + '/api/0/Tags
   const init = {
      method: 'POST',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = modelPost.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

{
  "id": 999
}

The following methods are available for creating a new instance of Tag.

  1. Calling the API directly providing the required data.

  2. Using a Template

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server. Set the "Authorization" parameter to a valid session bearer token.

Add Tag Request Info

Info Description
url http(s)://{server}/api/{context}/Tags
Request POST
Media Type application/json
Response The Id of the newly created item

Post Tag Contract Info

The POST request for Tag contract has the following properties

Name Type
PrimaryPhysicalItem IdPost
Code string
Revision string
Class IdPost
Name string
Description string
ChangeControlled bool
OperationalStatus string
Function IdPost
Quantity decimal

Add Tag Response Statuses

Status Description
201, Created A new instance was created and the result body contains the id of the instance.
400, Bad Request The Server could not create the instance. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to create new objects of this type.
409, Conflict When the provided record already exists.
500, Internal Server Error An unexpected error occured.

Changing Tags

Try me in Swagger

Request Body (JSON)

{
  "primaryPhysicalItem": {
    "id": 999
  },
  "code": "string value",
  "revision": "string value",
  "class": {
    "id": 999
  },
  "name": "string value",
  "description": "string value",
  "changeControlled": true,
  "operationalStatus": "string value",
  "function": {
    "id": 999
  },
  "quantity": 9.999,
  "id": 999
}

$ curl -X PATCH https://datastorage.dev.aw-au.bentley.com/{Context}/Tags
-H "Accept: application/json"
-H "Authorization: Bearer {token}"
-d "see json request"

// the modelPatch structure is described in the Request Json 
async function patchTags( host, id, modelPatch) {
   let requestUrl = host + '/api/0/Tags/'+id
   const init = {
      method: 'PATCH',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = modelPatch.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Saves the modification on the Tag instance to the database.

Try me in Swagger

Change Tag Request Info

Info Description
url http(s)://{server}/api/{context}/Tags
Request PATCH
Media Type application/json
Response status

Patch Tag Contract Info

The Tag properties for a PATCH requests are:

Name Type
PrimaryPhysicalItem IdPatch
Code string
Revision string
Class IdPatch
Name string
Description string
ChangeControlled bool
OperationalStatus string
Function IdPatch
Quantity decimal
Id int

Patch Tag Responses

Status Description
204, No Content The change was successful.
400, Bad Request The Server could not apply the change. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to Modify this instance or any instance of this type.
409, Conflict When the change request will produce a duplicate entry.
500, Internal Server Error An unexpected error occured.

Deleting Tags

Try me in Swagger

$ curl -X DELETE https://datastorage.dev.aw-au.bentley.com/{Context}/Tags/123
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function DeleteTags( host, id) {
   let requestUrl = host + '/api/0/Tags/+id+
   const init = {
      method: 'DELETE',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = model.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Deletes the Tag instance from the database.

Delete Tag Request Info

Info Description
url http(s)://{server}/api/{context}/Tags/{id}
Request DELETE
Media Type text/json
Response status

Delete Tag Responses

Status Description
204, No Content The deletion was successful.
400, Bad Request The Server could not delete the instance. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to Delete this instance or any instance of this type.
500, Internal Server Error An unexpected error occured.

Copying Tags

Try me in Swagger

Request Body (JSON)

{
  "itemId": 999,
  "code": "string value",
  "revnName": "string value",
  "toId": 999,
  "batchSize": 999,
  "options": "string value"
}

// the modelCopyPost structure is described in the Request Json 
async function copyTags( host, id, modelCopyPost) {
   let requestUrl = host + '/api/0/Tags/'+id+'/InstanceCopies'
   const init = {
      method: 'POST',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = modelCopyPost.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

{
  "id": 999
}

Creates a Copy of the Selected Tag Resource

Copy Tag Request Info

Info Description
url http(s)://{server}/api/{context}/Tags/{id}/InstanceCopies
Request POST
Media Type application/json
Response The Id of the newly created item

Copy Tag Responses

Status Description
201, Created A Copy of the object was created. The response body contains the id of the new instance.
400, Bad Request The Server could not create a copy. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to Create or Copy this instance or any instance of this type.
409, Conflict When the copy request will produce a duplicate entry. The response body contains the error info.
500, Internal Server Error An unexpected error occured.

Tasks

Supported operations

Searching [GET] /api/{Context}/Tasks

Retrieving [GET] /api/{Context}/Tasks/{id}

Creating [POST] /api/{Context}/Tasks

Changing [PATCH] /api/{Context}/Tasks/{id}

Deleting [DELETE] /api/{Context}/Tasks/{id}

Create From Template [POST] /api/{Context}/Templates/{id}/Instances

Searching Tasks

$ curl https://datastorage.dev.aw-au.bentley.com//api/{Context}/Tasks/?include=Id,Name,Code,Class.Id&filter=Id=1&startAt=0&pageSize=20
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function searchTasks( host, include= 'Id,Name,Code,Class.Id', filter, order, startAt = 0, pageSize = 10) {
   let requestUrl = host + '/api/0/Tasks?include=' + include +'&filter=' + filter +;&order=' + order +'&startAt=' + startAt + '&pageSize=' + pageSize;
   const init = {
      method: 'GET',
      headers: {
         Authorization: 'bearer {token}'
         }
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

[
{
  "classId": 998,
  "code": "sample",
  "id": 998,
  "name": "sample"
},
{
  "classId": 999,
  "code": "sample",
  "id": 999,
  "name": "sample"
}
]

Enables Searching on Tasks using the EQL logic.

Use the GET request method to search for Tasks that satisfy a set of search criteria.

GET /api/{Context}/Tasks

Specify a context (community) to indicate the data source. The default value "0" references the current context.

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server.

  1. Set the "Authorization" parameter to a valid session bearer token.

  2. Use the parameters in the table below to control how the result set displays the returned properties.

The result set contains the selected list of properties for Tasks satisfying the provided search criteria. The result set should include the "id" parameter to allow further operations, such as retrieving detailed information related to a Task of interest.


Try me in EqlExplorer
Try me in Swagger

Search Task Request Info

Info Description
url http(s)://{server}/api/{context}/Tasks
Request GET
Media Type application/json
Response An Array of objects with the selected properties (key-value pairs).

Search Task Request Parameters

Parameter Default Description
include Id,Name,Code,Class The properties to include in the result.
filter Id>1 The search criteria
order Id How to order the results
startAt 1 The index of the first row to return. (Rows are determined base on order)
pageSize the number of rows to return The max number of row to return
context The session context The context (aka community) whose data are being accessed

Search Task Responses

Status Description
200, OK When there is at least one record that satisfies the provided filter.
204, No Content When there is no record that satisfies the provided filter.
400, Bad Request When there is an error in the provided parameters (e.g. syntax error in filter).
401, Unauthorized When access is attempted with no authorization header (see #authentication).
500, Internal Server Error An unexpected error occured.

Retrieving Tasks

$ curl https://datastorage.dev.aw-au.bentley.com/{Context}/Tasks/242?include={RetrieveOptions}
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function retrieveTasks( host, id, retrieveOptions = 'Header') {
   let requestUrl = host + '/api/0/Tasks/id/?include=' + retrieveOptions;
   const init = {
      method: 'GET',
      headers: {
         Authorization: 'bearer {token}'
         }
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

/* Sample request for Task */
{
  "actEndDate": "2020-09-10T12:09:01.9965537+01:00",
  "actStartDate": "2020-09-10T12:09:01.996814+01:00",
  "addedBy": {
    "id": 999
  },
  "allocationStatus": "sample",
  "approvalStatus": "sample",
  "availableDate": "2020-09-10T12:09:01.9974753+01:00",
  "behaviorFlags": 999,
  "changedBy": {
    "id": 999
  },
  "class": {
    "code": "sample",
    "name": "sample",
    "sysType": "sample",
    "isSyncTracked": false,
    "path": "sample",
    "id": 999
  },
  "code": "sample",
  "dateAdded": "2020-09-10T12:09:01.998131+01:00",
  "dateChanged": "2020-09-10T12:09:01.9982597+01:00",
  "delegatedFrom": {
    "id": 999
  },
  "id": 999,
  "description": "sample",
  "dueDate": "2020-09-10T12:09:01.9986962+01:00",
  "duration": 9.999,
  "fileContainer": {
    "document": {
      "id": 999
    }
  },
  "guid": "00000000-0000-0000-0000-000000000000",
  "hasData": "sample",
  "hasFlags": 9999,
  "isDelegate": true,
  "isLocked": true,
  "isNestedTask": true,
  "isOptional": true,
  "isTemplate": true,
  "lock": {
    "lockType": 999,
    "person": {
      "code": "sample",
      "surname": "sample",
      "initial": "sample",
      "title": "sample",
      "scope": {
        "id": 999
      },
      "isTemplate": true,
      "id": 999
    },
    "transactionName": "sample"
  },
  "name": "sample",
  "namespace": {
    "name": "sample",
    "id": 999
  },
  "parent": {
    "type": 999,
    "code": "sample",
    "name": "sample",
    "class": {
      "code": "sample",
      "name": "sample",
      "isSyncTracked": false,
      "id": 999
    },
    "isTemplate": true,
    "id": 999
  },
  "pendingRequest": "sample",
  "permissionHint": 999,
  "person": {
    "code": "sample",
    "surname": "sample",
    "initial": "sample",
    "firstName": "sample",
    "isTemplate": true,
    "id": 999
  },
  "planEndDate": "2020-09-10T12:09:02.0016433+01:00",
  "planStartDate": "2020-09-10T12:09:02.0017881+01:00",
  "priority": {
    "priority": 999,
    "name": "sample",
    "id": 999
  },
  "remark": "sample",
  "repairStatus": {
    "state": {
      "code": "sample",
      "name": "sample",
      "isStartState": false,
      "isEndState": false,
      "id": 999
    },
    "dateEffective": "2020-09-10T12:09:02.0025571+01:00",
    "remark": "sample"
  },
  "reworkCount": 999,
  "reworkTask": {
    "id": 999
  },
  "scheduledFrom": {
    "monthMask": 0,
    "weekOfMonthMask": 0,
    "dayOfWeekMask": 0,
    "day": 0,
    "startDate": 0,
    "endDate": 0,
    "startTime": 0,
    "endTime": 0,
    "yearInterval": 0,
    "monthInterval": 0,
    "weekInterval": 0,
    "dayInterval": 0,
    "occurrences": 0,
    "timeIntervalType": 0,
    "timeInterval": 0,
    "frequencyType": 0,
    "firstDayOfTheWeek": 0,
    "id": 999
  },
  "scope": {
    "name": "sample",
    "id": 999
  },
  "skill": {
    "name": "sample",
    "id": 999
  },
  "taskStatus": "sample",
  "warningFlags": 999
}

Retrieves a single Task instance the properties of which are populated based on the request parameters.

This GET request method can retrieve more detailed information for the Task identified by its "id". The syntax for this form of the GET request is as follows.

GET /api/{Context}/Tasks/{id}

Use the "id" for the Task to retrieve, and specify a context (community) to narrow the search. The default value "0" references the current context.

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server.

  1. Set the "Authorization" parameter to a valid session bearer token.

  2. Use the "include" parameter to specify the properties returned in the result set. (Defaults to "Header").

The GET method returns the properties specified in the HTTP request header for the document copy identified by "id".


Try me in RetrieveExplorer
Try me in Swagger

Search Task Request Info

Info Description
url http(s)://{server}/api/{context}/Tasks
Request GET
Media Type application/json
Response The Task with the [name](#retrieve-task-properties-per-include-option. properties populated.

Retrieve Task Request Parameters

Parameter Default Description
Id NULL The Identifier of the object to Retrieve.
include Header Which Properties to include (see ).
context The session context The context (aka community) whose data are being accessed

Retrieve Task Properties per include option.

Retrieve Option Property Type
Header Parent Object
Header Id int
Header Scope Scope
Header Namespace Namespace
Header Guid Guid?
Header Code string
Header Name string
Header Description string
Header Remark string
Header Class Class
Header ApprovalStatus string
Header TaskStatus string
Header AllocationStatus string
Header IsOptional bool?
Header Priority TaskPriority
Header Skill Skill
Header Person Person
Header IsDelegate bool?
Header ReworkCount int?
Header Duration decimal?
Header PlanStartDate DateTime?
Header PlanEndDate DateTime?
Header ActStartDate DateTime?
Header ActEndDate DateTime?
Header AvailableDate DateTime?
Header DueDate DateTime?
Header RepairStatus ObjectState
Header IsTemplate bool?
Header IsNestedTask bool?
Header HasFlags long?
Header BehaviorFlags int?
Header HasData string
Header PendingRequest string
Header ReworkTask Task
Header PermissionHint int?
Header WarningFlags int?
Header DelegatedFrom Task
Header IsLocked bool?
Header Lock ObjectLock
Attributes Attributes List of Attribute. Supported Filters
[StartAt=value]
[PageSize=value]
[IsLinked=value]
[CompleteMemo=value]
[AttributeDef.Id IN (comma delimited values)]
[AttributeDef.IsIntrinsic=value]
[AttributeDef.DataType IN (comma delimited values)]
[AttributeDef.DataType NOT IN (comma delimited values)]
[AttributeDef.Name=value]
AuditDetails AuditDetails List of AuditDetail
Header ScheduledFrom ScheduleDef
LineItems LineItems List of TaskItem. Supported Filters
[StartAt=value]
[PageSize=value]
Notes Notes List of Note. Supported Filters
[StartAt=value]
[PageSize=value]
Securities Securities List of Security. Supported Filters
[StartAt=value]
[PageSize=value]
[Permission&=value]
ChangeRequests ChangeRequests List of TaskChangeRequest. Supported Filters
[StartAt=value]
[PageSize=value]
Conditions Conditions List of TaskCondition. Supported Filters
[StartAt=value]
[PageSize=value]
Documents Documents List of TaskDocument. Supported Filters
[StartAt=value]
[PageSize=value]
VirtualItemGroups VirtualItemGroups List of TaskVirtualItemGroup. Supported Filters
[StartAt=value]
[PageSize=value]
GroupedVirtualItems GroupedVirtualItems List of TaskGroupedVirtualItem. Supported Filters
[StartAt=value]
[PageSize=value]
PhysicalItems PhysicalItems List of TaskPhysicalItem. Supported Filters
[StartAt=value]
[PageSize=value]
SerializedItems SerializedItems List of TaskSerializedItem. Supported Filters
[StartAt=value]
[PageSize=value]
Modifications Modifications List of TaskModification. Supported Filters
[StartAt=value]
[PageSize=value]
DistributionOrders DistributionOrders List of TaskDistributionOrder. Supported Filters
[StartAt=value]
[PageSize=value]
Transmittals Transmittals List of TaskTransmittal. Supported Filters
[StartAt=value]
[PageSize=value]
Tags Tags List of TaskTag. Supported Filters
[StartAt=value]
[PageSize=value]
Events Events List of TaskEvent. Supported Filters
[StartAt=value]
[PageSize=value]
SurveyInstances SurveyInstances List of TaskSurveyInstance. Supported Filters
[StartAt=value]
[PageSize=value]
References References List of ActivityReference. Supported Filters
[StartAt=value]
[PageSize=value]
Children Children List of Task. Supported Filters
[StartAt=value]
[PageSize=value]
MergeFrom MergeFrom List of TaskStructure. Supported Filters
[StartAt=value]
[PageSize=value]
SplitTo SplitTo List of TaskStructure. Supported Filters
[StartAt=value]
[PageSize=value]
StructureRules StructureRules List of TaskStructureRule. Supported Filters
[StartAt=value]
[PageSize=value]
NestedTaskTemplates NestedTaskTemplates List of NestedTaskTemplate. Supported Filters
[StartAt=value]
[PageSize=value]
Snapshots Snapshots List of ObjectSnapshot. Supported Filters
[StartAt=value]
[PageSize=value]
Header DateAdded DateTime?
Header AddedBy Person
Header DateChanged DateTime?
Header ChangedBy Person
Header FileContainer ObjectFileContainer
LinearLocations LinearLocations List of LinearLocation
LinearGeometry LinearGeometry Geometry
Projects Projects List of ProjectTask. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Automations Automations List of ObjectAutomation
Header ModelOf Template
CopyOptions CopyOptions List of CopyOption. Supported Filters
[HasData=value]
ContextualReports ContextualReports List of ReportContext. Supported Filters
[StartAt=value]
[PageSize=value]
InheritanceHierarchy InheritanceHierarchy List of OrdinalObject
Folders Folders List of FolderTask. Supported Filters
[StartAt=value]
[PageSize=value]
DelegatedTasks DelegatedTasks List of Task. Supported Filters
[StartAt=value]
[PageSize=value]
TaskOrderItemRefs TaskOrderItemRefs List of TaskOrderItem. Supported Filters
[StartAt=value]
[PageSize=value]
Templates Templates List of TaskTemplate. Supported Filters
[StartAt=value]
[PageSize=value]
Persons Persons List of TaskPerson. Supported Filters
[StartAt=value]
[PageSize=value]

RetrieveTask Responses

Status Description
200, OK The operation was completed successfully and the response body contains the result.
204, No Content The operation resulted no records (e.g. filter does not produce any result).
400, Bad Request When there is an error in the provided parameters (e.g. syntax error in filter).
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to access this instance.
500, Internal Server Error An unexpected error occured.

Creating Tasks

Try me in Swagger

Request Body (JSON)

{
  "parent": {
    "type": 999,
    "id": 999
  },
  "code": "string value",
  "name": "string value",
  "description": "string value",
  "remark": "string value",
  "class": {
    "id": 999
  },
  "skill": {
    "id": 999
  },
  "person": {
    "id": 999
  },
  "priority": {
    "priority": 999
  },
  "isOptional": true,
  "isDelegate": true,
  "isNestedTask": true,
  "duration": 9.999,
  "planStartDate": "2020-05-07T16:25:12Z",
  "planEndDate": "2020-05-07T16:25:12Z",
  "dueDate": "2020-05-07T16:25:12Z",
  "behaviorFlags": 999
}

$ curl -X POST https://datastorage.dev.aw-au.bentley.com/{Context}/Tasks
-H "Accept: application/json"
-H "Authorization: Bearer {token}"
-d "see json request body"

// the modelPost structure is described in the Request Json 
async function postTasks( host, modelPost) {
   let requestUrl = host + '/api/0/Tasks
   const init = {
      method: 'POST',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = modelPost.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

{
  "id": 999
}

The following methods are available for creating a new instance of Task.

  1. Calling the API directly providing the required data.

  2. Using a Template

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server. Set the "Authorization" parameter to a valid session bearer token.

Add Task Request Info

Info Description
url http(s)://{server}/api/{context}/Tasks
Request POST
Media Type application/json
Response The Id of the newly created item

Post Task Contract Info

The POST request for Task contract has the following properties

Name Type
Parent IdTypePost
Code string
Name string
Description string
Remark string
Class IdPost
Skill IdPost
Person IdPost
Priority PriorityRefPost
IsOptional bool
IsDelegate bool
IsNestedTask bool
Duration decimal
PlanStartDate DateTime?
PlanEndDate DateTime?
DueDate DateTime?
BehaviorFlags int

Add Task Response Statuses

Status Description
201, Created A new instance was created and the result body contains the id of the instance.
400, Bad Request The Server could not create the instance. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to create new objects of this type.
409, Conflict When the provided record already exists.
500, Internal Server Error An unexpected error occured.

Changing Tasks

Try me in Swagger

Request Body (JSON)

{
  "parent": {
    "type": 999,
    "id": 999
  },
  "code": "string value",
  "name": "string value",
  "description": "string value",
  "remark": "string value",
  "class": {
    "id": 999
  },
  "skill": {
    "id": 999
  },
  "person": {
    "id": 999
  },
  "priority": {
    "priority": 999
  },
  "isOptional": true,
  "isDelegate": true,
  "isNestedTask": true,
  "duration": 9.999,
  "planStartDate": "2020-05-07T16:25:12Z",
  "planEndDate": "2020-05-07T16:25:12Z",
  "dueDate": "2020-05-07T16:25:12Z",
  "behaviorFlags": 999,
  "id": 999
}

$ curl -X PATCH https://datastorage.dev.aw-au.bentley.com/{Context}/Tasks
-H "Accept: application/json"
-H "Authorization: Bearer {token}"
-d "see json request"

// the modelPatch structure is described in the Request Json 
async function patchTasks( host, id, modelPatch) {
   let requestUrl = host + '/api/0/Tasks/'+id
   const init = {
      method: 'PATCH',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = modelPatch.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Try me in Swagger

Change Task Request Info

Info Description
url http(s)://{server}/api/{context}/Tasks
Request PATCH
Media Type application/json
Response status

Patch Task Contract Info

The Task properties for a PATCH requests are:

Name Type
Parent IdTypePatch
Code string
Name string
Description string
Remark string
Class IdPatch
Skill IdPatch
Person IdPatch
Priority PriorityRefPatch
IsOptional bool
IsDelegate bool
IsNestedTask bool
Duration decimal
PlanStartDate DateTime?
PlanEndDate DateTime?
DueDate DateTime?
BehaviorFlags int
Id int

Patch Task Responses

Status Description
204, No Content The change was successful.
400, Bad Request The Server could not apply the change. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to Modify this instance or any instance of this type.
409, Conflict When the change request will produce a duplicate entry.
500, Internal Server Error An unexpected error occured.

Deleting Tasks

Try me in Swagger

$ curl -X DELETE https://datastorage.dev.aw-au.bentley.com/{Context}/Tasks/123
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function DeleteTasks( host, id) {
   let requestUrl = host + '/api/0/Tasks/+id+
   const init = {
      method: 'DELETE',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = model.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Delete Task Request Info

Info Description
url http(s)://{server}/api/{context}/Tasks/{id}
Request DELETE
Media Type text/json
Response status

Delete Task Responses

Status Description
204, No Content The deletion was successful.
400, Bad Request The Server could not delete the instance. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to Delete this instance or any instance of this type.
500, Internal Server Error An unexpected error occured.

Copying Tasks

Try me in Swagger

Request Body (JSON)

{
  "code": "string value",
  "toId": 999,
  "batchSize": 999,
  "options": "string value"
}

// the modelCopyPost structure is described in the Request Json 
async function copyTasks( host, id, modelCopyPost) {
   let requestUrl = host + '/api/0/Tasks/'+id+'/InstanceCopies'
   const init = {
      method: 'POST',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = modelCopyPost.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

{
  "id": 999
}

Creates a Copy of the Selected Task Resource

Copy Task Request Info

Info Description
url http(s)://{server}/api/{context}/Tasks/{id}/InstanceCopies
Request POST
Media Type application/json
Response The Id of the newly created item

Copy Task Responses

Status Description
201, Created A Copy of the object was created. The response body contains the id of the new instance.
400, Bad Request The Server could not create a copy. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to Create or Copy this instance or any instance of this type.
409, Conflict When the copy request will produce a duplicate entry. The response body contains the error info.
500, Internal Server Error An unexpected error occured.

WorkOrders

Supported operations

Searching [GET] /api/{Context}/WorkOrders

Retrieving [GET] /api/{Context}/WorkOrders/{id}

Creating [POST] /api/{Context}/WorkOrders

Changing [PATCH] /api/{Context}/WorkOrders/{id}

Deleting [DELETE] /api/{Context}/WorkOrders/{id}

Create From Template [POST] /api/{Context}/Templates/{id}/Instances

A WorkOrder is an 'Independent Object' and a key entity in the system.

A WorkOrder can be classified using Class and support Templates.

A WorkOrder may be created in any Scope .

The read-only Id property is the unique identifier. This identifier is assigned on creation and used in subsequent actions like Retrieve .

A WorkOrder supports Namespace identification.

A WorkOrder is unique across ( wo_number, namespace_id ).

The ObjectType identifier for WorkOrder is 140.

The WorkOrder supports the instance permissions: View, Modify, Approve and Delete in addition to the Type permission that governs its creation.

A WorkOrder supports locking using Lock and Unlock .

You can use WorkOrder as the root [START WITH] type in a Search . A number of properties including: Id, Scope, Namespace, Code, Name, Description etc. are available to the search. To find a full list of searchable properties use SearchableTypes .

Work orders are predefined sequences of connected work tasks designed to standardize work processes involving persons, groups or entire organizations.

Searching WorkOrders

$ curl https://datastorage.dev.aw-au.bentley.com//api/{Context}/WorkOrders/?include=Id,Name,Code,Class.Id&filter=Id=1&startAt=0&pageSize=20
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function searchWorkOrders( host, include= 'Id,Name,Code,Class.Id', filter, order, startAt = 0, pageSize = 10) {
   let requestUrl = host + '/api/0/WorkOrders?include=' + include +'&filter=' + filter +;&order=' + order +'&startAt=' + startAt + '&pageSize=' + pageSize;
   const init = {
      method: 'GET',
      headers: {
         Authorization: 'bearer {token}'
         }
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

[
{
  "classId": 998,
  "code": "sample",
  "id": 998,
  "name": "sample"
},
{
  "classId": 999,
  "code": "sample",
  "id": 999,
  "name": "sample"
}
]

Enables Searching on WorkOrders using the EQL logic.

Use the GET request method to search for WorkOrders that satisfy a set of search criteria.

GET /api/{Context}/WorkOrders

Specify a context (community) to indicate the data source. The default value "0" references the current context.

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server.

  1. Set the "Authorization" parameter to a valid session bearer token.

  2. Use the parameters in the table below to control how the result set displays the returned properties.

The result set contains the selected list of properties for WorkOrders satisfying the provided search criteria. The result set should include the "id" parameter to allow further operations, such as retrieving detailed information related to a WorkOrder of interest.


Try me in EqlExplorer
Try me in Swagger

Search WorkOrder Request Info

Info Description
url http(s)://{server}/api/{context}/WorkOrders
Request GET
Media Type application/json
Response An Array of objects with the selected properties (key-value pairs).

Search WorkOrder Request Parameters

Parameter Default Description
include Id,Name,Code,Class The properties to include in the result.
filter Id>1 The search criteria
order Id How to order the results
startAt 1 The index of the first row to return. (Rows are determined base on order)
pageSize the number of rows to return The max number of row to return
context The session context The context (aka community) whose data are being accessed

Search WorkOrder Responses

Status Description
200, OK When there is at least one record that satisfies the provided filter.
204, No Content When there is no record that satisfies the provided filter.
400, Bad Request When there is an error in the provided parameters (e.g. syntax error in filter).
401, Unauthorized When access is attempted with no authorization header (see #authentication).
500, Internal Server Error An unexpected error occured.

Retrieving WorkOrders

$ curl https://datastorage.dev.aw-au.bentley.com/{Context}/WorkOrders/242?include={RetrieveOptions}
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function retrieveWorkOrders( host, id, retrieveOptions = 'Header') {
   let requestUrl = host + '/api/0/WorkOrders/id/?include=' + retrieveOptions;
   const init = {
      method: 'GET',
      headers: {
         Authorization: 'bearer {token}'
         }
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

/* Sample request for WorkOrder */
{
  "actEndDate": "2020-09-10T12:09:02.3298341+01:00",
  "actStartDate": "2020-09-10T12:09:02.3300179+01:00",
  "addedBy": {
    "id": 999
  },
  "approvalStatus": "sample",
  "changedBy": {
    "id": 999
  },
  "class": {
    "code": "sample",
    "name": "sample",
    "sysType": "sample",
    "isSyncTracked": false,
    "path": "sample",
    "id": 999
  },
  "code": "sample",
  "dateAdded": "2020-09-10T12:09:02.331122+01:00",
  "dateChanged": "2020-09-10T12:09:02.3313167+01:00",
  "description": "sample",
  "duration": 9.999,
  "guid": "00000000-0000-0000-0000-000000000000",
  "hasFlags": 9999,
  "id": 999,
  "isLocked": true,
  "isTemplate": true,
  "lock": {
    "lockType": 999,
    "person": {
      "code": "sample",
      "surname": "sample",
      "initial": "sample",
      "title": "sample",
      "scope": {
        "id": 999
      },
      "isTemplate": true,
      "id": 999
    },
    "transactionName": "sample"
  },
  "name": "sample",
  "namespace": {
    "name": "sample",
    "id": 999
  },
  "nestedIn": {
    "id": 999
  },
  "pendingRequest": "sample",
  "permissionHint": 999,
  "person": {
    "code": "sample",
    "surname": "sample",
    "initial": "sample",
    "firstName": "sample",
    "class": {
      "code": "sample",
      "name": "sample",
      "isSyncTracked": false,
      "id": 999
    },
    "isTemplate": true,
    "id": 999
  },
  "planEndDate": "2020-09-10T12:09:02.3336251+01:00",
  "planStartDate": "2020-09-10T12:09:02.3338482+01:00",
  "priority": {
    "priority": 999,
    "name": "sample",
    "id": 999
  },
  "reworkTask": {
    "id": 999
  },
  "scope": {
    "name": "sample",
    "id": 999
  },
  "status": "sample",
  "warningFlags": 999
}

Retrieves a single WorkOrder instance the properties of which are populated based on the request parameters.

This GET request method can retrieve more detailed information for the WorkOrder identified by its "id". The syntax for this form of the GET request is as follows.

GET /api/{Context}/WorkOrders/{id}

Use the "id" for the WorkOrder to retrieve, and specify a context (community) to narrow the search. The default value "0" references the current context.

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server.

  1. Set the "Authorization" parameter to a valid session bearer token.

  2. Use the "include" parameter to specify the properties returned in the result set. (Defaults to "Header").

The GET method returns the properties specified in the HTTP request header for the document copy identified by "id".


Try me in RetrieveExplorer
Try me in Swagger

Search WorkOrder Request Info

Info Description
url http(s)://{server}/api/{context}/WorkOrders
Request GET
Media Type application/json
Response The WorkOrder with the [name](#retrieve-workorder-properties-per-include-option. properties populated.

Retrieve WorkOrder Request Parameters

Parameter Default Description
Id NULL The Identifier of the object to Retrieve.
include Header Which Properties to include (see ).
context The session context The context (aka community) whose data are being accessed

Retrieve WorkOrder Properties per include option.

Retrieve Option Property Type
Header Id int
Header Scope Scope
Header Namespace Namespace
Header Guid Guid?
Header Code string
Header Name string
Header Description string
Header Class Class
Header ApprovalStatus string
Header Priority WorkOrderPriority
Header Status string
Header Person Person
Header PlanStartDate DateTime?
Header PlanEndDate DateTime?
Header ActStartDate DateTime?
Header ActEndDate DateTime?
Header Duration decimal?
Header PendingRequest string
Header ReworkTask WorkTask
Header HasFlags long?
Header PermissionHint int?
Header WarningFlags int?
Header IsTemplate bool?
Header IsLocked bool?
Header Lock ObjectLock
Attributes Attributes List of Attribute. Supported Filters
[StartAt=value]
[PageSize=value]
[IsLinked=value]
[CompleteMemo=value]
[AttributeDef.Id IN (comma delimited values)]
[AttributeDef.IsIntrinsic=value]
[AttributeDef.DataType IN (comma delimited values)]
[AttributeDef.DataType NOT IN (comma delimited values)]
[AttributeDef.Name=value]
AuditDetails AuditDetails List of AuditDetail
Notes Notes List of Note. Supported Filters
[StartAt=value]
[PageSize=value]
Securities Securities List of Security. Supported Filters
[StartAt=value]
[PageSize=value]
[Permission&=value]
ChangeRequests ChangeRequests List of WorkOrderChangeRequest. Supported Filters
[StartAt=value]
[PageSize=value]
Documents Documents List of WorkOrderDocument. Supported Filters
[StartAt=value]
[PageSize=value]
VirtualItemGroups VirtualItemGroups List of WorkOrderVirtualItemGroup. Supported Filters
[StartAt=value]
[PageSize=value]
GroupedVirtualItems GroupedVirtualItems List of WorkOrderGroupedVirtualItem. Supported Filters
[StartAt=value]
[PageSize=value]
PhysicalItems PhysicalItems List of WorkOrderPhysicalItem. Supported Filters
[StartAt=value]
[PageSize=value]
SerializedItems SerializedItems List of WorkOrderSerializedItem. Supported Filters
[StartAt=value]
[PageSize=value]
Modifications Modifications List of WorkOrderModification. Supported Filters
[StartAt=value]
[PageSize=value]
DistributionOrders DistributionOrders List of WorkOrderDistributionOrder. Supported Filters
[StartAt=value]
[PageSize=value]
Transmittals Transmittals List of WorkOrderTransmittal. Supported Filters
[StartAt=value]
[PageSize=value]
Tags Tags List of WorkOrderTag. Supported Filters
[StartAt=value]
[PageSize=value]
Events Events List of WorkOrderEvent. Supported Filters
[StartAt=value]
[PageSize=value]
WorkTasks WorkTasks List of WorkTask. Supported Filters
[StartAt=value]
[PageSize=value]
Snapshots Snapshots List of ObjectSnapshot. Supported Filters
[StartAt=value]
[PageSize=value]
Header DateAdded DateTime?
Header AddedBy Person
Header DateChanged DateTime?
Header ChangedBy Person
Projects Projects List of ProjectWorkOrder. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
WorkOrders WorkOrders List of WorkOrderWorkOrder. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
CopyOptions CopyOptions List of CopyOption. Supported Filters
[HasData=value]
ContextualReports ContextualReports List of ReportContext. Supported Filters
[StartAt=value]
[PageSize=value]
InheritanceHierarchy InheritanceHierarchy List of OrdinalObject
NestedIn NestedIn WorkTask
Folders Folders List of FolderWorkOrder. Supported Filters
[StartAt=value]
[PageSize=value]

RetrieveWorkOrder Responses

Status Description
200, OK The operation was completed successfully and the response body contains the result.
204, No Content The operation resulted no records (e.g. filter does not produce any result).
400, Bad Request When there is an error in the provided parameters (e.g. syntax error in filter).
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to access this instance.
500, Internal Server Error An unexpected error occured.

Creating WorkOrders

Try me in Swagger

Request Body (JSON)

{
  "code": "string value",
  "name": "string value",
  "class": {
    "id": 999
  },
  "priority": {
    "priority": 999
  },
  "person": {
    "id": 999
  },
  "description": "string value",
  "planStartDate": "2020-05-07T16:25:12Z",
  "planEndDate": "2020-05-07T16:25:12Z",
  "duration": 9.999
}

$ curl -X POST https://datastorage.dev.aw-au.bentley.com/{Context}/WorkOrders
-H "Accept: application/json"
-H "Authorization: Bearer {token}"
-d "see json request body"

// the modelPost structure is described in the Request Json 
async function postWorkOrders( host, modelPost) {
   let requestUrl = host + '/api/0/WorkOrders
   const init = {
      method: 'POST',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = modelPost.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

{
  "id": 999
}

The following methods are available for creating a new instance of WorkOrder.

  1. Calling the API directly providing the required data.

  2. Using a Template

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server. Set the "Authorization" parameter to a valid session bearer token.

Add WorkOrder Request Info

Info Description
url http(s)://{server}/api/{context}/WorkOrders
Request POST
Media Type application/json
Response The Id of the newly created item

Post WorkOrder Contract Info

The POST request for WorkOrder contract has the following properties

Name Type
Code string
Name string
Class IdPost
Priority PriorityRefPost
Person IdPost
Description string
PlanStartDate DateTime?
PlanEndDate DateTime?
Duration decimal

Add WorkOrder Response Statuses

Status Description
201, Created A new instance was created and the result body contains the id of the instance.
400, Bad Request The Server could not create the instance. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to create new objects of this type.
409, Conflict When the provided record already exists.
500, Internal Server Error An unexpected error occured.

Changing WorkOrders

Try me in Swagger

Request Body (JSON)

{
  "code": "string value",
  "name": "string value",
  "class": {
    "id": 999
  },
  "priority": {
    "priority": 999
  },
  "person": {
    "id": 999
  },
  "description": "string value",
  "planStartDate": "2020-05-07T16:25:12Z",
  "planEndDate": "2020-05-07T16:25:12Z",
  "duration": 9.999,
  "id": 999
}

$ curl -X PATCH https://datastorage.dev.aw-au.bentley.com/{Context}/WorkOrders
-H "Accept: application/json"
-H "Authorization: Bearer {token}"
-d "see json request"

// the modelPatch structure is described in the Request Json 
async function patchWorkOrders( host, id, modelPatch) {
   let requestUrl = host + '/api/0/WorkOrders/'+id
   const init = {
      method: 'PATCH',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = modelPatch.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Saves the modification on the WorkOrder instance to the database.

Try me in Swagger

Change WorkOrder Request Info

Info Description
url http(s)://{server}/api/{context}/WorkOrders
Request PATCH
Media Type application/json
Response status

Patch WorkOrder Contract Info

The WorkOrder properties for a PATCH requests are:

Name Type
Code string
Name string
Class IdPatch
Priority PriorityRefPatch
Person IdPatch
Description string
PlanStartDate DateTime?
PlanEndDate DateTime?
Duration decimal
Id int

Patch WorkOrder Responses

Status Description
204, No Content The change was successful.
400, Bad Request The Server could not apply the change. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to Modify this instance or any instance of this type.
409, Conflict When the change request will produce a duplicate entry.
500, Internal Server Error An unexpected error occured.

Deleting WorkOrders

Try me in Swagger

$ curl -X DELETE https://datastorage.dev.aw-au.bentley.com/{Context}/WorkOrders/123
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function DeleteWorkOrders( host, id) {
   let requestUrl = host + '/api/0/WorkOrders/+id+
   const init = {
      method: 'DELETE',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = model.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Deletes the WorkOrder instance from the database.

Delete WorkOrder Request Info

Info Description
url http(s)://{server}/api/{context}/WorkOrders/{id}
Request DELETE
Media Type text/json
Response status

Delete WorkOrder Responses

Status Description
204, No Content The deletion was successful.
400, Bad Request The Server could not delete the instance. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to Delete this instance or any instance of this type.
500, Internal Server Error An unexpected error occured.

Copying WorkOrders

Try me in Swagger

Request Body (JSON)

{
  "code": "string value",
  "toId": 999,
  "batchSize": 999,
  "options": "string value"
}

// the modelCopyPost structure is described in the Request Json 
async function copyWorkOrders( host, id, modelCopyPost) {
   let requestUrl = host + '/api/0/WorkOrders/'+id+'/InstanceCopies'
   const init = {
      method: 'POST',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = modelCopyPost.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

{
  "id": 999
}

Creates a Copy of the Selected WorkOrder Resource

Copy WorkOrder Request Info

Info Description
url http(s)://{server}/api/{context}/WorkOrders/{id}/InstanceCopies
Request POST
Media Type application/json
Response The Id of the newly created item

Copy WorkOrder Responses

Status Description
201, Created A Copy of the object was created. The response body contains the id of the new instance.
400, Bad Request The Server could not create a copy. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to Create or Copy this instance or any instance of this type.
409, Conflict When the copy request will produce a duplicate entry. The response body contains the error info.
500, Internal Server Error An unexpected error occured.

WorkTasks

Supported operations

Searching [GET] /api/{Context}/WorkTasks

Retrieving [GET] /api/{Context}/WorkTasks/{id}

Creating [POST] /api/{Context}/WorkTasks

Changing [PATCH] /api/{Context}/WorkTasks/{id}

Deleting [DELETE] /api/{Context}/WorkTasks/{id}

A WorkTask is a 'Dependent Object' which mean which mean that although it has most of the characteristics of an Object it depends on the existence of an Independent Object. If the 'parent' Object gets deleted it gets deleted too.

A WorkTask can be classified using Class but does not support Templates.

A WorkTask may be created in any Scope .

The read-only Id property is the unique identifier. This identifier is assigned on creation and used in subsequent actions like Retrieve .

A WorkTask is unique across ( wo_id, ws_number ).

The ObjectType identifier for WorkTask is 142.

The WorkTask supports the instance permissions: View, Modify and Delete in addition to the Type permission that governs its creation.

You can use WorkTask as the root [START WITH] type in a Search . A number of properties including: WorkOrder, Scope, Id, Code, Description, Class etc. are available to the search. To find a full list of searchable properties use SearchableTypes .

Work tasks define small portions of work performed within work orders. Task assignments to responsible persons ensure the work is performed within specific timeframes or budgets.

Searching WorkTasks

$ curl https://datastorage.dev.aw-au.bentley.com//api/{Context}/WorkTasks/?include=Id,Code,Class.Id&filter=Id=1&startAt=0&pageSize=20
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function searchWorkTasks( host, include= 'Id,Code,Class.Id', filter, order, startAt = 0, pageSize = 10) {
   let requestUrl = host + '/api/0/WorkTasks?include=' + include +'&filter=' + filter +;&order=' + order +'&startAt=' + startAt + '&pageSize=' + pageSize;
   const init = {
      method: 'GET',
      headers: {
         Authorization: 'bearer {token}'
         }
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

[
{
  "classId": 998,
  "code": "sample",
  "id": 998
},
{
  "classId": 999,
  "code": "sample",
  "id": 999
}
]

Enables Searching on WorkTasks using the EQL logic.

Use the GET request method to search for WorkTasks that satisfy a set of search criteria.

GET /api/{Context}/WorkTasks

Specify a context (community) to indicate the data source. The default value "0" references the current context.

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server.

  1. Set the "Authorization" parameter to a valid session bearer token.

  2. Use the parameters in the table below to control how the result set displays the returned properties.

The result set contains the selected list of properties for WorkTasks satisfying the provided search criteria. The result set should include the "id" parameter to allow further operations, such as retrieving detailed information related to a WorkTask of interest.


Try me in EqlExplorer
Try me in Swagger

Search WorkTask Request Info

Info Description
url http(s)://{server}/api/{context}/WorkTasks
Request GET
Media Type application/json
Response An Array of objects with the selected properties (key-value pairs).

Search WorkTask Request Parameters

Parameter Default Description
include Id,Code,Class The properties to include in the result.
filter Id>1 The search criteria
order Id How to order the results
startAt 1 The index of the first row to return. (Rows are determined base on order)
pageSize the number of rows to return The max number of row to return
context The session context The context (aka community) whose data are being accessed

Search WorkTask Responses

Status Description
200, OK When there is at least one record that satisfies the provided filter.
204, No Content When there is no record that satisfies the provided filter.
400, Bad Request When there is an error in the provided parameters (e.g. syntax error in filter).
401, Unauthorized When access is attempted with no authorization header (see #authentication).
500, Internal Server Error An unexpected error occured.

Retrieving WorkTasks

$ curl https://datastorage.dev.aw-au.bentley.com/{Context}/WorkTasks/242?include={RetrieveOptions}
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function retrieveWorkTasks( host, id, retrieveOptions = 'Header') {
   let requestUrl = host + '/api/0/WorkTasks/id/?include=' + retrieveOptions;
   const init = {
      method: 'GET',
      headers: {
         Authorization: 'bearer {token}'
         }
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

/* Sample request for WorkTask */
{
  "workOrder": {
    "approvalStatus": "sample",
    "class": {
      "code": "sample",
      "name": "sample",
      "isSyncTracked": false,
      "id": 999
    },
    "code": "sample",
    "id": 999,
    "isTemplate": true,
    "name": "sample",
    "reworkTask": {
      "id": 999
    },
    "status": "sample"
  },
  "code": "sample",
  "description": "sample",
  "skill": {
    "name": "sample",
    "id": 999
  },
  "person": {
    "code": "sample",
    "surname": "sample",
    "initial": "sample",
    "firstName": "sample",
    "class": {
      "code": "sample",
      "name": "sample",
      "isSyncTracked": false,
      "id": 999
    },
    "isTemplate": true,
    "id": 999
  },
  "remark": "sample",
  "planStartDate": "2020-09-10T12:09:02.5581796+01:00",
  "planEndDate": "2020-09-10T12:09:02.5579498+01:00",
  "duration": 9.999,
  "flags": 999,
  "class": {
    "code": "sample",
    "name": "sample",
    "sysType": "sample",
    "isSyncTracked": false,
    "path": "sample",
    "id": 999
  },
  "isOptional": true,
  "scope": {
    "name": "sample",
    "id": 999
  },
  "guid": "00000000-0000-0000-0000-000000000000",
  "hasFlags": 9999,
  "permissionHint": 999,
  "status": "sample",
  "actStartDate": "2020-09-10T12:09:02.5553436+01:00",
  "actEndDate": "2020-09-10T12:09:02.5551273+01:00",
  "isDelegate": true,
  "allocationStatus": "sample",
  "delegatedFrom": {
    "id": 999
  },
  "reworkCount": 999,
  "hasNestedWoPending": true,
  "dateAdded": "2020-09-10T12:09:02.5563577+01:00",
  "addedBy": {
    "id": 999
  },
  "dateChanged": "2020-09-10T12:09:02.5564506+01:00",
  "changedBy": {
    "id": 999
  },
  "id": 999
}

Retrieves a single WorkTask instance the properties of which are populated based on the request parameters.

This GET request method can retrieve more detailed information for the WorkTask identified by its "id". The syntax for this form of the GET request is as follows.

GET /api/{Context}/WorkTasks/{id}

Use the "id" for the WorkTask to retrieve, and specify a context (community) to narrow the search. The default value "0" references the current context.

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server.

  1. Set the "Authorization" parameter to a valid session bearer token.

  2. Use the "include" parameter to specify the properties returned in the result set. (Defaults to "Header").

The GET method returns the properties specified in the HTTP request header for the document copy identified by "id".


Try me in RetrieveExplorer
Try me in Swagger

Search WorkTask Request Info

Info Description
url http(s)://{server}/api/{context}/WorkTasks
Request GET
Media Type application/json
Response The WorkTask with the [name](#retrieve-worktask-properties-per-include-option. properties populated.

Retrieve WorkTask Request Parameters

Parameter Default Description
Id NULL The Identifier of the object to Retrieve.
include Header Which Properties to include (see ).
context The session context The context (aka community) whose data are being accessed

Retrieve WorkTask Properties per include option.

Retrieve Option Property Type
WorkOrder WorkOrder WorkOrder
Header Scope Scope
Header Id int
Header Guid Guid?
Header Code string
Header Description string
Header Class Class
Header HasFlags long?
Header PermissionHint int?
Header Remark string
Header Status string
Header Skill Skill
Header Person Person
Header PlanStartDate DateTime?
Header PlanEndDate DateTime?
Header ActStartDate DateTime?
Header ActEndDate DateTime?
Header Duration decimal?
Header IsDelegate bool?
Header IsOptional bool?
Header AllocationStatus string
Header DelegatedFrom WorkTask
Header ReworkCount int?
Header Flags int?
Header IsBeforePlanStartDate bool?
Header IsLate bool?
Header HasNestedWoPending bool?
Attributes Attributes List of Attribute. Supported Filters
[StartAt=value]
[PageSize=value]
[IsLinked=value]
[CompleteMemo=value]
[AttributeDef.Id IN (comma delimited values)]
[AttributeDef.IsIntrinsic=value]
[AttributeDef.DataType IN (comma delimited values)]
[AttributeDef.DataType NOT IN (comma delimited values)]
[AttributeDef.Name=value]
AuditDetails AuditDetails List of AuditDetail
Notes Notes List of Note. Supported Filters
[StartAt=value]
[PageSize=value]
ChangeRequests ChangeRequests List of WorkTaskChangeRequest. Supported Filters
[StartAt=value]
[PageSize=value]
Documents Documents List of WorkTaskDocument. Supported Filters
[StartAt=value]
[PageSize=value]
PhysicalItems PhysicalItems List of WorkTaskPhysicalItem. Supported Filters
[StartAt=value]
[PageSize=value]
SerializedItems SerializedItems List of WorkTaskSerializedItem. Supported Filters
[StartAt=value]
[PageSize=value]
VirtualItemGroups VirtualItemGroups List of WorkTaskVirtualItemGroup. Supported Filters
[StartAt=value]
[PageSize=value]
GroupedVirtualItems GroupedVirtualItems List of WorkTaskGroupedVirtualItem. Supported Filters
[StartAt=value]
[PageSize=value]
Modifications Modifications List of WorkTaskModification. Supported Filters
[StartAt=value]
[PageSize=value]
Events Events List of WorkTaskEvent. Supported Filters
[StartAt=value]
[PageSize=value]
Tags Tags List of WorkTaskTag. Supported Filters
[StartAt=value]
[PageSize=value]
Transmittals Transmittals List of WorkTaskTransmittal. Supported Filters
[StartAt=value]
[PageSize=value]
DistributionOrders DistributionOrders List of WorkTaskDistributionOrder. Supported Filters
[StartAt=value]
[PageSize=value]
MergeFrom MergeFrom List of ConditionalWorkTask. Supported Filters
[StartAt=value]
[PageSize=value]
SplitTo SplitTo List of ConditionalWorkTask. Supported Filters
[StartAt=value]
[PageSize=value]
StructureRules StructureRules List of WorkTaskStructureRule. Supported Filters
[StartAt=value]
[PageSize=value]
NestedWorkOrders NestedWorkOrders List of NestedWorkOrder. Supported Filters
[StartAt=value]
[PageSize=value]
NestedWorkOrderTemplates NestedWorkOrderTemplates List of NestedWorkOrderTemplate. Supported Filters
[StartAt=value]
[PageSize=value]
Snapshots Snapshots List of ObjectSnapshot. Supported Filters
[StartAt=value]
[PageSize=value]
Header DateAdded DateTime?
Header AddedBy Person
Header DateChanged DateTime?
Header ChangedBy Person
Automations Automations List of ObjectAutomation
DelegatedWorkTasks DelegatedWorkTasks List of WorkTask. Supported Filters
[StartAt=value]
[PageSize=value]
ContextualReports ContextualReports List of ReportContext. Supported Filters
[StartAt=value]
[PageSize=value]
InheritanceHierarchy InheritanceHierarchy List of OrdinalObject
ConditionalWorkTasks ConditionalWorkTasks List of ConditionalWorkTask. Supported Filters
[StartAt=value]
[PageSize=value]
Folders Folders List of FolderWorkTask. Supported Filters
[StartAt=value]
[PageSize=value]

RetrieveWorkTask Responses

Status Description
200, OK The operation was completed successfully and the response body contains the result.
204, No Content The operation resulted no records (e.g. filter does not produce any result).
400, Bad Request When there is an error in the provided parameters (e.g. syntax error in filter).
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to access this instance.
500, Internal Server Error An unexpected error occured.

Creating WorkTasks

Try me in Swagger

Request Body (JSON)

{
  "workOrder": {
    "id": 999
  },
  "code": "string value",
  "description": "string value",
  "skill": {
    "id": 999
  },
  "person": {
    "id": 999
  },
  "remark": "string value",
  "planStartDate": "2020-05-07T16:25:12Z",
  "planEndDate": "2020-05-07T16:25:12Z",
  "duration": 9.999,
  "flags": 999,
  "class": {
    "id": 999
  },
  "isOptional": true
}

$ curl -X POST https://datastorage.dev.aw-au.bentley.com/{Context}/WorkTasks
-H "Accept: application/json"
-H "Authorization: Bearer {token}"
-d "see json request body"

// the modelPost structure is described in the Request Json 
async function postWorkTasks( host, modelPost) {
   let requestUrl = host + '/api/0/WorkTasks
   const init = {
      method: 'POST',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = modelPost.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

{
  "id": 999
}

The following methods are available for creating a new instance of WorkTask.

  1. Calling the API directly providing the required data.

  2. Using a Template

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server. Set the "Authorization" parameter to a valid session bearer token.

Add WorkTask Request Info

Info Description
url http(s)://{server}/api/{context}/WorkTasks
Request POST
Media Type application/json
Response The Id of the newly created item

Post WorkTask Contract Info

The POST request for WorkTask contract has the following properties

Name Type
WorkOrder IdPost
Code string
Description string
Skill IdPost
Person IdPost
Remark string
PlanStartDate DateTime?
PlanEndDate DateTime?
Duration decimal
Flags int
Class IdPost
IsOptional bool

Add WorkTask Response Statuses

Status Description
201, Created A new instance was created and the result body contains the id of the instance.
400, Bad Request The Server could not create the instance. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to create new objects of this type.
409, Conflict When the provided record already exists.
500, Internal Server Error An unexpected error occured.

Changing WorkTasks

Try me in Swagger

Request Body (JSON)

{
  "code": "string value",
  "description": "string value",
  "skill": {
    "id": 999
  },
  "person": {
    "id": 999
  },
  "remark": "string value",
  "planStartDate": "2020-05-07T16:25:12Z",
  "planEndDate": "2020-05-07T16:25:12Z",
  "duration": 9.999,
  "flags": 999,
  "class": {
    "id": 999
  },
  "isOptional": true,
  "id": 999
}

$ curl -X PATCH https://datastorage.dev.aw-au.bentley.com/{Context}/WorkTasks
-H "Accept: application/json"
-H "Authorization: Bearer {token}"
-d "see json request"

// the modelPatch structure is described in the Request Json 
async function patchWorkTasks( host, id, modelPatch) {
   let requestUrl = host + '/api/0/WorkTasks/'+id
   const init = {
      method: 'PATCH',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = modelPatch.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Saves the modification on the WorkTask instance to the database.

Try me in Swagger

Change WorkTask Request Info

Info Description
url http(s)://{server}/api/{context}/WorkTasks
Request PATCH
Media Type application/json
Response status

Patch WorkTask Contract Info

The WorkTask properties for a PATCH requests are:

Name Type
Code string
Description string
Skill IdPatch
Person IdPatch
Remark string
PlanStartDate DateTime?
PlanEndDate DateTime?
Duration decimal
Flags int
Class IdPatch
IsOptional bool
Id int

Patch WorkTask Responses

Status Description
204, No Content The change was successful.
400, Bad Request The Server could not apply the change. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to Modify this instance or any instance of this type.
409, Conflict When the change request will produce a duplicate entry.
500, Internal Server Error An unexpected error occured.

Deleting WorkTasks

Try me in Swagger

$ curl -X DELETE https://datastorage.dev.aw-au.bentley.com/{Context}/WorkTasks/123
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function DeleteWorkTasks( host, id) {
   let requestUrl = host + '/api/0/WorkTasks/+id+
   const init = {
      method: 'DELETE',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = model.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Deletes the WorkTask instance from the database.

Delete WorkTask Request Info

Info Description
url http(s)://{server}/api/{context}/WorkTasks/{id}
Request DELETE
Media Type text/json
Response status

Delete WorkTask Responses

Status Description
204, No Content The deletion was successful.
400, Bad Request The Server could not delete the instance. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to Delete this instance or any instance of this type.
500, Internal Server Error An unexpected error occured.

DocumentCopies

Supported operations

Searching [GET] /api/{Context}/DocumentCopies

Retrieving [GET] /api/{Context}/DocumentCopies/{id}

Creating [POST] /api/{Context}/DocumentCopies

Changing [PATCH] /api/{Context}/DocumentCopies/{id}

Deleting [DELETE] /api/{Context}/DocumentCopies/{id}

Create From Template [POST] /api/{Context}/Templates/{id}/Instances

A DocumentCopy is a 'Dependent Object' which mean which mean that although it has most of the characteristics of an Object it depends on the existence of an Independent Object. If the 'parent' Object gets deleted it gets deleted too.

A DocumentCopy may be created in any Scope .

The read-only Id property is the unique identifier. This identifier is assigned on creation and used in subsequent actions like Retrieve .

A DocumentCopy is unique across ( copy_id ).

The ObjectType identifier for DocumentCopy is 36.

The DocumentCopy supports the instance permissions: View, Modify and Delete in addition to the Type permission that governs its creation.

You can use DocumentCopy as the root [START WITH] type in a Search . A number of properties including: Document, Scope, Id, Code, CopyType, Purpose etc. are available to the search. To find a full list of searchable properties use SearchableTypes .

Document copies represent actual document instances in specific media or locations.

Searching DocumentCopies

$ curl https://datastorage.dev.aw-au.bentley.com//api/{Context}/DocumentCopies/?include=Id,Code&filter=Id=1&startAt=0&pageSize=20
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function searchDocumentCopies( host, include= 'Id,Code', filter, order, startAt = 0, pageSize = 10) {
   let requestUrl = host + '/api/0/DocumentCopies?include=' + include +'&filter=' + filter +;&order=' + order +'&startAt=' + startAt + '&pageSize=' + pageSize;
   const init = {
      method: 'GET',
      headers: {
         Authorization: 'bearer {token}'
         }
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

[
{
  "code": "sample",
  "id": 998
},
{
  "code": "sample",
  "id": 999
}
]

Enables Searching on DocumentCopies using the EQL logic.

Use the GET request method to search for DocumentCopies that satisfy a set of search criteria.

GET /api/{Context}/DocumentCopies

Specify a context (community) to indicate the data source. The default value "0" references the current context.

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server.

  1. Set the "Authorization" parameter to a valid session bearer token.

  2. Use the parameters in the table below to control how the result set displays the returned properties.

The result set contains the selected list of properties for DocumentCopies satisfying the provided search criteria. The result set should include the "id" parameter to allow further operations, such as retrieving detailed information related to a DocumentCopy of interest.


Try me in EqlExplorer
Try me in Swagger

Search DocumentCopy Request Info

Info Description
url http(s)://{server}/api/{context}/DocumentCopies
Request GET
Media Type application/json
Response An Array of objects with the selected properties (key-value pairs).

Search DocumentCopy Request Parameters

Parameter Default Description
include Id,Code The properties to include in the result.
filter Id>1 The search criteria
order Id How to order the results
startAt 1 The index of the first row to return. (Rows are determined base on order)
pageSize the number of rows to return The max number of row to return
context The session context The context (aka community) whose data are being accessed

Search DocumentCopy Responses

Status Description
200, OK When there is at least one record that satisfies the provided filter.
204, No Content When there is no record that satisfies the provided filter.
400, Bad Request When there is an error in the provided parameters (e.g. syntax error in filter).
401, Unauthorized When access is attempted with no authorization header (see #authentication).
500, Internal Server Error An unexpected error occured.

Retrieving DocumentCopies

$ curl https://datastorage.dev.aw-au.bentley.com/{Context}/DocumentCopies/242?include={RetrieveOptions}
-H "Accept: application/json"
-H "Authorization: Bearer {token}"

async function retrieveDocumentCopies( host, id, retrieveOptions = 'Header') {
   let requestUrl = host + '/api/0/DocumentCopies/id/?include=' + retrieveOptions;
   const init = {
      method: 'GET',
      headers: {
         Authorization: 'bearer {token}'
         }
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

/* Sample request for DocumentCopy */
{
  "document": {
    "class": {
      "code": "sample",
      "name": "sample",
      "isSyncTracked": false,
      "id": 999
    },
    "code": "sample",
    "id": 999,
    "isTemplate": true,
    "middle": "sample",
    "name": "sample",
    "revision": "sample"
  },
  "code": "sample",
  "copyType": "sample",
  "location": {
    "class": {
      "code": "sample",
      "name": "sample",
      "isSyncTracked": false,
      "id": 999
    },
    "code": "sample",
    "id": 999,
    "isTemplate": true,
    "name": "sample"
  },
  "repositoryGroup": {
    "name": "sample",
    "id": 999
  },
  "purpose": 999,
  "mediaType": {
    "name": "sample",
    "sysType": "sample",
    "id": 999
  },
  "status": "sample",
  "remark": "sample",
  "scope": {
    "name": "sample",
    "id": 999
  },
  "guid": "00000000-0000-0000-0000-000000000000",
  "copyOf": {
    "id": 999
  },
  "isOnBackorder": true,
  "hasFlags": 9999,
  "permissionHint": 999,
  "isTemplate": true,
  "dateAdded": "2020-09-10T12:09:02.7190407+01:00",
  "addedBy": {
    "id": 999
  },
  "dateChanged": "2020-09-10T12:09:02.7192049+01:00",
  "changedBy": {
    "id": 999
  },
  "id": 999
}

Retrieves a single DocumentCopy instance the properties of which are populated based on the request parameters.

This GET request method can retrieve more detailed information for the DocumentCopy identified by its "id". The syntax for this form of the GET request is as follows.

GET /api/{Context}/DocumentCopies/{id}

Use the "id" for the DocumentCopy to retrieve, and specify a context (community) to narrow the search. The default value "0" references the current context.

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server.

  1. Set the "Authorization" parameter to a valid session bearer token.

  2. Use the "include" parameter to specify the properties returned in the result set. (Defaults to "Header").

The GET method returns the properties specified in the HTTP request header for the document copy identified by "id".


Try me in RetrieveExplorer
Try me in Swagger

Search DocumentCopy Request Info

Info Description
url http(s)://{server}/api/{context}/DocumentCopies
Request GET
Media Type application/json
Response The DocumentCopy with the [name](#retrieve-documentcopy-properties-per-include-option. properties populated.

Retrieve DocumentCopy Request Parameters

Parameter Default Description
Id NULL The Identifier of the object to Retrieve.
include Header Which Properties to include (see ).
context The session context The context (aka community) whose data are being accessed

Retrieve DocumentCopy Properties per include option.

Retrieve Option Property Type
Document Document Document
Header Scope Scope
Header Id int
Header Guid Guid?
Header Code string
Header CopyType string
Header Purpose int?
Header Remark string
Header MediaType MediaType
Header Status string
Header CopyOf DocumentCopy
Header Location Location
Header RepositoryGroup RepositoryGroup
Header IsOnBackorder bool?
Header HasFlags long?
Header PermissionHint int?
Header IsTemplate bool?
AuditDetails AuditDetails List of AuditDetail
Securities Securities List of Security. Supported Filters
[StartAt=value]
[PageSize=value]
[Permission&=value]
Files Files List of DocumentCopyFile. Supported Filters
[StartAt=value]
[PageSize=value]
[IsHistoric=value]
Header DateAdded DateTime?
Header AddedBy Person
Header DateChanged DateTime?
Header ChangedBy Person
CopyOptions CopyOptions List of CopyOption. Supported Filters
[HasData=value]
Holders Holders List of DistributionItem. Supported Filters
[StartAt=value]
[PageSize=value]
DispositionItems DispositionItems List of DispositionItem. Supported Filters
[StartAt=value]
[PageSize=value]

RetrieveDocumentCopy Responses

Status Description
200, OK The operation was completed successfully and the response body contains the result.
204, No Content The operation resulted no records (e.g. filter does not produce any result).
400, Bad Request When there is an error in the provided parameters (e.g. syntax error in filter).
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to access this instance.
500, Internal Server Error An unexpected error occured.

Creating DocumentCopies

Try me in Swagger

Request Body (JSON)

{
  "document": {
    "id": 999
  },
  "code": "string value",
  "copyType": "string value",
  "location": {
    "id": 999
  },
  "repositoryGroup": {
    "id": 999
  },
  "purpose": 999,
  "mediaType": {
    "id": 999
  },
  "status": "string value",
  "remark": "string value"
}

$ curl -X POST https://datastorage.dev.aw-au.bentley.com/{Context}/DocumentCopies
-H "Accept: application/json"
-H "Authorization: Bearer {token}"
-d "see json request body"

// the modelPost structure is described in the Request Json 
async function postDocumentCopies( host, modelPost) {
   let requestUrl = host + '/api/0/DocumentCopies
   const init = {
      method: 'POST',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = modelPost.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Response Body (JSON)

{
  "id": 999
}

The following methods are available for creating a new instance of DocumentCopy.

  1. Calling the API directly providing the required data.

  2. Using a Template

Before invoking the method, set up the HTTP request header as follows to pass the required parameters to the HTTP server. Set the "Authorization" parameter to a valid session bearer token.

Add DocumentCopy Request Info

Info Description
url http(s)://{server}/api/{context}/DocumentCopies
Request POST
Media Type application/json
Response The Id of the newly created item

Post DocumentCopy Contract Info

The POST request for DocumentCopy contract has the following properties

Name Type
Document IdPost
Code string
CopyType string
Location IdPost
RepositoryGroup IdPost
Purpose int
MediaType IdPost
Status string
Remark string

Add DocumentCopy Response Statuses

Status Description
201, Created A new instance was created and the result body contains the id of the instance.
400, Bad Request The Server could not create the instance. The response body contains the error info.
401, Unauthorized When access is attempted with no authorization header (see #authentication).
403, Forbidden When the user has no permissions to create new objects of this type.
409, Conflict When the provided record already exists.
500, Internal Server Error An unexpected error occured.

Changing DocumentCopies

Try me in Swagger

Request Body (JSON)

{
  "code": "string value",
  "copyType": "string value",
  "location": {
    "id": 999
  },
  "repositoryGroup": {
    "id": 999
  },
  "purpose": 999,
  "mediaType": {
    "id": 999
  },
  "status": "string value",
  "remark": "string value",
  "id": 999
}

$ curl -X PATCH https://datastorage.dev.aw-au.bentley.com/{Context}/DocumentCopies
-H "Accept: application/json"
-H "Authorization: Bearer {token}"
-d "see json request"

// the modelPatch structure is described in the Request Json 
async function patchDocumentCopies( host, id, modelPatch) {
   let requestUrl = host + '/api/0/DocumentCopies/'+id
   const init = {
      method: 'PATCH',
      headers: {
         Authorization: 'bearer {token}'
         },
      body = modelPatch.json()
      }
   return (await fetch(requestUrl, init)).json();
}

Saves the modification on the DocumentCopy instance to the database.

Try me in Swagger

Change DocumentCopy Request Info

Info Description
url http(s)://{server}/api/{context}/DocumentCopies
Request PATCH
Media Type application/json
Response status

Patch DocumentCopy Contract Info

The DocumentCopy properties for a PATCH requests are:

Name Type
Code string
CopyType string
Locat