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
Location IdPatch
RepositoryGroup IdPatch
Purpose int
MediaType IdPatch
Status string
Remark string
Id int

Patch DocumentCopy 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 DocumentCopies

Try me in Swagger

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

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

Deletes the DocumentCopy instance from the database.

Delete DocumentCopy Request Info

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

Delete DocumentCopy 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 DocumentCopies

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 copyDocumentCopies( host, id, modelCopyPost) {
   let requestUrl = host + '/api/0/DocumentCopies/'+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 DocumentCopy Resource

Copy DocumentCopy Request Info

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

Copy DocumentCopy 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.

VirtualItemGroups

Supported operations

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

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

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

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

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

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

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

A VirtualItemGroup must be classified using Class and support Templates.

A VirtualItemGroup 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 VirtualItemGroup supports Namespace identification.

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

The ObjectType identifier for VirtualItemGroup is 182.

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

A VirtualItemGroup supports locking using Lock and Unlock .

You can use VirtualItemGroup 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 .

Searching VirtualItemGroups

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

async function searchVirtualItemGroups( host, include= 'Id,Name,Code,Class.Id', filter, order, startAt = 0, pageSize = 10) {
   let requestUrl = host + '/api/0/VirtualItemGroups?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 VirtualItemGroups using the EQL logic.

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

GET /api/{Context}/VirtualItemGroups

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 VirtualItemGroups 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 VirtualItemGroup of interest.


Try me in EqlExplorer
Try me in Swagger

Search VirtualItemGroup Request Info

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

Search VirtualItemGroup 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 VirtualItemGroup 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 VirtualItemGroups

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

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

Response Body (JSON)

/* Sample request for VirtualItemGroup */
{
  "code": "sample",
  "middle": "sample",
  "revision": "sample",
  "class": {
    "code": "sample",
    "name": "sample",
    "sysType": "sample",
    "isSyncTracked": false,
    "path": "sample",
    "id": 999
  },
  "name": "sample",
  "changeControlled": true,
  "approvalStatus": "sample",
  "remark": "sample",
  "synopsis": "sample",
  "dateEffective": "2020-09-10T12:09:02.9080044+01:00",
  "dateObsolete": "2020-09-10T12:09:02.9080921+01:00",
  "scope": {
    "name": "sample",
    "id": 999
  },
  "guid": "00000000-0000-0000-0000-000000000000",
  "state": "sample",
  "hasFlags": 9999,
  "permissionHint": 999,
  "warningFlags": 999,
  "isUnderChange": true,
  "isCheckedOut": true,
  "isLatestRevision": true,
  "isLatestApprovedRevision": true,
  "isSuperseded": true,
  "hasPendingChange": true,
  "isTemplate": true,
  "isPrototype": true,
  "prototypeRef": {
    "status": "sample",
    "baseObject": {
      "id": 999
    },
    "control": {
      "type": 999,
      "id": 999
    },
    "id": 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:02.9078098+01:00",
  "addedBy": {
    "id": 999
  },
  "dateChanged": "2020-09-10T12:09:02.9079141+01:00",
  "changedBy": {
    "id": 999
  },
  "fileContainer": {
    "document": {
      "id": 999
    }
  },
  "id": 999
}

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

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

GET /api/{Context}/VirtualItemGroups/{id}

Use the "id" for the VirtualItemGroup 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 VirtualItemGroup Request Info

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

Retrieve VirtualItemGroup 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 VirtualItemGroup 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 Name string
Header Class Class
Header ApprovalStatus string
Header State string
Header DateEffective DateTime?
Header DateObsolete DateTime?
Header HasFlags long?
Header PermissionHint int?
Header WarningFlags int?
Header ChangeControlled bool?
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 PrototypeRef Prototype
Header Prototypes List of Prototype. Supported Filters
[StartAt=value]
[PageSize=value]
Header Remark string
Header Synopsis string
Header OwnerProject Project
Header IsLocked bool?
Header Lock ObjectLock
Attributes Attributes List of Attribute. Supported Filters
[StartAt=value]
[PageSize=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]
Responsibilities Responsibilities List of Responsibility. Supported Filters
[StartAt=value]
[PageSize=value]
[ResponsibilityType.Id IN (comma delimited values)]
Header Keywords List of ObjectKeyword
Header Notes List of Note
Header CrossReferences List of CrossReference
Members Members List of GroupedVirtualItem. 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
ChangeRequests ChangeRequests List of ChangeRequestVirtualItemGroup. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Documents Documents List of DocumentVirtualItemGroup. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Events Events List of EventVirtualItemGroup. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
GroupedVirtualItems GroupedVirtualItems List of GroupedVirtualItemVirtualItemGroup. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Locations Locations List of LocationVirtualItemGroup. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Organizations Organizations List of OrganizationVirtualItemGroup. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Persons Persons List of PersonVirtualItemGroup. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
PhysicalItems PhysicalItems List of PhysicalItemVirtualItemGroup. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Projects Projects List of ProjectVirtualItemGroup. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
SerializedItems SerializedItems List of SerializedItemVirtualItemGroup. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
SharePointItems SharePointItems List of SharePointItemVirtualItemGroup. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
Tags Tags List of TagVirtualItemGroup. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
VirtualItemGroups VirtualItemGroups List of VirtualItemGroupVirtualItemGroup. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
ProjectWiseItems ProjectWiseItems List of ProjectWiseItemVirtualItemGroup. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
ExternalObjects ExternalObjects List of ExternalObjectVirtualItemGroup. Supported Filters
[StartAt=value]
[PageSize=value]
[MaxInnerRows=value]
[RelationshipType.Id IN (comma delimited values)]
CopyOptions CopyOptions List of CopyOption. Supported Filters
[HasData=value]
AffectedChangeRequests AffectedChangeRequests List of AffectedVirtualItemGroup. Supported Filters
[StartAt=value]
[PageSize=value]
WorkOrders WorkOrders List of WorkOrderVirtualItemGroup. Supported Filters
[StartAt=value]
[PageSize=value]
WorkTasks WorkTasks List of WorkTaskVirtualItemGroup. 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
Folders Folders List of FolderVirtualItemGroup. Supported Filters
[StartAt=value]
[PageSize=value]
RevisionHistory RevisionHistory List of VirtualItemGroup
Tasks Tasks List of TaskVirtualItemGroup. Supported Filters
[StartAt=value]
[PageSize=value]

RetrieveVirtualItemGroup 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 VirtualItemGroups

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}/VirtualItemGroups
-H "Accept: application/json"
-H "Authorization: Bearer {token}"
-d "see json request body"

// the modelPost structure is described in the Request Json 
async function postVirtualItemGroups( host, modelPost) {
   let requestUrl = host + '/api/0/VirtualItemGroups
   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 VirtualItemGroup.

  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 VirtualItemGroup Request Info

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

Post VirtualItemGroup Contract Info

The POST request for VirtualItemGroup 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 VirtualItemGroup 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 VirtualItemGroups

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}/VirtualItemGroups
-H "Accept: application/json"
-H "Authorization: Bearer {token}"
-d "see json request"

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

Saves the modification on the VirtualItemGroup instance to the database.

Try me in Swagger

Change VirtualItemGroup Request Info

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

Patch VirtualItemGroup Contract Info

The VirtualItemGroup 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 VirtualItemGroup 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 VirtualItemGroups

Try me in Swagger

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

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

Deletes the VirtualItemGroup instance from the database.

Delete VirtualItemGroup Request Info

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

Delete VirtualItemGroup 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 VirtualItemGroups

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 copyVirtualItemGroups( host, id, modelCopyPost) {
   let requestUrl = host + '/api/0/VirtualItemGroups/'+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 VirtualItemGroup Resource

Copy VirtualItemGroup Request Info

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

Copy VirtualItemGroup 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.

VirtualItems

Supported operations

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

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

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

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

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

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

A VirtualItem can be classified using Class but does not support Templates.

A VirtualItem 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 VirtualItem is unique across ( vitem_code ).

The ObjectType identifier for VirtualItem is 2.

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

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

Searching VirtualItems

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

async function searchVirtualItems( host, include= 'Id,Code,Class.Id', filter, order, startAt = 0, pageSize = 10) {
   let requestUrl = host + '/api/0/VirtualItems?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 VirtualItems using the EQL logic.

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

GET /api/{Context}/VirtualItems

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 VirtualItems 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 VirtualItem of interest.


Try me in EqlExplorer
Try me in Swagger

Search VirtualItem Request Info

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

Search VirtualItem 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 VirtualItem 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 VirtualItems

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

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

Response Body (JSON)

/* Sample request for VirtualItem */
{
  "code": "sample",
  "description": "sample",
  "class": {
    "code": "sample",
    "name": "sample",
    "isSyncTracked": false,
    "path": "sample",
    "id": 999
  },
  "scope": {
    "name": "sample",
    "id": 999
  },
  "guid": "00000000-0000-0000-0000-000000000000",
  "hasFlags": 9999,
  "permissionHint": 999,
  "dateAdded": "2020-09-10T12:09:03.0805254+01:00",
  "addedBy": {
    "id": 999
  },
  "dateChanged": "2020-09-10T12:09:03.0806234+01:00",
  "changedBy": {
    "id": 999
  },
  "id": 999
}

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

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

GET /api/{Context}/VirtualItems/{id}

Use the "id" for the VirtualItem 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 VirtualItem Request Info

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

Retrieve VirtualItem 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 VirtualItem 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 HasFlags long?
Header PermissionHint int?
AuditDetails AuditDetails List of AuditDetail
Header IsUsed bool?
Header DateAdded DateTime?
Header AddedBy Person
Header DateChanged DateTime?
Header ChangedBy Person
VirtualItemGroups VirtualItemGroups List of VirtualItemGroup. 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 FolderVirtualItem. Supported Filters
[StartAt=value]
[PageSize=value]

RetrieveVirtualItem 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 VirtualItems

Try me in Swagger

Request Body (JSON)

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

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

// the modelPost structure is described in the Request Json 
async function postVirtualItems( host, modelPost) {
   let requestUrl = host + '/api/0/VirtualItems
   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 VirtualItem.

  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 VirtualItem Request Info

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

Post VirtualItem Contract Info

The POST request for VirtualItem contract has the following properties

Name Type
Code string
Description string
Class IdPost

Add VirtualItem 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 VirtualItems

Try me in Swagger

Request Body (JSON)

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

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

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

Saves the modification on the VirtualItem instance to the database.

Try me in Swagger

Change VirtualItem Request Info

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

Patch VirtualItem Contract Info

The VirtualItem properties for a PATCH requests are:

Name Type
Code string
Description string
Class IdPatch
Id int

Patch VirtualItem 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 VirtualItems

Try me in Swagger

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

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

Deletes the VirtualItem instance from the database.

Delete VirtualItem Request Info

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

Delete VirtualItem 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.

Schema Authoring

AttributeDefs

Supported operations

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

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

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

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

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

An AttributeDef 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.

An AttributeDef 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 AttributeDef supports Namespace identification.

An AttributeDef is unique across ( char_name, object_type, namespace_id ).

The ObjectType identifier for AttributeDef is 181.

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

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

Searching AttributeDefs

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

async function searchAttributeDefs( host, include= 'Id,Name', filter, order, startAt = 0, pageSize = 10) {
   let requestUrl = host + '/api/0/AttributeDefs?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 AttributeDefs using the EQL logic.

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

GET /api/{Context}/AttributeDefs

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 AttributeDefs 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 AttributeDef of interest.


Try me in EqlExplorer
Try me in Swagger

Search AttributeDef Request Info

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

Search AttributeDef 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 AttributeDef 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 AttributeDefs

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

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

Response Body (JSON)

/* Sample request for AttributeDef */
{
  "addedBy": {
    "id": 999
  },
  "attributeUnit": {
    "highValue": 9.999,
    "id": 999,
    "kindOfQuantity": {
      "code": "sample",
      "description": "sample",
      "id": 999,
      "name": "sample"
    },
    "lowValue": 9.999,
    "object": {
      "type": 999,
      "label": "sample",
      "id": 999
    },
    "unit": {
      "code": "sample",
      "name": "sample",
      "description": "sample",
      "symbol": "sample",
      "conversionFactor": 9.999,
      "conversionOffSet": 9.999,
      "converter": 999,
      "id": 999
    },
    "varianceValue": 9.999
  },
  "baseUnit": "sample",
  "changedBy": {
    "id": 999
  },
  "dataSource": "sample",
  "dataType": "sample",
  "dataTypeConstraints": 999,
  "dateAdded": "2020-09-10T12:09:11.86688+01:00",
  "dateChanged": "2020-09-10T12:09:11.8669766+01:00",
  "editCommand": {
    "contentData": "sample",
    "id": 999
  },
  "editQuery": "sample",
  "guid": "00000000-0000-0000-0000-000000000000",
  "hasLookup": true,
  "hasValueDescription": true,
  "id": 999,
  "isChangeControlled": true,
  "isIntrinsic": true,
  "isMandatory": true,
  "isMultiValued": true,
  "length": 999,
  "mask": "sample",
  "name": "sample",
  "namespace": {
    "name": "sample",
    "id": 999
  },
  "objectType": 999,
  "permMask": 999,
  "scale": 999,
  "scope": {
    "name": "sample",
    "id": 999
  },
  "searchCommand": {
    "contentData": "sample",
    "id": 999
  },
  "searchQuery": "sample",
  "stateMachine": {
    "name": "sample",
    "scope": {
      "name": "sample",
      "id": 999
    },
    "id": 999
  }
}

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

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

GET /api/{Context}/AttributeDefs/{id}

Use the "id" for the AttributeDef 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 AttributeDef Request Info

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

Retrieve AttributeDef 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 AttributeDef Properties per include option.

Retrieve Option Property Type
Header Id int
Header Scope Scope
Header Namespace Namespace
Header Guid Guid?
Header Name string
Header DataType string
Header Length int?
Header Scale int?
Header BaseUnit string
Header ObjectType int
Header IsMultiValued bool
Header Mask string
Header HasLookup bool
Header DataSource string
Header EditQuery string
Header SearchQuery string
Header IsChangeControlled bool
Header IsMandatory bool
Header HasValueDescription bool?
AttributeValueList AttributeValueList List of AttributeValueList. Supported Filters
[StartAt=value]
[PageSize=value]
[Parent.Value=value]
[Parent.AttributeDef.Id=value]
TableColumnDefs TableColumnDefs List of AttributeTableColumnDef
Header IsIntrinsic bool
Header DateAdded DateTime?
Header AddedBy Person
Header DateChanged DateTime?
Header ChangedBy Person
AuditDetails AuditDetails List of AuditDetail
MetaData MetaData List of EntityMetadata. Supported Filters
[StartAt=value]
[PageSize=value]
Header AttributeUnit AttributeUnit
Header StateMachine StateMachine
AttributeDomainSources AttributeDomainSources List of AttributeDomainSource. Supported Filters
[StartAt=value]
[PageSize=value]
[SourceObjectType IN (comma delimited values)]
Header PermMask int?
Header EditCommand ObjectDataset
Header SearchCommand ObjectDataset
MemberOf MemberOf List of AttributeGroupMember
Header Classes List of ClassAttribute
Header AttributeUnits List of AttributeUnit
Dependencies Dependencies List of AttributeDependency. Supported Filters
[StartAt=value]
[PageSize=value]
Header DataTypeConstraints int?

RetrieveAttributeDef 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 AttributeDefs

Try me in Swagger

Request Body (JSON)

{
  "objectType": 999,
  "name": "string value",
  "dataType": "string value",
  "length": 999,
  "scale": 999,
  "baseUnit": "string value",
  "isChangeControlled": true,
  "isMandatory": true,
  "isMultiValued": true,
  "mask": "string value",
  "hasLookup": true,
  "dataSource": "string value",
  "editQuery": "string value",
  "searchQuery": "string value",
  "hasValueDescription": true,
  "stateMachine": {
    "id": 999
  },
  "dataTypeConstraints": 999,
  "permMask": 999
}

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

// the modelPost structure is described in the Request Json 
async function postAttributeDefs( host, modelPost) {
   let requestUrl = host + '/api/0/AttributeDefs
   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 AttributeDef.

  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 AttributeDef Request Info

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

Post AttributeDef Contract Info

The POST request for AttributeDef contract has the following properties

Name Type
ObjectType int
Name string
DataType string
Length int
Scale int
BaseUnit string
IsChangeControlled bool
IsMandatory bool
IsMultiValued bool
Mask string
HasLookup bool
DataSource string
EditQuery string
SearchQuery string
HasValueDescription bool
StateMachine IdPost
DataTypeConstraints int
PermMask int

Add AttributeDef 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 AttributeDefs

Try me in Swagger

Request Body (JSON)

{
  "name": "string value",
  "dataType": "string value",
  "length": 999,
  "scale": 999,
  "baseUnit": "string value",
  "isChangeControlled": true,
  "isMandatory": true,
  "isMultiValued": true,
  "mask": "string value",
  "hasLookup": true,
  "dataSource": "string value",
  "editQuery": "string value",
  "searchQuery": "string value",
  "hasValueDescription": true,
  "stateMachine": {
    "id": 999
  },
  "dataTypeConstraints": 999,
  "permMask": 999,
  "id": 999
}

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

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

Saves the modification on the AttributeDef instance to the database.

Try me in Swagger

Change AttributeDef Request Info

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

Patch AttributeDef Contract Info

The AttributeDef properties for a PATCH requests are:

Name Type
Name string
DataType string
Length int
Scale int
BaseUnit string
IsChangeControlled bool
IsMandatory bool
IsMultiValued bool
Mask string
HasLookup bool
DataSource string
EditQuery string
SearchQuery string
HasValueDescription bool
StateMachine IdPatch
DataTypeConstraints int
PermMask int
Id int

Patch AttributeDef 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 AttributeDefs

Try me in Swagger

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

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

Deletes the AttributeDef instance from the database.

Delete AttributeDef Request Info

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

Delete AttributeDef 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.

AttributeGroups

Supported operations

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

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

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

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

An AttributeGroup 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.

An AttributeGroup 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.

An AttributeGroup is unique across ( name, class_id ).

The ObjectType identifier for AttributeGroup is 207.

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

Retrieving AttributeGroups

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

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

Response Body (JSON)

/* Sample request for AttributeGroup */
{
  "addedBy": {
    "id": 999
  },
  "changedBy": {
    "id": 999
  },
  "class": {
    "classGroup": {
      "id": 999
    },
    "code": "sample",
    "description": "sample",
    "id": 999,
    "name": "sample",
    "path": "sample",
    "isSyncTracked": false
  },
  "dateAdded": "2020-09-10T12:09:11.9880576+01:00",
  "dateChanged": "2020-09-10T12:09:11.9881473+01:00",
  "id": 999,
  "name": "sample",
  "scope": {
    "name": "sample",
    "id": 999
  },
  "sequence": 999
}

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

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

GET /api/{Context}/AttributeGroups/{id}

Use the "id" for the AttributeGroup 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 AttributeGroup Request Info

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

Retrieve AttributeGroup 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 AttributeGroup Properties per include option.

Retrieve Option Property Type
Header Class Class
Header Id int
Header Scope Scope
Header Name string
Header Sequence int?
Members Members List of AttributeGroupMember
Header DateAdded DateTime?
Header AddedBy Person
Header DateChanged DateTime?
Header ChangedBy Person

RetrieveAttributeGroup 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 AttributeGroups

Try me in Swagger

Request Body (JSON)

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

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

// the modelPost structure is described in the Request Json 
async function postAttributeGroups( host, modelPost) {
   let requestUrl = host + '/api/0/AttributeGroups
   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 AttributeGroup.

  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 AttributeGroup Request Info

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

Post AttributeGroup Contract Info

The POST request for AttributeGroup contract has the following properties

Name Type
Class IdPost
Name string
Sequence int

Add AttributeGroup 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 AttributeGroups

Try me in Swagger

Request Body (JSON)

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

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

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

Saves the modification on the AttributeGroup instance to the database.

Try me in Swagger

Change AttributeGroup Request Info

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

Patch AttributeGroup Contract Info

The AttributeGroup properties for a PATCH requests are:

Name Type
Name string
Sequence int
Id int

Patch AttributeGroup 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 AttributeGroups

Try me in Swagger

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

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

Deletes the AttributeGroup instance from the database.

Delete AttributeGroup Request Info

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

Delete AttributeGroup 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.

Classes

Supported operations

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

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

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

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

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

A Class 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 Class 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 Class supports Namespace identification.

A Class is unique across ( group_id, code, namespace_id ).

The ObjectType identifier for Class is 185.

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

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

Searching Classes

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

async function searchClasses( host, include= 'Id,Name,Code', filter, order, startAt = 0, pageSize = 10) {
   let requestUrl = host + '/api/0/Classes?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 Classes using the EQL logic.

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

GET /api/{Context}/Classes

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 Classes 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 Class of interest.


Try me in EqlExplorer
Try me in Swagger

Search Class Request Info

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

Search Class 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 Class 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 Classes

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

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

Response Body (JSON)

/* Sample request for Class */
{
  "classGroup": {
    "id": 999,
    "scope": {
      "id": 999
    },
    "name": "sample",
    "objectType": 999
  },
  "code": "sample",
  "description": "sample",
  "id": 999,
  "name": "sample",
  "path": "sample",
  "parent": {
    "id": 999,
    "isSyncTracked": false
  },
  "sysType": "sample",
  "dateObsolete": "2020-09-10T12:09:12.3921098+01:00",
  "supersededBy": {
    "code": "sample",
    "id": 999,
    "name": "sample",
    "isSyncTracked": false
  },
  "accessModifier": "sample",
  "isSyncTracked": true,
  "promptFlags": 999,
  "preventApprovalFlags": 999,
  "approvalProcess": {
    "name": "sample",
    "scope": {
      "id": 999
    },
    "id": 999
  },
  "scope": {
    "name": "sample",
    "id": 999
  },
  "namespace": {
    "name": "sample",
    "id": 999
  },
  "guid": "00000000-0000-0000-0000-000000000000",
  "objectType": 999,
  "hasFlags": 9999,
  "ext": {
    "relationshipType": {
      "leftType": 999,
      "rightType": 999,
      "leftName": "sample",
      "rightName": "sample",
      "controlledBy": "sample",
      "presentation": "sample",
      "numLeft": 999,
      "numRight": 999,
      "isDirected": true,
      "allowCircularReference": true,
      "id": 999
    }
  },
  "dateAdded": "2020-09-10T12:09:12.3918335+01:00",
  "addedBy": {
    "id": 999
  },
  "dateChanged": "2020-09-10T12:09:12.3919757+01:00",
  "changedBy": {
    "id": 999
  }
}

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

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

GET /api/{Context}/Classes/{id}

Use the "id" for the Class 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 Class Request Info

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

Retrieve Class 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 Class Properties per include option.

Retrieve Option Property Type
Header ClassGroup ClassGroup
Header Id int
Header Scope Scope
Header Namespace Namespace
Header Guid Guid?
Header ObjectType int?
Header Code string
Header Name string
Header Description string
Header HasFlags long?
Header Path string
Header SysType string
Header DateObsolete DateTime?
Header SupersededBy Class
Header PromptFlags int?
Header PreventApprovalFlags int?
Header Ftr string
Header ApprovalProcess Template
Header AccessModifier string
Header IsSyncTracked bool
AttributeGroups AttributeGroups List of AttributeGroup. Supported Filters
[StartAt=value]
[PageSize=value]
Attributes Attributes List of ClassAttribute. Supported Filters
[StartAt=value]
[PageSize=value]
[IsLinked=value]
[CompleteMemo=value]
[AttributeDef.IsIntrinsic=value]
AuditDetails AuditDetails List of AuditDetail
Layouts Layouts List of ObjectLayout
Behaviors Behaviors List of ObjectBehavior
Header Parent Class
Children Children List of Class. Supported Filters
[StartAt=value]
[PageSize=value]
Header Ext ClassExt
AttributeDomains AttributeDomains List of AttributeDomain. Supported Filters
[StartAt=value]
[PageSize=value]
[Include=value]
Activities Activities List of ClassActivity
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
MetaData MetaData List of EntityMetadata. Supported Filters
[StartAt=value]
[PageSize=value]
MenuItemRefs MenuItemRefs List of VerticalMenuItem. Supported Filters
[StartAt=value]
[PageSize=value]
Templates Templates List of Template. Supported Filters
[StartAt=value]
[PageSize=value]
[IncludeControlledBy=value]
Automations Automations List of ObjectAutomation
AttributeDomainRefs AttributeDomainRefs List of AttributeDomain. Supported Filters
[StartAt=value]
[PageSize=value]
[Include=value]
RelationshipTypeGraph RelationshipTypeGraph List of ClassRelationshipTypeClass
Relationships Relationships List of ClassRelationship
RelationshipRules RelationshipRules List of ClassRelationshipRule
GroupedAttributes GroupedAttributes List of ClassAttribute. Supported Filters
[StartAt=value]
[PageSize=value]
[IsLinked=value]
[CompleteMemo=value]
[AttributeDef.IsIntrinsic=value]
ScheduleDefs ScheduleDefs List of ScheduleDef. Supported Filters
[StartAt=value]
[PageSize=value]
[AppliesToClass.Id IN (comma delimited values)]
[TaskClass.Id IN (comma delimited values)]
ActivityTypeSets ActivityTypeSets List of ActivityTypeSet. Supported Filters
[StartAt=value]
[PageSize=value]
AttributeDependencies AttributeDependencies List of AttributeDependency. Supported Filters
[StartAt=value]
[PageSize=value]

RetrieveClass 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 Classes

Try me in Swagger

Request Body (JSON)

{
  "classGroup": {
    "id": 999
  },
  "parent": {
    "id": 999
  },
  "code": "string value",
  "name": "string value",
  "description": "string value",
  "sysType": "string value",
  "dateObsolete": "2020-05-07T16:25:12Z",
  "supersededBy": {
    "id": 999
  },
  "accessModifier": "string value",
  "isSyncTracked": true
}

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

// the modelPost structure is described in the Request Json 
async function postClasses( host, modelPost) {
   let requestUrl = host + '/api/0/Classes
   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 Class.

  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 Class Request Info

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

Post Class Contract Info

The POST request for Class contract has the following properties

Name Type
ClassGroup IdPost
Parent IdPost
Code string
Name string
Description string
SysType string
DateObsolete DateTime?
SupersededBy IdPost
AccessModifier string
IsSyncTracked bool

Add Class 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 Classes

Try me in Swagger

Request Body (JSON)

{
  "code": "string value",
  "name": "string value",
  "description": "string value",
  "dateObsolete": "2020-05-07T16:25:12Z",
  "supersededBy": {
    "id": 999
  },
  "sysType": "string value",
  "parent": {
    "id": 999
  },
  "promptFlags": 999,
  "preventApprovalFlags": 999,
  "approvalProcess": {
    "id": 999
  },
  "accessModifier": "string value",
  "isSyncTracked": true,
  "id": 999
}

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

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

Saves the modification on the Class instance to the database.

Try me in Swagger

Change Class Request Info

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

Patch Class Contract Info

The Class properties for a PATCH requests are:

Name Type
Code string
Name string
Description string
DateObsolete DateTime?
SupersededBy IdPatch
SysType string
Parent IdPatch
PromptFlags int
PreventApprovalFlags int
ApprovalProcess IdPatch
AccessModifier string
IsSyncTracked bool
Id int

Patch Class 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.

ClassAttributes

Supported operations

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

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

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

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

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

A ClassAttribute is classified as a 'FieldSet'. Fieldsets stores complex attribute data (against other entities).

Searching ClassAttributes

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

async function searchClassAttributes( host, include= 'Id,Class.Id', filter, order, startAt = 0, pageSize = 10) {
   let requestUrl = host + '/api/0/ClassAttributes?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
},
{
  "classId": 999,
  "id": 999
}
]

Enables Searching on ClassAttributes using the EQL logic.

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

GET /api/{Context}/ClassAttributes

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 ClassAttributes 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 ClassAttribute of interest.


Try me in EqlExplorer
Try me in Swagger

Search ClassAttribute Request Info

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

Search ClassAttribute Request Parameters

Parameter Default Description
include Id,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 ClassAttribute 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 ClassAttributes

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

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

Response Body (JSON)

/* Sample request for ClassAttribute */
{
  "class": {
    "classGroup": {
      "id": 999
    },
    "code": "sample",
    "description": "sample",
    "id": 999,
    "name": "sample",
    "path": "sample",
    "parent": {
      "id": 999,
      "isSyncTracked": false
    },
    "sysType": "sample",
    "dateObsolete": "2020-09-10T12:09:12.7272345+01:00",
    "supersededBy": {
      "id": 999,
      "isSyncTracked": false
    },
    "accessModifier": "sample",
    "isSyncTracked": true,
    "promptFlags": 999,
    "preventApprovalFlags": 999,
    "approvalProcess": {
      "id": 999
    },
    "scope": {
      "id": 999
    },
    "namespace": {
      "id": 999
    }
  },
  "attributeDef": {
    "baseUnit": "sample",
    "dataSource": "sample",
    "dataType": "sample",
    "editQuery": "sample",
    "hasLookup": true,
    "id": 999,
    "isChangeControlled": true,
    "isIntrinsic": true,
    "isMandatory": true,
    "isMultiValued": true,
    "length": 999,
    "mask": "sample",
    "name": "sample",
    "namespace": {
      "name": "sample",
      "id": 999
    },
    "objectType": 0,
    "permMask": 999,
    "scale": 999,
    "scope": {
      "name": "sample",
      "id": 999
    },
    "searchQuery": "sample"
  },
  "inherit": true,
  "dataTypeConstraints": 999,
  "isLinked": true,
  "id": 999
}

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

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

GET /api/{Context}/ClassAttributes/{id}

Use the "id" for the ClassAttribute 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 ClassAttribute Request Info

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

Retrieve ClassAttribute 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 ClassAttribute Properties per include option.

Retrieve Option Property Type
Header Id int
Class Class Class
Header Scope Scope
AttributeDef AttributeDef AttributeDef
Header Inherit bool?
Header NumAssocGroups int?
Header IsLinked bool?
AttributeUnit AttributeUnit AttributeUnit
MetaData MetaData List of EntityMetadata. Supported Filters
[StartAt=value]
[PageSize=value]
Header DateAdded DateTime?
Header AddedBy Person
Header DateChanged DateTime?
Header ChangedBy Person
Header DataTypeConstraints int?

RetrieveClassAttribute 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 ClassAttributes

Try me in Swagger

Request Body (JSON)

{
  "class": {
    "id": 999
  },
  "attributeDef": {
    "id": 999
  },
  "inherit": true
}

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

// the modelPost structure is described in the Request Json 
async function postClassAttributes( host, modelPost) {
   let requestUrl = host + '/api/0/ClassAttributes
   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 ClassAttribute.

  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 ClassAttribute Request Info

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

Post ClassAttribute Contract Info

The POST request for ClassAttribute contract has the following properties

Name Type
Class IdPost
AttributeDef IdPost
Inherit bool

Add ClassAttribute 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 ClassAttributes

Try me in Swagger

Request Body (JSON)

{
  "inherit": true,
  "dataTypeConstraints": 999,
  "id": 999
}

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

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

Saves the modification on the ClassAttribute instance to the database.

Try me in Swagger

Change ClassAttribute Request Info

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

Patch ClassAttribute Contract Info

The ClassAttribute properties for a PATCH requests are:

Name Type
Inherit bool
DataTypeConstraints int
Id int

Patch ClassAttribute 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.

ClassGroups

Supported operations

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

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

A ClassGroup is an 'Independent Object'.

A ClassGroup may only be created in the 'Global' Scope .

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

A ClassGroup is unique across ( name ).

The ObjectType identifier for ClassGroup is 184.

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

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

Searching ClassGroups

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

async function searchClassGroups( host, include= 'Id,Name', filter, order, startAt = 0, pageSize = 10) {
   let requestUrl = host + '/api/0/ClassGroups?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 ClassGroups using the EQL logic.

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

GET /api/{Context}/ClassGroups

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 ClassGroups 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 ClassGroup of interest.


Try me in EqlExplorer
Try me in Swagger

Search ClassGroup Request Info

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

Search ClassGroup 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 ClassGroup 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 ClassGroups

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

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

Response Body (JSON)

/* Sample request for ClassGroup */
{
  "id": 999,
  "scope": {
    "name": "sample",
    "id": 999
  },
  "name": "sample",
  "hasFlags": 9999,
  "objectType": 999,
  "dateAdded": "2020-09-10T12:09:12.8079774+01:00",
  "addedBy": {
    "id": 999
  },
  "dateChanged": "2020-09-10T12:09:12.8081224+01:00",
  "changedBy": {
    "id": 999
  }
}

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

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

GET /api/{Context}/ClassGroups/{id}

Use the "id" for the ClassGroup 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 ClassGroup Request Info

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

Retrieve ClassGroup 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 ClassGroup Properties per include option.

Retrieve Option Property Type
Header Id int
Header Scope Scope
Header Name string
Header HasFlags long?
Header ObjectType int?
Layouts Layouts List of ObjectLayout
Behaviors Behaviors List of ObjectBehavior
Header DateAdded DateTime?
Header AddedBy Person
Header DateChanged DateTime?
Header ChangedBy Person
Header AuditDetails List of AuditDetail
AttributeDomainSources AttributeDomainSources List of AttributeDomainSource. Supported Filters
[StartAt=value]
[PageSize=value]
[SourceObjectType IN (comma delimited values)]
AttributeDefs AttributeDefs List of AttributeDef. Supported Filters
[StartAt=value]
[PageSize=value]
[AttributeDef.Id=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]
Classes Classes List of Class. Supported Filters
[StartAt=value]
[PageSize=value]
Templates Templates List of Template. Supported Filters
[StartAt=value]
[PageSize=value]

RetrieveClassGroup 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.

CrossReferenceTypes

Supported operations

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

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

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

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

A CrossReferenceType 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 CrossReferenceType 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.

A CrossReferenceType supports Namespace identification.

A CrossReferenceType is unique across ( description, namespace_id ).

The ObjectType identifier for CrossReferenceType is 141.

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

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

Searching CrossReferenceTypes

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

async function searchCrossReferenceTypes( host, include= 'Id,Name', filter, order, startAt = 0, pageSize = 10) {
   let requestUrl = host + '/api/0/CrossReferenceTypes?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 CrossReferenceTypes using the EQL logic.

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

GET /api/{Context}/CrossReferenceTypes

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 CrossReferenceTypes 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 CrossReferenceType of interest.


Try me in EqlExplorer
Try me in Swagger

Search CrossReferenceType Request Info

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

Search CrossReferenceType 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 CrossReferenceType 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.

Creating CrossReferenceTypes

Try me in Swagger

Request Body (JSON)

{
  "name": "string value"
}

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

// the modelPost structure is described in the Request Json 
async function postCrossReferenceTypes( host, modelPost) {
   let requestUrl = host + '/api/0/CrossReferenceTypes
   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 CrossReferenceType.

  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 CrossReferenceType Request Info

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

Post CrossReferenceType Contract Info

The POST request for CrossReferenceType contract has the following properties

Name Type
Name string

Add CrossReferenceType 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 CrossReferenceTypes

Try me in Swagger

Request Body (JSON)

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

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

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

Saves the modification on the CrossReferenceType instance to the database.

Try me in Swagger

Change CrossReferenceType Request Info

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

Patch CrossReferenceType Contract Info

The CrossReferenceType properties for a PATCH requests are:

Name Type
Name string
Id int

Patch CrossReferenceType 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 CrossReferenceTypes

Try me in Swagger

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

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

Deletes the CrossReferenceType instance from the database.

Delete CrossReferenceType Request Info

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

Delete CrossReferenceType 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.

FileFormats

Supported operations

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

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

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

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

A FileFormat 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 FileFormat may only be created in the 'Global' Scope .

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

A FileFormat supports Namespace identification.

A FileFormat is unique across ( mime_type ).

The ObjectType identifier for FileFormat is 38.

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

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

Searching FileFormats

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

async function searchFileFormats( host, include= 'Id,Name', filter, order, startAt = 0, pageSize = 10) {
   let requestUrl = host + '/api/0/FileFormats?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 FileFormats using the EQL logic.

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

GET /api/{Context}/FileFormats

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 FileFormats 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 FileFormat of interest.


Try me in EqlExplorer
Try me in Swagger

Search FileFormat Request Info

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

Search FileFormat 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 FileFormat 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.

Creating FileFormats

Try me in Swagger

Request Body (JSON)

{
  "name": "string value",
  "fileExtentions": "string value",
  "mimeType": "string value"
}

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

// the modelPost structure is described in the Request Json 
async function postFileFormats( host, modelPost) {
   let requestUrl = host + '/api/0/FileFormats
   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 FileFormat.

  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 FileFormat Request Info

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

Post FileFormat Contract Info

The POST request for FileFormat contract has the following properties

Name Type
Name string
FileExtentions string
MimeType string

Add FileFormat 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 FileFormats

Try me in Swagger

Request Body (JSON)

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

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

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

Saves the modification on the FileFormat instance to the database.

Try me in Swagger

Change FileFormat Request Info

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

Patch FileFormat Contract Info

The FileFormat properties for a PATCH requests are:

Name Type
Name string
FileExtentions string
MimeType string
Id int

Patch FileFormat 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 FileFormats

Try me in Swagger

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

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

Deletes the FileFormat instance from the database.

Delete FileFormat Request Info

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

Delete FileFormat 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.

KindOfQuantities

Supported operations

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

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

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

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

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

Searching KindOfQuantities

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

async function searchKindOfQuantities( host, include= 'Id,Name,Code', filter, order, startAt = 0, pageSize = 10) {
   let requestUrl = host + '/api/0/KindOfQuantities?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 KindOfQuantities using the EQL logic.

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

GET /api/{Context}/KindOfQuantities

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 KindOfQuantities 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 KindOfQuantity of interest.


Try me in EqlExplorer
Try me in Swagger

Search KindOfQuantity Request Info

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

Search KindOfQuantity 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 KindOfQuantity 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 KindOfQuantities

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

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

Response Body (JSON)

/* Sample request for KindOfQuantity */
{
  "code": "sample",
  "description": "sample",
  "id": 999,
  "name": "sample",
  "dimension": {
    "code": "sample",
    "derivation": "sample",
    "description": "sample",
    "id": 999,
    "name": "sample"
  },
  "defaultUnit": {
    "code": "sample",
    "name": "sample",
    "description": "sample",
    "symbol": "sample",
    "dateObsolete": "2020-09-10T12:09:13.1219302+01:00",
    "conversionFactor": 9.999,
    "conversionOffSet": 9.999,
    "converter": 999,
    "id": 999
  },
  "parent": {
    "code": "sample",
    "description": "sample",
    "id": 999,
    "name": "sample"
  }
}

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

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

GET /api/{Context}/KindOfQuantities/{id}

Use the "id" for the KindOfQuantity 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 KindOfQuantity Request Info

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

Retrieve KindOfQuantity 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 KindOfQuantity Properties per include option.

Retrieve Option Property Type
Header Id int
Header Name string
Header Code string
Header Dimension Dimension
Header Description string
Header DefaultUnit Unit
Header Parent KindOfQuantity
Children Children List of KindOfQuantity. Supported Filters
[Dimension.Id=value]
[Dimension.Id IN (comma delimited values)]
[StartAt=value]
[PageSize=value]
AuditDetails AuditDetails List of AuditDetail

RetrieveKindOfQuantity 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 KindOfQuantities

Try me in Swagger

Request Body (JSON)

{
  "code": "string value",
  "name": "string value",
  "description": "string value",
  "dimension": {
    "id": 999
  },
  "defaultUnit": {
    "id": 999
  },
  "parent": {
    "id": 999
  }
}

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

// the modelPost structure is described in the Request Json 
async function postKindOfQuantities( host, modelPost) {
   let requestUrl = host + '/api/0/KindOfQuantities
   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 KindOfQuantity.

  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 KindOfQuantity Request Info

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

Post KindOfQuantity Contract Info

The POST request for KindOfQuantity contract has the following properties

Name Type
Code string
Name string
Description string
Dimension IdPost
DefaultUnit IdPost
Parent IdPost

Add KindOfQuantity 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 KindOfQuantities

Try me in Swagger

Request Body (JSON)

{
  "code": "string value",
  "name": "string value",
  "description": "string value",
  "dimension": {
    "id": 999
  },
  "defaultUnit": {
    "id": 999
  },
  "parent": {
    "id": 999
  },
  "id": 999
}

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

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

Try me in Swagger

Change KindOfQuantity Request Info

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

Patch KindOfQuantity Contract Info

The KindOfQuantity properties for a PATCH requests are:

Name Type
Code string
Name string
Description string
Dimension IdPatch
DefaultUnit IdPatch
Parent IdPatch
Id int

Patch KindOfQuantity 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.

MeasurementFunctions

Supported operations

MediaTypes

Supported operations

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

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

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

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

A MediaType 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 MediaType may only be created in the 'Global' Scope .

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

A MediaType supports Namespace identification.

The ObjectType identifier for MediaType is 27.

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

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

Searching MediaTypes

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

async function searchMediaTypes( host, include= 'Id,Name', filter, order, startAt = 0, pageSize = 10) {
   let requestUrl = host + '/api/0/MediaTypes?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 MediaTypes using the EQL logic.

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

GET /api/{Context}/MediaTypes

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 MediaTypes 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 MediaType of interest.


Try me in EqlExplorer
Try me in Swagger

Search MediaType Request Info

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

Search MediaType 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 MediaType 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.

Creating MediaTypes

Try me in Swagger

Request Body (JSON)

{
  "name": "string value",
  "sysType": "string value"
}

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

// the modelPost structure is described in the Request Json 
async function postMediaTypes( host, modelPost) {
   let requestUrl = host + '/api/0/MediaTypes
   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 MediaType.

  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 MediaType Request Info

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

Post MediaType Contract Info

The POST request for MediaType contract has the following properties

Name Type
Name string
SysType string

Add MediaType 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 MediaTypes

Try me in Swagger

Request Body (JSON)

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

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

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

Saves the modification on the MediaType instance to the database.

Try me in Swagger

Change MediaType Request Info

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

Patch MediaType Contract Info

The MediaType properties for a PATCH requests are:

Name Type
Name string
Id int

Patch MediaType 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 MediaTypes

Try me in Swagger

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

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

Deletes the MediaType instance from the database.

Delete MediaType Request Info

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

Delete MediaType 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.

RelationshipTypes

Supported operations

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

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

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

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

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

A RelationshipType 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 RelationshipType 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 RelationshipType supports Namespace identification.

A RelationshipType is unique across ( class_id ).

The ObjectType identifier for RelationshipType is 87.

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

You can use RelationshipType as the root [START WITH] type in a Search . A number of properties including: Id, Scope, DerivedFrom, LeftType, RightType, LeftName etc. are available to the search. To find a full list of searchable properties use SearchableTypes .

Searching RelationshipTypes

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

async function searchRelationshipTypes( host, include= 'Id', filter, order, startAt = 0, pageSize = 10) {
   let requestUrl = host + '/api/0/RelationshipTypes?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 RelationshipTypes using the EQL logic.

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

GET /api/{Context}/RelationshipTypes

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 RelationshipTypes 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 RelationshipType of interest.


Try me in EqlExplorer
Try me in Swagger

Search RelationshipType Request Info

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

Search RelationshipType 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 RelationshipType 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 RelationshipTypes

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

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

Response Body (JSON)

/* Sample request for RelationshipType */
{
  "leftType": 999,
  "rightType": 999,
  "leftName": "sample",
  "rightName": "sample",
  "controlledBy": "sample",
  "presentation": "sample",
  "numLeft": 999,
  "numRight": 999,
  "isDirected": true,
  "allowCircularReference": true,
  "scope": {
    "name": "sample",
    "id": 999
  },
  "namespace": {
    "name": "sample",
    "id": 999
  },
  "guid": "00000000-0000-0000-0000-000000000000",
  "derivedFrom": {
    "code": "sample",
    "description": "sample",
    "id": 999,
    "name": "sample",
    "isSyncTracked": false
  },
  "dateAdded": "2020-09-10T12:09:13.4523527+01:00",
  "addedBy": {
    "id": 999
  },
  "dateChanged": "2020-09-10T12:09:13.4524524+01:00",
  "changedBy": {
    "id": 999
  },
  "id": 999
}

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

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

GET /api/{Context}/RelationshipTypes/{id}

Use the "id" for the RelationshipType 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 RelationshipType Request Info

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

Retrieve RelationshipType 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 RelationshipType Properties per include option.

Retrieve Option Property Type
Header Id int
Header Scope Scope
Header Namespace Namespace
Header Guid Guid?
Header DerivedFrom Class
Header LeftType int?
Header RightType int?
Header LeftName string
Header RightName string
Header IsSameType bool?
Header NumLeft int?
Header NumRight int?
Header IsDirected bool?
Header AllowCircularReference bool?
Header ControlledBy string
Header Presentation string
Header DateAdded DateTime?
Header AddedBy Person
Header DateChanged DateTime?
Header ChangedBy Person
Header AuditDetails List of AuditDetail

RetrieveRelationshipType 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.

Changing RelationshipTypes

Try me in Swagger

Request Body (JSON)

{
  "leftType": 999,
  "rightType": 999,
  "leftName": "string value",
  "rightName": "string value",
  "controlledBy": "string value",
  "presentation": "string value",
  "numLeft": 999,
  "numRight": 999,
  "isDirected": true,
  "allowCircularReference": true,
  "id": 999
}

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

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

Saves the modification on the RelationshipType instance to the database.

Try me in Swagger

Change RelationshipType Request Info

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

Patch RelationshipType Contract Info

The RelationshipType properties for a PATCH requests are:

Name Type
LeftType int
RightType int
LeftName string
RightName string
ControlledBy string
Presentation string
NumLeft int
NumRight int
IsDirected bool
AllowCircularReference bool
Id int

Patch RelationshipType 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 RelationshipTypes

Try me in Swagger

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

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

Deletes the RelationshipType instance from the database.

Delete RelationshipType Request Info

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

Delete RelationshipType 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.

ResponsibilityTypes

Supported operations

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

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

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

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

A ResponsibilityType 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 ResponsibilityType 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.

A ResponsibilityType supports Namespace identification.

A ResponsibilityType is unique across ( name, namespace_id ).

The ObjectType identifier for ResponsibilityType is 101.

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

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

Searching ResponsibilityTypes

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

async function searchResponsibilityTypes( host, include= 'Id,Name', filter, order, startAt = 0, pageSize = 10) {
   let requestUrl = host + '/api/0/ResponsibilityTypes?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 ResponsibilityTypes using the EQL logic.

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

GET /api/{Context}/ResponsibilityTypes

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 ResponsibilityTypes 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 ResponsibilityType of interest.


Try me in EqlExplorer
Try me in Swagger

Search ResponsibilityType Request Info

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

Search ResponsibilityType 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 ResponsibilityType 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.

Creating ResponsibilityTypes

Try me in Swagger

Request Body (JSON)

{
  "name": "string value"
}

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

// the modelPost structure is described in the Request Json 
async function postResponsibilityTypes( host, modelPost) {
   let requestUrl = host + '/api/0/ResponsibilityTypes
   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 ResponsibilityType.

  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 ResponsibilityType Request Info

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

Post ResponsibilityType Contract Info

The POST request for ResponsibilityType contract has the following properties

Name Type
Name string

Add ResponsibilityType 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 ResponsibilityTypes

Try me in Swagger

Request Body (JSON)

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

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

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

Saves the modification on the ResponsibilityType instance to the database.

Try me in Swagger

Change ResponsibilityType Request Info

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

Patch ResponsibilityType Contract Info

The ResponsibilityType properties for a PATCH requests are:

Name Type
Name string
Id int

Patch ResponsibilityType 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 ResponsibilityTypes

Try me in Swagger

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

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

Deletes the ResponsibilityType instance from the database.

Delete ResponsibilityType Request Info

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

Delete ResponsibilityType 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.

RestrictionClasses

Supported operations

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

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

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

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

Retrieving RestrictionClasses

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

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

Response Body (JSON)

/* Sample request for RestrictionClass */
{
  "code": "sample",
  "description": "sample",
  "id": 999,
  "limitDatatype": 999,
  "limitType": 999,
  "name": "sample",
  "namespace": {
    "name": "sample",
    "id": 999
  },
  "restrictionType": 999,
  "scope": {
    "name": "sample",
    "id": 999
  },
  "isSyncTracked": false
}

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

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

GET /api/{Context}/RestrictionClasses/{id}

Use the "id" for the RestrictionClass 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 RestrictionClass Request Info

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

Retrieve RestrictionClass 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 RestrictionClass Properties per include option.

Retrieve Option Property Type
Header RestrictionType int
Header LimitType int?
Header LimitDatatype int?
Header ClassGroup ClassGroup
Header Id int
Header Scope Scope
Header Namespace Namespace
Header Guid Guid?
Header ObjectType int?
Header Code string
Header Name string
Header Description string
Header HasFlags long?
Header Path string
Header SysType string
Header DateObsolete DateTime?
Header SupersededBy Class
Header PromptFlags int?
Header PreventApprovalFlags int?
Header Ftr string
Header ApprovalProcess Template
Header AccessModifier string
Header IsSyncTracked bool
AttributeGroups AttributeGroups List of AttributeGroup. Supported Filters
[StartAt=value]
[PageSize=value]
Attributes Attributes List of ClassAttribute. Supported Filters
[StartAt=value]
[PageSize=value]
[IsLinked=value]
[CompleteMemo=value]
[AttributeDef.IsIntrinsic=value]
AuditDetails AuditDetails List of AuditDetail
Layouts Layouts List of ObjectLayout
Behaviors Behaviors List of ObjectBehavior
Header Parent Class
Children Children List of Class. Supported Filters
[StartAt=value]
[PageSize=value]
Header Ext ClassExt
AttributeDomains AttributeDomains List of AttributeDomain. Supported Filters
[StartAt=value]
[PageSize=value]
[Include=value]
Activities Activities List of ClassActivity
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
MetaData MetaData List of EntityMetadata. Supported Filters
[StartAt=value]
[PageSize=value]
MenuItemRefs MenuItemRefs List of VerticalMenuItem. Supported Filters
[StartAt=value]
[PageSize=value]
Templates Templates List of Template. Supported Filters
[StartAt=value]
[PageSize=value]
[IncludeControlledBy=value]
Automations Automations List of ObjectAutomation
AttributeDomainRefs AttributeDomainRefs List of AttributeDomain. Supported Filters
[StartAt=value]
[PageSize=value]
[Include=value]
RelationshipTypeGraph RelationshipTypeGraph List of ClassRelationshipTypeClass
Relationships Relationships List of ClassRelationship
RelationshipRules RelationshipRules List of ClassRelationshipRule
GroupedAttributes GroupedAttributes List of ClassAttribute. Supported Filters
[StartAt=value]
[PageSize=value]
[IsLinked=value]
[CompleteMemo=value]
[AttributeDef.IsIntrinsic=value]
ScheduleDefs ScheduleDefs List of ScheduleDef. Supported Filters
[StartAt=value]
[PageSize=value]
[AppliesToClass.Id IN (comma delimited values)]
[TaskClass.Id IN (comma delimited values)]
ActivityTypeSets ActivityTypeSets List of ActivityTypeSet. Supported Filters
[StartAt=value]
[PageSize=value]
AttributeDependencies AttributeDependencies List of AttributeDependency. Supported Filters
[StartAt=value]
[PageSize=value]

RetrieveRestrictionClass 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 RestrictionClasses

Try me in Swagger

Request Body (JSON)

{
  "classGroup": {
    "id": 999
  },
  "parent": {
    "id": 999
  },
  "code": "string value",
  "name": "string value",
  "description": "string value",
  "sysType": "string value",
  "dateObsolete": "2020-05-07T16:25:12Z",
  "supersededBy": {
    "id": 999
  },
  "accessModifier": "string value",
  "restrictionType": 999,
  "limitType": 999,
  "limitDatatype": 999
}

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

// the modelPost structure is described in the Request Json 
async function postRestrictionClasses( host, modelPost) {
   let requestUrl = host + '/api/0/RestrictionClasses
   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 RestrictionClass.

  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 RestrictionClass Request Info

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

Post RestrictionClass Contract Info

The POST request for RestrictionClass contract has the following properties

Name Type
ClassGroup IdPost
Parent IdPost
Code string
Name string
Description string
SysType string
DateObsolete DateTime?
SupersededBy IdPost
AccessModifier string
RestrictionType int
LimitType int
LimitDatatype int

Add RestrictionClass 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 RestrictionClasses

Try me in Swagger

Request Body (JSON)

{
  "restrictionType": 999,
  "limitType": 999,
  "limitDatatype": 999,
  "id": 999
}

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

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

Try me in Swagger

Change RestrictionClass Request Info

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

Patch RestrictionClass Contract Info

The RestrictionClass properties for a PATCH requests are:

Name Type
RestrictionType int
LimitType int
LimitDatatype int
Id int

Patch RestrictionClass 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.

StateMachines

Supported operations

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

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

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

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

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

Searching StateMachines

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

async function searchStateMachines( host, include= 'Id,Name', filter, order, startAt = 0, pageSize = 10) {
   let requestUrl = host + '/api/0/StateMachines?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 StateMachines using the EQL logic.

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

GET /api/{Context}/StateMachines

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 StateMachines 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 StateMachine of interest.


Try me in EqlExplorer
Try me in Swagger

Search StateMachine Request Info

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

Search StateMachine 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 StateMachine 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 StateMachines

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

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

Response Body (JSON)

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

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

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

GET /api/{Context}/StateMachines/{id}

Use the "id" for the StateMachine 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 StateMachine Request Info

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

Retrieve StateMachine 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 StateMachine Properties per include option.

Retrieve Option Property Type
Header Id int
Header Name string
Header Scope Scope
Header Namespace Namespace
Header DateAdded DateTime?
Header AddedBy Person
Header DateChanged DateTime?
Header ChangedBy Person
AuditDetails AuditDetails List of AuditDetail
States States List of State. Supported Filters
[StartAt=value]
[PageSize=value]
StateTransitions StateTransitions List of StateTransition. Supported Filters
[StartAt=value]
[PageSize=value]

RetrieveStateMachine 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 StateMachines

Try me in Swagger

Request Body (JSON)

{
  "name": "string value"
}

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

// the modelPost structure is described in the Request Json 
async function postStateMachines( host, modelPost) {
   let requestUrl = host + '/api/0/StateMachines
   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 StateMachine.

  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 StateMachine Request Info

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

Post StateMachine Contract Info

The POST request for StateMachine contract has the following properties

Name Type
Name string

Add StateMachine 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 StateMachines

Try me in Swagger

Request Body (JSON)

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

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

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

Try me in Swagger

Change StateMachine Request Info

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

Patch StateMachine Contract Info

The StateMachine properties for a PATCH requests are:

Name Type
Name string
Id int

Patch StateMachine 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 StateMachines

Try me in Swagger

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

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

Delete StateMachine Request Info

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

Delete StateMachine 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.

StateTransitions

Supported operations

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

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

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

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

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

Searching StateTransitions

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

async function searchStateTransitions( host, include= 'Id,Name', filter, order, startAt = 0, pageSize = 10) {
   let requestUrl = host + '/api/0/StateTransitions?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 StateTransitions using the EQL logic.

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

GET /api/{Context}/StateTransitions

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 StateTransitions 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 StateTransition of interest.


Try me in EqlExplorer
Try me in Swagger

Search StateTransition Request Info

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

Search StateTransition 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 StateTransition 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 StateTransitions

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

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

Response Body (JSON)

/* Sample request for StateTransition */
{
  "fromState": {
    "stateMachine": {
      "id": 999,
      "name": "sample"
    },
    "code": "sample",
    "name": "sample",
    "isStartState": true,
    "isEndState": true,
    "id": 999
  },
  "toState": {
    "stateMachine": {
      "id": 999,
      "name": "sample"
    },
    "code": "sample",
    "name": "sample",
    "isStartState": true,
    "isEndState": true,
    "id": 999
  },
  "name": "sample",
  "scope": {
    "name": "sample",
    "id": 999
  },
  "dateAdded": "2020-09-10T12:09:13.8684283+01:00",
  "addedBy": {
    "id": 999
  },
  "dateChanged": "2020-09-10T12:09:13.8685641+01:00",
  "changedBy": {
    "id": 999
  },
  "id": 999
}

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

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

GET /api/{Context}/StateTransitions/{id}

Use the "id" for the StateTransition 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 StateTransition Request Info

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

Retrieve StateTransition 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 StateTransition Properties per include option.

Retrieve Option Property Type
Header Id int
Header Name string
Header Scope Scope
Header FromState State
Header ToState State
Header DateAdded DateTime?
Header AddedBy Person
Header DateChanged DateTime?
Header ChangedBy Person
AuditDetails AuditDetails List of AuditDetail

RetrieveStateTransition 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 StateTransitions

Try me in Swagger

Request Body (JSON)

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

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

// the modelPost structure is described in the Request Json 
async function postStateTransitions( host, modelPost) {
   let requestUrl = host + '/api/0/StateTransitions
   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 StateTransition.

  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 StateTransition Request Info

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

Post StateTransition Contract Info

The POST request for StateTransition contract has the following properties

Name Type
FromState IdPost
ToState IdPost
Name string

Add StateTransition 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 StateTransitions

Try me in Swagger

Request Body (JSON)

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

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

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

Try me in Swagger

Change StateTransition Request Info

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

Patch StateTransition Contract Info

The StateTransition properties for a PATCH requests are:

Name Type
Name string
Id int

Patch StateTransition 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 StateTransitions

Try me in Swagger

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

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

Delete StateTransition Request Info

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

Delete StateTransition 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.

TransmittalResponseTypes

Supported operations

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

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

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

A TransmittalResponseType is classified as a 'FieldSet'. Fieldsets stores complex attribute data (against other entities).

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

A TransmittalResponseType is unique across ( reason_id, name ).

The ObjectType identifier for TransmittalResponseType is 263.

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

Creating TransmittalResponseTypes

Try me in Swagger

Request Body (JSON)

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

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

// the modelPost structure is described in the Request Json 
async function postTransmittalResponseTypes( host, modelPost) {
   let requestUrl = host + '/api/0/TransmittalResponseTypes
   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 TransmittalResponseType.

  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 TransmittalResponseType Request Info

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

Post TransmittalResponseType Contract Info

The POST request for TransmittalResponseType contract has the following properties

Name Type
Reason IdPost
Name string

Add TransmittalResponseType 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 TransmittalResponseTypes

Try me in Swagger

Request Body (JSON)

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

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

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

Saves the modification on the TransmittalResponseType instance to the database.

Try me in Swagger

Change TransmittalResponseType Request Info

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

Patch TransmittalResponseType Contract Info

The TransmittalResponseType properties for a PATCH requests are:

Name Type
Name string
Id int

Patch TransmittalResponseType 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 TransmittalResponseTypes

Try me in Swagger

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

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

Deletes the TransmittalResponseType instance from the database.

Delete TransmittalResponseType Request Info

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

Delete TransmittalResponseType 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.

UnitSystems

Supported operations

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

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

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

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

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

Searching UnitSystems

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

async function searchUnitSystems( host, include= 'Id,Name,Code', filter, order, startAt = 0, pageSize = 10) {
   let requestUrl = host + '/api/0/UnitSystems?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 UnitSystems using the EQL logic.

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

GET /api/{Context}/UnitSystems

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 UnitSystems 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 UnitSystem of interest.


Try me in EqlExplorer
Try me in Swagger

Search UnitSystem Request Info

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

Search UnitSystem 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 UnitSystem 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 UnitSystems

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

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

Response Body (JSON)

/* Sample request for UnitSystem */
{
  "code": "sample",
  "description": "sample",
  "id": 999,
  "name": "sample"
}

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

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

GET /api/{Context}/UnitSystems/{id}

Use the "id" for the UnitSystem 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 UnitSystem Request Info

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

Retrieve UnitSystem 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 UnitSystem Properties per include option.

Retrieve Option Property Type
Header Id int
Header Name string
Header Code string
Header Description string
Units Units List of Unit. Supported Filters
[StartAt=value]
[PageSize=value]
AuditDetails AuditDetails List of AuditDetail

RetrieveUnitSystem 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 UnitSystems

Try me in Swagger

Request Body (JSON)

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

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

// the modelPost structure is described in the Request Json 
async function postUnitSystems( host, modelPost) {
   let requestUrl = host + '/api/0/UnitSystems
   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 UnitSystem.

  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 UnitSystem Request Info

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

Post UnitSystem Contract Info

The POST request for UnitSystem contract has the following properties

Name Type
Code string
Name string
Description string

Add UnitSystem 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 UnitSystems

Try me in Swagger

Request Body (JSON)

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

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

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

Try me in Swagger

Change UnitSystem Request Info

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

Patch UnitSystem Contract Info

The UnitSystem properties for a PATCH requests are:

Name Type
Code string
Name string
Description string
Id int

Patch UnitSystem 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.

Namespaces

Supported operations

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

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

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

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

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

A Namespace 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 Namespace may only be created in the 'Global' Scope .

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

A Namespace is unique across ( name ).

The ObjectType identifier for Namespace is 226.

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

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

Searching Namespaces

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

async function searchNamespaces( host, include= 'Id,Name', filter, order, startAt = 0, pageSize = 10) {
   let requestUrl = host + '/api/0/Namespaces?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 Namespaces using the EQL logic.

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

GET /api/{Context}/Namespaces

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 Namespaces 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 Namespace of interest.


Try me in EqlExplorer
Try me in Swagger

Search Namespace Request Info

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

Search Namespace 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 Namespace 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 Namespaces

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

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

Response Body (JSON)

/* Sample request for Namespace */
{
  "name": "sample",
  "scope": {
    "name": "sample",
    "id": 999
  },
  "dateAdded": "2020-09-10T12:09:14.1130111+01:00",
  "addedBy": {
    "id": 999
  },
  "dateChanged": "2020-09-10T12:09:14.1131135+01:00",
  "changedBy": {
    "id": 999
  },
  "id": 999
}

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

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

GET /api/{Context}/Namespaces/{id}

Use the "id" for the Namespace 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 Namespace Request Info

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

Retrieve Namespace 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 Namespace Properties per include option.

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

RetrieveNamespace 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 Namespaces

Try me in Swagger

Request Body (JSON)

{
  "name": "string value"
}

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

// the modelPost structure is described in the Request Json 
async function postNamespaces( host, modelPost) {
   let requestUrl = host + '/api/0/Namespaces
   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 Namespace.

  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 Namespace Request Info

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

Post Namespace Contract Info

The POST request for Namespace contract has the following properties

Name Type
Name string

Add Namespace 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 Namespaces

Try me in Swagger

Request Body (JSON)

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

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

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

Saves the modification on the Namespace instance to the database.

Try me in Swagger

Change Namespace Request Info

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

Patch Namespace Contract Info

The Namespace properties for a PATCH requests are:

Name Type
Name string
Id int

Patch Namespace 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 Namespaces

Try me in Swagger

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

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

Deletes the Namespace instance from the database.

Delete Namespace Request Info

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

Delete Namespace 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.

User Interface

DirectoryEntries

Supported operations

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

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

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

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

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

A DirectoryEntry is classified as a 'FieldSet'. Fieldsets stores complex attribute data (against other entities).

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

The ObjectType identifier for DirectoryEntry is 16.

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

Searching DirectoryEntries

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

async function searchDirectoryEntries( host, include= 'Id', filter, order, startAt = 0, pageSize = 10) {
   let requestUrl = host + '/api/0/DirectoryEntries?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 DirectoryEntries using the EQL logic.

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

GET /api/{Context}/DirectoryEntries

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 DirectoryEntries 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 DirectoryEntry of interest.


Try me in EqlExplorer
Try me in Swagger

Search DirectoryEntry Request Info

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

Search DirectoryEntry 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 DirectoryEntry 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 DirectoryEntries

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

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

Response Body (JSON)

/* Sample request for DirectoryEntry */
{
  "object": {
    "type": 999,
    "id": 999
  },
  "directoryEntryType": {
    "name": "sample",
    "sysType": "sample",
    "scope": {
      "name": "sample",
      "id": 999
    },
    "id": 999
  },
  "body": "sample",
  "scope": {
    "name": "sample",
    "id": 999
  },
  "dateAdded": "2020-09-10T12:09:17.0587388+01:00",
  "addedBy": {
    "id": 999
  },
  "dateChanged": "2020-09-10T12:09:17.0588354+01:00",
  "changedBy": {
    "id": 999
  },
  "id": 999
}

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

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

GET /api/{Context}/DirectoryEntries/{id}

Use the "id" for the DirectoryEntry 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 DirectoryEntry Request Info

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

Retrieve DirectoryEntry 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 DirectoryEntry Properties per include option.

Retrieve Option Property Type
Header Id int
Header Object Object
Header Scope Scope
Header DirectoryEntryType DirectoryEntryType
Header Body string
AuditDetails AuditDetails List of AuditDetail
Header DateAdded DateTime?
Header AddedBy Person
Header DateChanged DateTime?
Header ChangedBy Person

RetrieveDirectoryEntry 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 DirectoryEntries

Try me in Swagger

Request Body (JSON)

{
  "object": {
    "type": 999,
    "id": 999
  },
  "directoryEntryType": {
    "id": 999
  },
  "body": "string value"
}

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

// the modelPost structure is described in the Request Json 
async function postDirectoryEntries( host, modelPost) {
   let requestUrl = host + '/api/0/DirectoryEntries
   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 DirectoryEntry.

  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 DirectoryEntry Request Info

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

Post DirectoryEntry Contract Info

The POST request for DirectoryEntry contract has the following properties

Name Type
Object IdTypePost
DirectoryEntryType IdPost
Body string

Add DirectoryEntry 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 DirectoryEntries

Try me in Swagger

Request Body (JSON)

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

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

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

Saves the modification on the DirectoryEntry instance to the database.

Try me in Swagger

Change DirectoryEntry Request Info

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

Patch DirectoryEntry Contract Info

The DirectoryEntry properties for a PATCH requests are:

Name Type
Body string
Id int

Patch DirectoryEntry 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 DirectoryEntries

Try me in Swagger

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

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

Deletes the DirectoryEntry instance from the database.

Delete DirectoryEntry Request Info

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

Delete DirectoryEntry 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.

Folders

Supported operations

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

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

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

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

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

A Folder is an 'Independent Object'.

A Folder 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 Folder supports Namespace identification.

The ObjectType identifier for Folder is 170.

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

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

Searching Folders

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

async function searchFolders( host, include= 'Id,Name', filter, order, startAt = 0, pageSize = 10) {
   let requestUrl = host + '/api/0/Folders?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 Folders using the EQL logic.

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

GET /api/{Context}/Folders

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 Folders 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 Folder of interest.


Try me in EqlExplorer
Try me in Swagger

Search Folder Request Info

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

Search Folder 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 Folder 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 Folders

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

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

Response Body (JSON)

/* Sample request for Folder */
{
  "addedBy": {
    "code": "sample",
    "surname": "sample",
    "firstName": "sample",
    "class": {
      "code": "sample",
      "id": 999,
      "name": "sample",
      "isSyncTracked": false
    },
    "scope": {
      "id": 999
    },
    "id": 999
  },
  "changedBy": {
    "code": "sample",
    "surname": "sample",
    "firstName": "sample",
    "class": {
      "code": "sample",
      "id": 999,
      "name": "sample",
      "isSyncTracked": false
    },
    "scope": {
      "id": 999
    },
    "id": 999
  },
  "dateAdded": "2020-09-10T12:09:17.1271033+01:00",
  "dateChanged": "2020-09-10T12:09:17.1272036+01:00",
  "description": "sample",
  "guid": "00000000-0000-0000-0000-000000000000",
  "hasData": "sample",
  "hasFlags": 9999,
  "id": 999,
  "name": "sample",
  "namespace": {
    "name": "sample",
    "id": 999
  },
  "parent": {
    "id": 999
  },
  "path": "sample",
  "permissionHint": 999,
  "scope": {
    "name": "sample",
    "id": 999
  }
}

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

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

GET /api/{Context}/Folders/{id}

Use the "id" for the Folder 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 Folder Request Info

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

Retrieve Folder 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 Folder Properties per include option.

Retrieve Option Property Type
Header Id int
Header Scope Scope
Header Namespace Namespace
Header Guid Guid?
Header Name string
Header Description string
AuditDetails AuditDetails List of AuditDetail
Securities Securities List of Security. Supported Filters
[StartAt=value]
[PageSize=value]
[Permission&=value]
Header Parent Folder
Header HasFlags long?
Header HasData string
Header PermissionHint int?
Children Children List of Folder. Supported Filters
[StartAt=value]
[PageSize=value]
KeyValues KeyValues List of ObjectKeyValue. Supported Filters
[Key=value]
[Key IN (comma delimited values)]
[StartAt=value]
[PageSize=value]
Header Path string
Header DateAdded DateTime?
Header AddedBy Person
Header DateChanged DateTime?
Header ChangedBy Person
Reports Reports List of FolderReport. Supported Filters
[StartAt=value]
[PageSize=value]
[ReportType=value]
[ReportType IN (comma delimited values)]
UrlPages UrlPages List of UrlPage. Supported Filters
[StartAt=value]
[PageSize=value]
Documents Documents List of FolderDocument. Supported Filters
[StartAt=value]
[PageSize=value]
Files Files List of FolderFile. Supported Filters
[StartAt=value]
[PageSize=value]
VirtualItemGroups VirtualItemGroups List of FolderVirtualItemGroup. Supported Filters
[StartAt=value]
[PageSize=value]
GroupedVirtualItems GroupedVirtualItems List of FolderGroupedVirtualItem. Supported Filters
[StartAt=value]
[PageSize=value]
VirtualItems VirtualItems List of FolderVirtualItem. Supported Filters
[StartAt=value]
[PageSize=value]
Persons Persons List of FolderPerson. Supported Filters
[StartAt=value]
[PageSize=value]
Organizations Organizations List of FolderOrganization. Supported Filters
[StartAt=value]
[PageSize=value]
Locations Locations List of FolderLocation. Supported Filters
[StartAt=value]
[PageSize=value]
Projects Projects List of FolderProject. Supported Filters
[StartAt=value]
[PageSize=value]
SerializedItems SerializedItems List of FolderSerializedItem. Supported Filters
[StartAt=value]
[PageSize=value]
PhysicalItems PhysicalItems List of FolderPhysicalItem. Supported Filters
[StartAt=value]
[PageSize=value]
Events Events List of FolderEvent. Supported Filters
[StartAt=value]
[PageSize=value]
Tags Tags List of FolderTag. Supported Filters
[StartAt=value]
[PageSize=value]
AutoFilingRules AutoFilingRules List of ObjectDataset. Supported Filters
[StartAt=value]
[PageSize=value]
ChangeRequests ChangeRequests List of FolderChangeRequest. Supported Filters
[StartAt=value]
[PageSize=value]
Modifications Modifications List of FolderModification. Supported Filters
[StartAt=value]
[PageSize=value]
DeviationWaivers DeviationWaivers List of FolderDeviationWaiver. Supported Filters
[StartAt=value]
[PageSize=value]
DistributionOrders DistributionOrders List of FolderDistributionOrder. Supported Filters
[StartAt=value]
[PageSize=value]
WorkOrders WorkOrders List of FolderWorkOrder. Supported Filters
[StartAt=value]
[PageSize=value]
WorkTasks WorkTasks List of FolderWorkTask. Supported Filters
[StartAt=value]
[PageSize=value]
Tasks Tasks List of FolderTask. Supported Filters
[StartAt=value]
[PageSize=value]
Transmittals Transmittals List of FolderTransmittal. Supported Filters
[StartAt=value]
[PageSize=value]
DispositionOrders DispositionOrders List of FolderDispositionOrder. Supported Filters
[StartAt=value]
[PageSize=value]
Pricelists Pricelists List of FolderPricelist. Supported Filters
[StartAt=value]
[PageSize=value]
Contracts Contracts List of FolderContract. Supported Filters
[StartAt=value]
[PageSize=value]
Conditions Conditions List of FolderCondition. Supported Filters
[StartAt=value]
[PageSize=value]
Budgets Budgets List of FolderBudget. Supported Filters
[StartAt=value]
[PageSize=value]
TaskOrders TaskOrders List of FolderTaskOrder. Supported Filters
[StartAt=value]
[PageSize=value]
Programs Programs List of FolderProgram. Supported Filters
[StartAt=value]
[PageSize=value]
ProjectWiseItemRefs ProjectWiseItemRefs List of ProjectWiseItem. Supported Filters
[StartAt=value]
[PageSize=value]
CopyOptions CopyOptions List of CopyOption. Supported Filters
[HasData=value]
SyncScopes SyncScopes List of SyncScope. Supported Filters
[StartAt=value]
[PageSize=value]

RetrieveFolder 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 Folders

Try me in Swagger

Request Body (JSON)

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

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

// the modelPost structure is described in the Request Json 
async function postFolders( host, modelPost) {
   let requestUrl = host + '/api/0/Folders
   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 Folder.

  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 Folder Request Info

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

Post Folder Contract Info

The POST request for Folder contract has the following properties

Name Type
Parent IdPost
Name string
Description string

Add Folder 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 Folders

Try me in Swagger

Request Body (JSON)

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

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

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

Saves the modification on the Folder instance to the database.

Try me in Swagger

Change Folder Request Info

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

Patch Folder Contract Info

The Folder properties for a PATCH requests are:

Name Type
Name string
Description string
Parent IdPatch
Id int

Patch Folder 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.

VerticalMenuItems

Supported operations

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

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

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

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

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

Searching VerticalMenuItems

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

async function searchVerticalMenuItems( host, include= 'Id', filter, order, startAt = 0, pageSize = 10) {
   let requestUrl = host + '/api/0/VerticalMenuItems?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 VerticalMenuItems using the EQL logic.

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

GET /api/{Context}/VerticalMenuItems

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 VerticalMenuItems 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 VerticalMenuItem of interest.


Try me in EqlExplorer
Try me in Swagger

Search VerticalMenuItem Request Info

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

Search VerticalMenuItem 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 VerticalMenuItem 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 VerticalMenuItems

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

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

Response Body (JSON)

/* Sample request for VerticalMenuItem */
{
  "verticalMenu": {
    "id": 999,
    "name": "sample",
    "propertyName": "sample",
    "sequence": 999
  },
  "source": {
    "classGroup": {
      "objectType": 999,
      "id": 999
    },
    "code": "sample",
    "id": 999,
    "isSyncTracked": false
  },
  "target": {
    "classGroup": {
      "objectType": 999,
      "id": 999
    },
    "code": "sample",
    "id": 999,
    "isSyncTracked": false
  },
  "sequence": 999,
  "id": 999
}

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

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

GET /api/{Context}/VerticalMenuItems/{id}

Use the "id" for the VerticalMenuItem 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 VerticalMenuItem Request Info

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

Retrieve VerticalMenuItem 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 VerticalMenuItem Properties per include option.

Retrieve Option Property Type
Header Id int
Header VerticalMenu VerticalMenu
Header Source Class
Header Target Class
Header Sequence int?
Header DateAdded DateTime?
Header AddedBy Person
Header DateChanged DateTime?
Header ChangedBy Person
AuditDetails AuditDetails List of AuditDetail

RetrieveVerticalMenuItem 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 VerticalMenuItems

Try me in Swagger

Request Body (JSON)

{
  "verticalMenu": {
    "id": 999
  },
  "source": {
    "id": 999
  },
  "target": {
    "id": 999
  },
  "sequence": 999
}

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

// the modelPost structure is described in the Request Json 
async function postVerticalMenuItems( host, modelPost) {
   let requestUrl = host + '/api/0/VerticalMenuItems
   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 VerticalMenuItem.

  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 VerticalMenuItem Request Info

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

Post VerticalMenuItem Contract Info

The POST request for VerticalMenuItem contract has the following properties

Name Type
VerticalMenu IdPost
Source IdPost
Target IdPost
Sequence int

Add VerticalMenuItem 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 VerticalMenuItems

Try me in Swagger

Request Body (JSON)

{
  "sequence": 999,
  "id": 999
}

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

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

Try me in Swagger

Change VerticalMenuItem Request Info

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

Patch VerticalMenuItem Contract Info

The VerticalMenuItem properties for a PATCH requests are:

Name Type
Sequence int
Id int

Patch VerticalMenuItem 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 VerticalMenuItems

Try me in Swagger

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

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

Delete VerticalMenuItem Request Info

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

Delete VerticalMenuItem 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.

Idenfitication

Id, Type

Guid

Alternative numbers

Code

Named Relationships