Skip to main content
Version: v4.6

Named User Collections

Note: The nsfilter (namespace filter) query parameter is mandatory for every request. It sets the context, helping you look up resources within that namespace. Example: GET /itemsvc/api/v1/nameduseritems?nsfilter=proj_DrZrSNrW

Create Named User Collections

Create one or more NamedUserCollection class objects in the Item Service.

Endpoints

POST /itemsvc/api/v1/nameduseritems

Request

Query parameters

ParameterTypeDescriptionRequired
transactionalStringSet to true to make the request transactional.Optional
nsfilterStringnamespace contextRequired

Request body

ParameterTypeDescriptionRequired
_nameStringReadable long-form nameRequired
_shortNameStringAn abbreviated name up to 22 characters that is used for referenceRequired
_descriptionStringDescribes the purpose of the NamedUserCollectionRequired
_namespacesStringAn array of namespaces you want to add the NamedUserCollection toRequired
_userTypeStringA user-defined type for the NamedUserCollection that you can use to distinguish or group it by.Required
_itemClassStringEnter "NamedUserCollection".Required
_version._userAttributesObjectAdd an object with user-defined properties and their values.Required
_encryptionEnabledBooleanDetermines if encryption will be enabled. If set to True then any related items in the NamedUserCollection prefixed with a "." will be encrypted.Optional, Default is False

Note: The encryptionEnabled parameter was introduced in Release 4.3. For more information on using this encryption feature, refer to Named User Collection in the Concepts section.

Request body example
[
{
"_name": "General Medical Architecture Type Properties",
"_shortName": "gmaeltypes",
"_description": "General Medical Architecture model Properties Types",
"_itemClass": "NamedUserCollection",
"_namespaces": [
"lntpurelocal_Xw6AQru7"
],
"_userType": "bim_props_types",
"_version": {
"_userAttributes": {
"confi1": "60"
}
}
},
{
"_name": "General Medical Architecture Type Properties",
"_shortName": "gmaelelements",
"_description": "General Medical Architecture model Properties Types",
"_itemClass": "NamedUserCollection",
"_namespaces": [
"lntpurelocal_Xw6AQru7"
],
"_userType": "bim_props_elem"
}
]

Response

Response codes

CodeDescription
201Created
400Bad Request

Response example

{
"_pageSize": 2,
"_list": [
{
"_uri": "/nameduseritems/5cefbc834fee68402c254f91",
"_name": "General Medical Architecture Type Properties",
"_userType": "bim_props_types",
"_tipId": "5cefbc834fee68402c254f92",
"_versions": [
{
"_userAttributes": {
"confi1": "60"
},
"_userItemDbId": "5cefbc834fee68402c254f91",
"_id": "5cefbc834fee68402c254f92",
"_isTip": true,
"_metadata": {
"_updatedById": "17285382-7f67-4b04-b231-bcdca454ed2c",
"_createdAt": 1559215235168,
"_createdById": "17285382-7f67-4b04-b231-bcdca454ed2c",
"_updatedAt": 1559215235168
},
"_version": 1
}
],
"_irn": "itemsvc:nameduseritem:5cefbc834fee68402c254f91",
"_namespaces": [
"lntpurelocal_Xw6AQru7"
],
"_nextVersion": 2,
"_shortName": "gmaeltypes",
"_tipVersion": 1,
"_versionsCount": 1,
"_itemClass": "NamedUserCollection",
"_userItemId": "gmaeltypes_9TyoEcA2r2",
"_id": "5cefbc834fee68402c254f91",
"_description": "General Medical Architecture model Properties Types",
"_metadata": {
"_updatedById": "17285382-7f67-4b04-b231-bcdca454ed2c",
"_createdAt": 1559215235161,
"_createdById": "17285382-7f67-4b04-b231-bcdca454ed2c",
"_updatedAt": 1559215235161
},
"_kind": "collection",
"_encryptionEnabled":false
},
{
"_uri": "/nameduseritems/5cefbc834fee68402c254f93",
"_name": "General Medical Architecture Type Properties",
"_userType": "bim_props_elem",
"_tipId": "5cefbc834fee68402c254f94",
"_versions": [
{
"_userItemDbId": "5cefbc834fee68402c254f93",
"_id": "5cefbc834fee68402c254f94",
"_isTip": true,
"_metadata": {
"_updatedById": "17285382-7f67-4b04-b231-bcdca454ed2c",
"_createdAt": 1559215235168,
"_createdById": "17285382-7f67-4b04-b231-bcdca454ed2c",
"_updatedAt": 1559215235168
},
"_version": 1
}
],
"_irn": "itemsvc:nameduseritem:5cefbc834fee68402c254f93",
"_namespaces": [
"lntpurelocal_Xw6AQru7"
],
"_nextVersion": 2,
"_shortName": "gmaelelements",
"_tipVersion": 1,
"_versionsCount": 1,
"_itemClass": "NamedUserCollection",
"_userItemId": "gmaelelements_YHW0uRMceg",
"_id": "5cefbc834fee68402c254f93",
"_description": "General Medical Architecture model Properties Types",
"_metadata": {
"_updatedById": "17285382-7f67-4b04-b231-bcdca454ed2c",
"_createdAt": 1559215235162,
"_createdById": "17285382-7f67-4b04-b231-bcdca454ed2c",
"_updatedAt": 1559215235162
},
"_kind": "collection",
"_encryptionEnabled":false
}
],
"_offset": 0,
"_total": 2
}

Get All Named User Collections

Returns all NamedUserCollection class object in the Item Service. You can optionally filter your request with a query.

Endpoints

GET /itemsvc/api/v1/nameduseritems

Request

Query parameters

ParameterTypeDescriptionRequired
queryObjectPass a query object with query parameters and values based on the NamedUserCollection class. You can also use query operators. To query all versions of NamedUserCollections rather than just the latest versions, add the query property and value _versions.all: true. For query examples, see Query parameter examples.Optional
projectObjectField projections to exclude or include fields in the response, for example, project={"_metadata":0}.Optional
pageObjectPass a Page object that defines the response pagination, for example, ?page={"_offset": 0, "_pageSize" 100}Optional
sortObjectPass a sort object to define the response sort order by a given property, using 1 for ascending sort and -1 for descending sort, for example, ?sort={"_name":1}Optional
userItemVersionIdObjectLookup RelatedItems for a given NamedUserCollection version, rather than the current version.Optional
nsfilterStringnamespace contextRequired
Request examples
// Search by name for the tip versions only

GET /itemsvc/api/v1/nameduseritems?query={"_name": "General Medical Architecture"}

// Search by _itemClass including all versions

GET /itemsvc/api/v1/nameduseritems?query={"_itemClass": "NamedUserCollection","_versions.all":true}

// Searches by _itemClass and _userAttributes including all versions

GET /itemsvc/api/v1/nameduseritems?query={"$and": [{"_itemClass": "NamedUserCollection"},{"_versions._userAttributes.key":"value"}],"_versions.all":true}

// Searches by _itemClass and _userAttributes for latest versions only

GET /itemsvc/api/v1/nameduseritems?query={"$and": [{"_itemClass": "NamedUserCollection"},{"_versions._userAttributes.key":"value":"value"}]}

Response

Response codes

CodeDescription
200Success

Response example

{
"_pageSize": 1,
"_list": [
{
"_uri": "/nameduseritems/5cee7fee6505d6286dbca468",
"_name": "11_new_elem_props",
"_userType": "rvt_element_props",
"_tipId": "5cee80c1fa298d0d3e34e23a",
"_versions": [
{
"_userItemDbId": "5cee7fee6505d6286dbca468",
"_id": "5cee80c1fa298d0d3e34e23a",
"_isTip": true,
"_metadata": {
"_updatedById": "17285382-7f67-4b04-b231-bcdca454ed2c",
"_createdAt": 1559134190147,
"_createdById": "17285382-7f67-4b04-b231-bcdca454ed2c",
"_updatedAt": 1559134190147
},
"_version": 1
}
],
"_irn": "itemsvc:nameduseritem:5cee7fee6505d6286dbca468",
"_namespaces": [
"lntpurelocal_Xw6AQru7"
],
"_nextVersion": 2,
"_shortName": "11_new_elprops",
"_tipVersion": 1,
"_versionsCount": 1,
"_itemClass": "NamedUserCollection",
"_userItemId": "11_new_elprops_qagnj32kE7",
"_id": "5cee7fee6505d6286dbca468",
"_description": "Element Props in BA model",
"_metadata": {
"_updatedById": "17285382-7f67-4b04-b231-bcdca454ed2c",
"_createdAt": 1559134190147,
"_createdById": "17285382-7f67-4b04-b231-bcdca454ed2c",
"_updatedAt": 1559134190147
},
"_kind": "collection",
"_encryptionEnabled":false
}
],
"_offset": 0,
"_total": 1
}

Get Named User Collection by ID

Gets a NamedUserCollection by its id.

Endpoints

GET /itemsvc/api/v1/nameduseritems/{id}

Request

Path parameters

ParameterTypeDescriptionRequired
idStringPass the NamedUserCollection _id or _userItemId value.Required

Query parameters

ParameterTypeDescriptionRequired
projectStringField projections to exclude or include fields in the response, for example, project={"_metadata":0}.Optional
nsfilterStringnamespace contextRequired

Request example

GET /itemsvc/api/v1/nameduseritems/5cee7fee6505d6286dbca468?project={"_metadata":0}

Response

Response codes

CodeDescription
200Success
404File Not Found

Response example

{
"_uri": "/nameduseritems/5cee7fee6505d6286dbca468",
"_name": "11_new_elem_props",
"_userType": "rvt_element_props",
"_tipId": "5cee80c1fa298d0d3e34e23a",
"_versions": [
{
"_userItemDbId": "5cee7fee6505d6286dbca468",
"_id": "5cee80c1fa298d0d3e34e23a",
"_isTip": true,
"_metadata": {
"_updatedById": "17285382-7f67-4b04-b231-bcdca454ed2c",
"_createdAt": 1559134190147,
"_createdById": "17285382-7f67-4b04-b231-bcdca454ed2c",
"_updatedAt": 1559134190147
},
"_version": 1
}
],
"_irn": "itemsvc:nameduseritem:5cee7fee6505d6286dbca468",
"_namespaces": [
"lntpurelocal_Xw6AQru7"
],
"_nextVersion": 2,
"_shortName": "11_new_elprops",
"_tipVersion": 1,
"_versionsCount": 1,
"_itemClass": "NamedUserCollection",
"_userItemId": "11_new_elprops_qagnj32kE7",
"_id": "5cee7fee6505d6286dbca468",
"_description": "Element Props in BA model",
"_metadata": {
"_updatedById": "17285382-7f67-4b04-b231-bcdca454ed2c",
"_createdAt": 1559134190147,
"_createdById": "17285382-7f67-4b04-b231-bcdca454ed2c",
"_updatedAt": 1559134190147
},
"_kind": "collection",
"_encryptionEnabled":false
}

Delete Named User Collection by Id

Deletes a NamedUserCollection when you pass its id

Endpoints

DELETE /itemsvc/api/v1/nameduseritems/{id}

Request

Query parameters

ParameterTypeDescriptionRequired
transactionalStringSet to true to make the request transactional.Optional
nsfilterStringnamespace contextRequired

Path parameters

ParameterTypeDescriptionRequired
idStringPass the NamedUserCollection _id or _userItemId value.Required

Request example

GET /itemsvc/api/v1/nameduseritems/5cee7fee6505d6286dbca468

Response

Response codes

CodeDescription
200Success
404File Not Found

Response body

None

Edit Named User Collection by Id

Updates a NamedUserCollection by id when you pass the updates in the request body. Only editable fields update and the other fields are ignored, even if passed in the request body.

Endpoints

PUT /itemsvc/api/v1/nameduseritems/{id}

Request

Path parameters

ParameterTypeDescriptionRequired
idStringPass the NamedUserCollection _id or _userItemId value.Required

Body

ParameterTypeDescriptionRequired
_nameStringReadable long-form nameRequired
_descriptionStringDescribes the purpose of the NamedUserCollectionRequired
_namespacesStringAn array of namespaces you want to add the NamedUserCollection toRequired
_userTypeStringA user-defined type for the NamedUserCollection that you can use to distinguish or group it by.Required

Body example

{
"_name": "General Medical Architecture Geometry Resources",
"_namespaces": [
"smpltrnsfrnws_c2jkTllb"
],
"_description": "General Medical Architecture Geometry Resources"
}

Response

Response codes

CodeDescription
204No Content
404File Not Found

Response body

None

Endpoints

POST /itemsvc/api/v1/nameduseritems/{id}/relateditems

Request

Path parameters

ParameterTypeDescriptionRequired
idStringPass the NamedUserCollection _id or _userItemId value.Required

Query parameters

ParameterTypeDescriptionRequired
userItemVersionIdStringPass the userItemVersionId to target a specific NamedUserCollection version.Optional
transactionalStringSet to true to make the request transactional.Optional
nsfilterStringnamespace contextRequired

Body parameters

ParameterTypeDescriptionRequired
_relationshipsArray of StringArray of Relationship objects to create with the NamedUserCollection as the parent and the _relationships array containing references to child RelatedItems.Optional
_relationships._relatedUserItemVersionIdStringInstead of the default lookup of the latest RelatedItem version, pass a version id to look up child RelatedItems for a specific version.Optional
Body example
[
{
"source_index": "accounts-4",
"source_guid": "ac6d5fd7-5914-4996-b537-567f2f84e3aa-00039e2b",
"source_id": 2038,
"_relationships": [
{
"_relatedUserItemDbId": "5cee7fee6505d6286dbca469",
"_relatedUserItemVersionId": "5cee80c1fa298d0d3e34e23b",
"_relatedToIds": [
"5cee7fe8c27e69cd0209ef46",
"5cee7fe8c27e69cd0209ef47",
"5cee7fe8c27e69cd0209ef48"
]
}
]
}
]

Response

Response codes

CodeDescription
201Created
400Bad Request

Response data example

{
"_pageSize": 1,
"_list": [
{
"source_guid": "ac6d5fd7-5914-4996-b537-567f2f84e3aa-00039e2b",
"_guid": "7a7d723f-3a30-4511-9823-8a56fb48276a",
"source_id": 2038,
"_id": "59afd81ebae18c0223448eb2",
"source_index": "accounts-4",
"_metadata": {
"_updatedById": "d73abe56-b1a8-489a-9020-eb0bb1af4660",
"_createdByName": "Amogh Chitnis",
"_createdAt": 1504696350504,
"_updatedByName": "Amogh Chitnis",
"_createdById": "d73abe56-b1a8-489a-9020-eb0bb1af4660",
"_updatedAt": 1504696350504
}
}
],
"_offset": 0,
"_total": 1,
"_includeTotal": false
}

Add up to 10MB in total of RelatedItem class objects in the request body.

Endpoints

POST /itemsvc/api/v1/nameduseritems/{id}/relateditems/bulk

Request

Path parameters

ParameterTypeDescriptionRequired
idStringPass the NamedUserCollection _id or _userItemId value.Required

Query parameters

ParameterTypeDescriptionRequired
userItemVersionIdStringPass the NamedUserCollection userItemVersionId if you want to add to a specific version.Optional
nsfilterStringnamespace contextRequired

Body parameters

ParameterTypeDescriptionRequired
_relationshipsArray of RelationshipArray of Relationship objects to create with the NamedUserCollection as the parent and the _relationships array containing references to child RelatedItems.Optional
_relationships._relatedUserItemVersionIdStringInstead of the default lookup of the latest RelatedItem version, pass a version id to look up child RelatedItems for a specific version.Optional
Body example
[
{
"source_index": "accounts-4",
"source_guid": "ac6d5fd7-5914-4996-b537-567f2f84e3aa-00039e2b",
"source_id": 2038,
"_relationships": [
{
"_relatedUserItemDbId": "5cee7fee6505d6286dbca469",
"_relatedUserItemVersionId": "5cee80c1fa298d0d3e34e23b",
"_relatedToIds": [
"5cee7fe8c27e69cd0209ef46",
"5cee7fe8c27e69cd0209ef47",
"5cee7fe8c27e69cd0209ef48"
]
}
]
}
]

Response

Response codes

CodeDescription
201Created
202Accepted
400Bad Request

Response header

Contains a URL to poll the status of the request

Endpoints

GET /itemsvc/api/v1/nameduseritems/{id}/relateditems

Request

Path parameters

ParameterTypeDescriptionRequired
idStringPass the NamedUserCollection _id or _userItemId value.Required

Query parameters

ParameterTypeDescriptionRequired
queryObjectPass a query object with query parameters and values based on the RelatedItem class. You can also use query operators. For query examples, see Query parameter examples.Optional
projectObjectField projections to exclude or include fields in the response, for example, project={"_metadata":0}.Optional
pageObjectPass a Page object that defines the response pagination, for example, ?page={"_offset": 0, "_pageSize" 100}Optional
sortObjectPass a sort object to define the response sort order by a given property, using 1 for ascending sort and -1 for descending sort, for example, ?sort={"_name":1}Optional
userItemVersionIdObjectLookup RelatedItems for a given NamedUserCollection version, rather than the current version.Optional
nsfilterStringnamespace contextRequired
Request example

GET /itemsvc/api/v1/nameduseritems/5cee7fee6505d6286dbca469/relateditems/?query={"name": "item1"}

Response

Response codes

CodeDescription
200Success
400Bad Request
404File Not Found

Response data

{
"_pageSize": 4,
"_list": [
{
"viewableResources": [
"5cee803a6505d6286dbca522"
],
"aspect": "View3d",
"_id": "5cee80456505d6286dbca526",
"id": "7c8c0acd-59da-41e2-a4c2-940817681fdf",
"title": "3D View: {3D}",
"_metadata": {
"_updatedById": "17285382-7f67-4b04-b231-bcdca454ed2c",
"_createdAt": 1559134277943,
"_createdById": "17285382-7f67-4b04-b231-bcdca454ed2c",
"_updatedAt": 1559134277943
},
"properties": {
"bbox": [
-14.401161193847656,
-9.856366157531738,
-1,
14.598838806152344,
19.143634796142578,
28.825000762939453
],
"numElements": 42
}
},
{
"viewableResources": [
"5cee80406505d6286dbca524"
],
"aspect": "View2d",
"resources": [
"5cee80376505d6286dbca521",
"5cee80436505d6286dbca525"
],
"_id": "5cee80456505d6286dbca527",
"id": "726a41d7-07ec-426c-ac7f-872d79214b30",
"title": "Floor Plan: First Floor",
"_metadata": {
"_updatedById": "17285382-7f67-4b04-b231-bcdca454ed2c",
"_createdAt": 1559134277943,
"_createdById": "17285382-7f67-4b04-b231-bcdca454ed2c",
"_updatedAt": 1559134277943
}
},
{
"source_guid": "ac6d5fd7-5914-4996-b537-567f2f84e3aa-00039e2b",
"_id": "5cefc0c04fee68402c254f95",
"source_id": 2038,
"source_index": "accounts-4",
"_metadata": {
"_updatedById": "17285382-7f67-4b04-b231-bcdca454ed2c",
"_createdAt": 1559216320545,
"_createdById": "17285382-7f67-4b04-b231-bcdca454ed2c",
"_updatedAt": 1559216320545
}
},
{
"source_guid": "ac6d5fd7-5914-4996-b537-567f2f84e3aa-00039e2b",
"_id": "5cefc0fc4fee68402c254f9a",
"source_id": 2038,
"source_index": "accounts-4",
"_metadata": {
"_updatedById": "17285382-7f67-4b04-b231-bcdca454ed2c",
"_createdAt": 1559216380549,
"_createdById": "17285382-7f67-4b04-b231-bcdca454ed2c",
"_updatedAt": 1559216380549
}
}
],
"_offset": 0,
"_total": 4
}

Endpoints

PUT /itemsvc/api/v1/nameduseritems/{id}/relateditems/{relatedItemId}

Request

Path parameters

ParameterTypeDescriptionRequired
idStringPass the NamedUserCollection _id or _userItemId value.Required
relatedItemIdStringPass the RelatedItem _id value.Required

Query parameters

ParameterTypeDescriptionRequired
userItemVersionIdStringPass the RelatedItem userItemVersionId if you want to update a specific version.Optional
nsfilterStringnamespace contextRequired

Body

Pass the entire updated RelatedItem as this API replaces the complete object in the database.

Body example
{
"source_guid": "933c4a06-93b8-11d3-80f8-00c04f8efc32-0000001e",
"_guid": "0f263950-a00b-4d4b-9da2-969da7d72b38",
"name": "GROUND FLOOR::Levels",
"source_type_id": 1,
"_id": "5a4c95413fd85b619e3d4e0e",
"source_id": 6,
"package_id": 322,
"_metadata": {
"_updatedById": "19ca3190-f5e8-4ea0-b3e4-791071baf33f",
"_createdByName": "Developer Test",
"_createdAt": 1514968386233,
"_updatedByName": "Developer Test",
"_createdById": "19ca3190-f5e8-4ea0-b3e4-791071baf33f",
"_updatedAt": 1514968386233
},
"param1": "value1"
}

Response

Response codes

CodeDescription
200Success
400Bad Request
404File Not Found

Response data

Responds with the updated database object.

{
"_uri": "/nameduseritems/5a4c953f3fd85b619e3d4e08/relateditems/5a4c95413fd85b619e3d4e0e",
"source_guid": "933c4a06-93b8-11d3-80f8-00c04f8efc32-0000001e",
"_guid": "0f263950-a00b-4d4b-9da2-969da7d72b38",
"name": "GROUND FLOOR::Levels",
"source_type_id": 1,
"_id": "5a4c95413fd85b619e3d4e0e",
"source_id": 6,
"package_id": 322,
"_metadata": {
"_updatedById": "19ca3190-f5e8-4ea0-b3e4-791071baf33f",
"_createdByName": "Developer Test",
"_createdAt": 1514968386233,
"_updatedByName": "Developer Test",
"_createdById": "19ca3190-f5e8-4ea0-b3e4-791071baf33f",
"_updatedAt": 1514968386233
},
"param1": "value1"
}

Endpoints

PUT /itemsvc/api/v1/nameduseritems/{id}/relateditems

Request

Path parameters

ParameterTypeDescriptionRequired
idStringPass the NamedUserCollection _id or _userItemId value.Required
relatedItemIdStringPass the RelatedItem _id value.Required

Query parameters

ParameterTypeDescriptionRequired
userItemVersionIdStringPass the RelatedItem userItemVersionId if you want to update a specific version.
partialUpdateBooleanSet to true to upsert only the fields you pass in the body. By default, this is set to false and the RelatedItems you pass in the body overwrite the entire RelatedItem in the database.
nsfilterStringnamespace contextRequired

Request body

The following example passes partially updated RelatedItem objects with partialUpdate is set to true.

Request body example
[
{
"source_guid": "284d66bf-3787-416f-a841-7b9207694f07-000683ab",
"_guid": "3e79d019-4026-4efe-b8e2-02bb2064762f",
"_id": "5b0be491e6941362719dbdc1",
"source_id": 806,
"package_id": 400
},
{
"source_guid": "34647296-1329-4d04-80dd-30569ca6cd57-00032a4a",
"_guid": "39001dd4-cc82-428f-b4b2-7c9d1d6cbae6",
"_id": "5b0be491e6941362719dbdde",
"source_id": 1264,
"package_id": 400
},
{
"source_guid": "8dbd8b58-f1b7-4fcd-aee6-f806f1de8b2a-00028857",
"_guid": "deb0719e-af73-427a-90d0-472994d5c810",
"_id": "5b0be491e6941362719dbe0a",
"source_id": 1790,
"package_id": 400
},
{
"source_guid": "8dbd8b58-f1b7-4fcd-aee6-f806f1de8b2a-000291b0",
"_guid": "6f5d627d-34e6-40b3-bc07-ec74bef0f806",
"_id": "5b0be491e6941362719dbe2b",
"source_id": 1816,
"package_id": 400
},
{
"source_guid": "50b307af-0394-4336-a2cd-f953e00b2d4a-00033f3d",
"_guid": "2373ac70-2151-4ad9-8fd4-6a182a6ba481",
"_id": "5b0be491e6941362719dbe49",
"source_id": 1835,
"package_id": 400
}
]

Response

Response codes

CodeDescription
204No Content
404File Not Found

Response data

None

Endpoints

PUT /itemsvc/api/v1/nameduseritems/{id}/relateditems/bulk

Request

Path parameters

ParameterTypeDescriptionRequired
idStringPass the NamedUserCollection _id or _userItemId value.Required

Query parameters

ParameterTypeDescriptionRequired
userItemVersionIdStringPass the RelatedItem userItemVersionId if you want to update a specific version.
partialUpdateBooleanSet to true to upsert only the fields you pass in the body. By default, this is set to false and the RelatedItems you pass in the body overwrite the entire RelatedItem in the database.
nsfilterStringnamespace contextRequired

Body

Pass up to 10MB of updated RelatedItems. The following example passes partially updated RelatedItem objects with partialUpdate is set to true.

Body example
[
{
"source_guid": "284d66bf-3787-416f-a841-7b9207694f07-000683ab",
"_guid": "3e79d019-4026-4efe-b8e2-02bb2064762f",
"_id": "5b0be491e6941362719dbdc1",
"source_id": 806,
"package_id": 400
},
{
"source_guid": "34647296-1329-4d04-80dd-30569ca6cd57-00032a4a",
"_guid": "39001dd4-cc82-428f-b4b2-7c9d1d6cbae6",
"_id": "5b0be491e6941362719dbdde",
"source_id": 1264,
"package_id": 400
},
{
"source_guid": "8dbd8b58-f1b7-4fcd-aee6-f806f1de8b2a-00028857",
"_guid": "deb0719e-af73-427a-90d0-472994d5c810",
"_id": "5b0be491e6941362719dbe0a",
"source_id": 1790,
"package_id": 400
},
{
"source_guid": "8dbd8b58-f1b7-4fcd-aee6-f806f1de8b2a-000291b0",
"_guid": "6f5d627d-34e6-40b3-bc07-ec74bef0f806",
"_id": "5b0be491e6941362719dbe2b",
"source_id": 1816,
"package_id": 400
},
{
"source_guid": "50b307af-0394-4336-a2cd-f953e00b2d4a-00033f3d",
"_guid": "2373ac70-2151-4ad9-8fd4-6a182a6ba481",
"_id": "5b0be491e6941362719dbe49",
"source_id": 1835,
"package_id": 400
}
]

Response

Response codes

CodeDescription
202Accepted
400Bad Request
404File Not Found

Response header

Contains a URL to poll the status of the request

Endpoints

DELETE /itemsvc/api/v1/nameduseritems/{id}/relateditems/{relatedItemId}

Request

Path parameters

ParameterTypeDescriptionRequired
idStringPass the NamedUserCollection _id or _userItemId value.Required
relatedItemIdStringPass the RelatedItem _id or _userItemId value.Required

Query parameters

ParameterTypeDescriptionRequired
userItemVersionIdStringPass the RelatedItem userItemVersionId if you want to delete a specific version.Optional
nsfilterStringnamespace contextRequired

Response

Response codes

CodeDescription
204No Content
404File Not Found

Response data

None

Endpoints

DELETE /itemsvc/api/v1/nameduseritems/{id}/relateditems

Request

Path parameters

ParameterTypeDescriptionRequired
idStringPass the NamedUserCollection _id or _userItemId value.Required

Query parameters

ParameterTypeDescriptionRequired
userItemVersionIdStringPass the RelatedItem userItemVersionId if you want to update a specific version.Optional
nsfilterStringnamespace contextRequired

Body

Pass an array of RelatedItem ids

Body example
[
"5b0be1c3e6941362719d4a00",
"5b0be1c3e6941362719d4a10"
]

Response

Response codes

CodeDescription
204No Content
404File Not Found

Response data

None

Endpoints

DELETE /itemsvc/api/v1/nameduseritems/{id}/relateditems/bulk

Request

Path parameters

ParameterTypeDescriptionRequired
idStringPass the NamedUserCollection _id or _userItemId value.Required

Query parameters

ParameterTypeDescriptionRequired
queryObjectPass a query object with query parameters and values based on the RelatedItem class. You can also use query operators. For query examples, see Query parameter examples.Required
userItemVersionIdStringPass the RelatedItem userItemVersionId if you want to update a specific version.Optional
nsfilterStringnamespace contextRequired

Response

Response codes

CodeDescription
202Accepted
404File Not Found

Response data

None

Endpoints

GET /itemsvc/api/v1/nameduseritems/{id}/relateditems/{relatedItemId}

Request

Path parameters

ParameterTypeDescriptionRequired
idStringPass the NamedUserCollection _id or _userItemId value.Required
relatedItemIdStringPass the RelatedItem _id or _userItemId value.Required

Query parameters

ParameterTypeDescriptionRequired
userItemVersionIdStringPass the RelatedItem userItemVersionId if you want to update a specific version.Optional
projectObjectField projections to exclude or include fields in the response, for example, project={"_metadata":0}.Optional
nsfilterStringnamespace contextRequired

Response

Response codes

CodeDescription
200Success
404File Not Found

Response

{
"property_set_source_field": "",
"_guid": "f90099dd-a0b5-4ab8-97da-fd2283f6ba2e",
"property_set": "Object Properties",
"datatype": "STRING",
"display": "Revit Class",
"typeproperty": true,
"is_editable": false,
"_id": "59afd92fbae18c0223448eb5",
"source_field_name": "REVIT_CLASS",
"_metadata": {
"_updatedById": "a592be4e-0fb6-4518-b193-c5da4f48f5b5",
"_createdByName": "Amogh Chitnis",
"_createdAt": 1504698614010,
"_updatedByName": "Amogh Chitnis",
"_createdById": "a592be4e-0fb6-4518-b193-c5da4f48f5b5",
"_updatedAt": 1504698614010
},
"value": {
"as_string": "Autodesk.Revit.DB.FamilyInstance"
}
}

Add relationships Across Collections

Add relationships between a RelatedItem in one NamedUserCollection to one or more RelatedItems in other NamedUserCollection.

Endpoints

PUT /itemsvc/api/v1/nameduseritems/{id}/relationships

Request

Path parameters

ParameterTypeDescriptionRequired
idStringPass the NamedUserCollection _id or _userItemId value.Required

Query parameters

ParameterTypeDescriptionRequired
userItemVersionIdStringPass the RelatedItem userItemVersionId if you want to update a specific version.Optional
nsfilterStringnamespace contextRequired

Body parameters

ParameterTypeDescriptionRequired
_relatedUserItemIdStringPass the NamedUserCollection's _userItemId value of the NamedUserCollection that contains the RelatedItems._relatedUserItemId or _relatedUserItemDbId
_relatedUserItemDbIdStringPass the NamedUserCollection's _id value of the NamedUserCollection that contains the RelatedItems._relatedUserItemId or _relatedUserItemDbId
_relatedToIdsArray of StringArray of the child RelatedItem ids
_relatedFromIdStringThe parent RelatedItem's id
_userTypeStringGive the Relationship a user-defined userType on the relationshipOptional
_relatedUserItemVersionIdStringLook up child RelatedItems by a specific version instead of the default latest version.Optional
Body example
[
{
"_relatedFromId": "5ced0cdea717bb1892f815ea",
"_relatedToIds": [
"5cee7fe8c27e69cd0209ef47"
],
"_relatedUserItemDbId": "5cee7fee6505d6286dbca469",
"_relatedUserItemVersionId": "5cee80c1fa298d0d3e34e23b"
}
]

Response

Response codes

CodeDescription
204No Content
400Bad Request
404File Not Found

Response data

None

Bulk Update Relationships Between Collections

Bulk add relationships between a RelatedItem in one NamedUserCollection to one or more RelatedItems in other NamedUserCollection with a request body size up to 10MB

Endpoints

PUT /itemsvc/api/v1/nameduseritems/{id}/relationships/bulk

Request

Path parameters

ParameterTypeDescriptionRequired
idStringPass the NamedUserCollection _id or _userItemId value.Required

Query parameters

ParameterTypeDescriptionRequired
userItemVersionIdStringPass the RelatedItem userItemVersionId if you want to update a specific version.Optional
nsfilterStringnamespace contextRequired

Body parameters

ParameterTypeDescriptionRequired
_relatedUserItemIdStringPass the NamedUserCollection's _userItemId value of the NamedUserCollection that contains the RelatedItems._relatedUserItemId or _relatedUserItemDbId
_relatedUserItemDbIdStringPass the NamedUserCollection's _id value of the NamedUserCollection that contains the RelatedItems._relatedUserItemId or _relatedUserItemDbId
_relatedToIdsArray of StringArray of the child RelatedItem ids
_relatedFromIdStringThe parent RelatedItem's id
_userTypeStringGive the Relationship a user-defined userType on the relationshipOptional
_relatedUserItemVersionIdStringLook up child RelatedItems by a specific version instead of the default latest version.Optional

Body example

[
{
"_relatedFromId": "5ced0cdea717bb1892f815ea",
"_relatedToIds": [
"5cee7fe8c27e69cd0209ef47"
],
"_relatedUserItemDbId": "5cee7fee6505d6286dbca469",
"_relatedUserItemVersionId": "5cee80c1fa298d0d3e34e23b"
}
]

Response

Response codes

CodeDescription
202Accepted
400Bad Request
404File Not Found

Response header

Contains a URL to poll the request status.

Get Relationships in a Named User Collection

Filtered by Query

Endpoints

GET /itemsvc/api/v1/nameduseritems/{id}/relationships

Request

Path parameters

ParameterTypeDescriptionRequired
idStringPass the NamedUserCollection _id or _userItemId value.Required

Query parameters

ParameterTypeDescriptionRequired
queryObjectPass a query object with query parameters and values based on the RelatedItem class. You can also use query operators. For query examples, see Query parameter examples.Optional
projectObjectField projections to exclude or include fields in the response, for example, project={"_metadata":0}.Optional
pageObjectPass a Page object that defines the response pagination, for example, ?page={"_offset": 0, "_pageSize" 100}Optional
sortObjectPass a sort object to define the response sort order by a given property, using 1 for ascending sort and -1 for descending sort, for example, ?sort={"_name":1}Optional
userItemVersionIdObjectLookup RelatedItems for a given NamedUserCollection version, rather than the current version.Optional
nsfilterStringnamespace contextRequired
GET /itemsvc/api/v1/nameduseritems/5cee7fee6505d6286dbca469/relationships?query={"_name": "item1"}

Response

Response codes

CodeDescription
200Success
404File Not Found

Response data

{
"_pageSize": 1,
"_list": [
{
"_relatedFromId": "5ced0cdea717bb1892f815ea",
"_relatedUserItemVersionId": "5cee80c1fa298d0d3e34e23b",
"_isInverse": false,
"_relatedToIds": [
"5cee7fe8c27e69cd0209ef47"
],
"_relatedUserItemDbId": "5cee7fee6505d6286dbca469",
"_id": "5cefc5644fee68402c254fa0",
"_relatedUserType": "rvt_elements",
"_relatedUserItemClass": "NamedUserCollection",
"_relatedUserItemId": "11_new_ba_elem_1sjwcciumd",
"_relatedUserItemVersion": 1
}
],
"_offset": 0,
"_total": 1
}

Get Inverse relationships in a NamedUserCollection

Filtered by Query

Endpoints

GET /itemsvc/api/v1/nameduseritems/{id}/inverserelationships

Request

Path parameters

ParameterTypeDescriptionRequired
idStringPass the NamedUserCollection _id or _userItemId value.Required

Query parameters

ParameterTypeDescriptionRequired
queryObjectPass a query object with query parameters and values based on the RelatedItem class. You can also use query operators. For query examples, see Query parameter examples.Optional
projectObjectField projections to exclude or include fields in the response, for example, project={"_metadata":0}.Optional
pageObjectPass a Page object that defines the response pagination, for example, ?page={"_offset": 0, "_pageSize" 100}Optional
sortObjectPass a sort object to define the response sort order by a given property, using 1 for ascending sort and -1 for descending sort, for example, ?sort={"_name":1}Optional
userItemVersionIdObjectLookup RelatedItems for a given NamedUserCollection version, rather than the current version.Optional
nsfilterStringnamespace contextRequired

Response

Response codes

CodeDescription
200Success
404File Not Found

Response data

{
"_pageSize": 1,
"_list": [
{
"_relatedFromId": "5cee7fe8c27e69cd0209ef47",
"_relatedUserItemVersionId": "5cee80c1fa298d0d3e34e23d",
"_isInverse": true,
"_relatedToIds": [
"5ced0cdea717bb1892f815ea"
],
"_relatedUserItemDbId": "5cee7fef6505d6286dbca46b",
"_id": "5cefc5644fee68402c254fa1",
"_relatedUserType": "rvt_type_elements",
"_relatedUserItemClass": "NamedUserCollection",
"_relatedUserItemId": "11_new_type_el_uUUlgM1sn4",
"_relatedUserItemVersion": 1
}
],
"_offset": 0,
"_total": 1
}

Delete Relationship for a RelatedItem

Endpoints

DELETE /itemsvc/api/v1/nameduseritems/{id}/relationships

Request

Path parameters

ParameterTypeDescriptionRequired
idStringPass the NamedUserCollection _id or _userItemId value.Required

Query parameters

ParameterTypeDescriptionRequired
userItemVersionIdStringPass the RelatedItem userItemVersionId if you want to update a specific version.Optional
nsfilterStringnamespace contextRequired

Body parameters

ParameterTypeDescriptionRequired
_relatedUserItemIdStringPass the NamedUserCollection's _userItemId value of the NamedUserCollection that contains the RelatedItems._relatedUserItemId or _relatedUserItemDbId
_relatedUserItemDbIdStringPass the NamedUserCollection's _id value of the NamedUserCollection that contains the RelatedItems._relatedUserItemId or _relatedUserItemDbId
_relatedToIdsArray of StringArray of the child RelatedItem ids
_relatedFromIdStringThe parent RelatedItem's id
_userTypeStringGive the Relationship a user-defined userType on the relationshipOptional
_relatedUserItemVersionIdStringLook up child RelatedItems by a specific version instead of the default latest version.Optional
Body example
[
{
"_relatedFromId": "5cefc0fc4fee68402c254f9a",
"_relatedToIds": [
"5cee7fe8c27e69cd0209ef47",
"5cee7fe8c27e69cd0209ef48"
],
"_relatedUserItemDbId": "5cee7fee6505d6286dbca469",
"_relatedUserItemVersionId": "5cefd2e14fee68402c255094"
}
]

Response

Response codes

CodeDescription
204No Content
404File Not Found

Response data

None

Get all Indexes for a Named User Collection

Endpoints

GET /itemsvc/api/v1/nameduseritems/{id}/indexes

Request

Path parameters

ParameterTypeDescriptionRequired
idStringPass the NamedUserCollection _id or _userItemId value.Required

Query parameters

ParameterTypeDescriptionRequired
userItemVersionIdStringPass the RelatedItem userItemVersionId if you want to update a specific version.Optional
nsfilterStringnamespace contextRequired

Response

Response codes

CodeDescription
200Success
404File Not Found

Response data

{
"_pageSize": 2,
"_list": [
{
"name": "_id_",
"key": {
"_id": 1
},
"collectionName": "testshortname_2016_OhpcC7pSSB_V2"
},
{
"name": "properties.dtCategory.val_Rkq5cfpN1i",
"key": {
"_ftsx": 1,
"_fts": "text"
},
"collectionName": "testshortname_2016_OhpcC7pSSB_V2"
},
{
"name": "properties.dtCategory.val_gBoqBKcEU8",
"key": {
"properties.dtCategory.val": 1
},
"collectionName": "testshortname_2016_OhpcC7pSSB_V2"
}
],
"_offset": 0,
"_total": 2
}

Create Indexes for a Named User Collection

Endpoints

POST /itemsvc/api/v1/nameduseritems/{id}/indexes

Request

Path parameters

ParameterTypeDescriptionRequired
idStringPass the NamedUserCollection _id or _userItemId value.Required

Query parameters

ParameterTypeDescriptionRequired
userItemVersionIdStringPass the RelatedItem userItemVersionId if you want to update a specific version.Optional
nsfilterStringnamespace contextRequired

Body parameters

ParameterTypeDescriptionRequired
nameStringIndex nameOptional
keyStringKey that contains the field or fields that need to be indexed and their sort order. Use 1 for ascending order and -1 for descending. A composite index can contain more than one field name.Optional
uniqueBooleanSet to true if the index should have a unique constraintOptional
Supported indexes body examples

Single field indexes Single Field indexes store information from a single field in a NamedUserCollection class. By default, all NamedUserCollection objects have an index on the _id field. You can add additional indexes to speed up important queries and operations.

[
{
"key": {
"properties.dtCategory.val": 1
}
},
{
"key": {
"properties.dtType.val": 1
}
}
]

Multikey indexes Multikey indexes collect and sort data from fields that contain array values.

The following multikey index query targets the "vendor" fields in the "ServiceHistory" array in following RelatedItem in the database:

Multikey index query:

[
{
"key": {
"properties.ServiceHistory.vendor": 1
}
}
]

RelatedItem in the database:

{
"Asset Name": "- | - | ID11817",
"properties":{
"ServiceHistory": [
{
"date": "02.06.22",
"vendor": "abc ltd"
},
{
"date": "02.06.23",
"vendor": "bob ltd"
}
]
}
}

Compound Index Compound indexes collect and sort data from two or more fields in each document in a NamedUserCollection. Data is grouped by the first field in the index and then by each subsequent field:

[
{
"key": {
"properties.dtCategory.val": 1,
"properties.dtType.val": 1
}
}
]

Text Index Text indexes support full text search queries on fields containing string content. Text indexes improve performance when searching for specific words or phrases within string content.

A NamedUserCollection can only have one text index, but that index can cover multiple fields.

[
{
"key": {
"properties.description.val": "text",
"properties.Manufacturer.val": "text"
}
}
]

Wild card Indexs Use wildcard indexes to support queries for arbitrary or unknown fields. It supports both field index and text index.

[
{
"key": {
"properties.$**": 1
}
}
]

Response

Response codes

CodeDescription
201Created
400Bad Request
404File Not Found

Response body example

{
"_pageSize": 2,
"_list": [
{
"name": "properties.dtCategory.val_q6YOGlIeL3",
"key": {
"properties.dtCategory.val": 1
},
"collectionName": "test_coll_pIGTtW2HPl_V1"
},
{
"name": "properties.dtType.val_LbGhyBaKAW",
"key": {
"properties.dtType.val": 1
},
"collectionName": "test_coll_pIGTtW2HPl_V1"
}
],
"_offset": 0,
"_total": 2
}

Delete Index

Delete indexes by name from a NamedUserCollection

Endpoints

DELETE /itemsvc/api/v1/nameduseritems/{id}/indexes

Request

Path parameters

ParameterTypeDescriptionRequired
idStringPass the NamedUserCollection _id or _userItemId value.Required

Query parameters

ParameterTypeDescriptionRequired
userItemVersionIdStringPass the RelatedItem userItemVersionId if you want to update a specific version.Optional
nsfilterStringnamespace contextRequired

Response

Response codes

CodeDescription
204No Content

Search Named User Collections

Search all NamedUserCollections using custom Relationship queries

Endpoints

POST /itemsvc/api/v1/nameduseritems/search

Request

Query parameters

ParameterTypeDescriptionRequired
nsfilterStringnamespace contextRequired

Request body

See Related queries

Request body example
{
"$findWithRelated": {
"parent": {
"collectionDesc": {
"_userItemId": "1mb_4222225_ba_elem_OYK5UKTTTl",
"_versions.all": true
},
"query": {
"type_id": 12130
},
"collectionProject": {
"_userItemId": 1,
"_name": 1
},
"options": {
"project": {
"source_id": 1,
"package_id": 12143
},
"page": {
"_pageSize": 2,
"_offset": 0
},
"sort": {
"_metadata._updatedAt": 1
}
}
},
"related": [
{
"relatedDesc": {
"_relatedUserType": "rvt_type_elements"
},
"query": {
"properties.OmniClass Title.val": "Beams"
},
"options": {
"project": {
"properties.Revit Category.val": 1,
"properties.baBIMAssureType.val": 1
},
"page": {
"_pageSize": 100,
"_offset": 0
},
"sort": {
"_metadata._updatedAt": 1
}
},
"as": "type_elements"
}
]
}
}

Response

Response codes

CodeDescription
200Success
400Bad Request

Response body

{
"_list": [
{
"_uri": "/nameduseritems/5ced0ce85502b659e49cad12",
"_name": "1Mb_4222225_elements",
"_tipVersion": 2,
"_itemClass": "NamedUserCollection",
"_userItemId": "1mb_4222225_ba_elem_OYK5UKTTTl",
"_tipId": "5cee29f98702dd0b75f7983d",
"_versions": [
{
"_userItemDbId": "5ced0ce85502b659e49cad12",
"_relatedItems": {
"_pageSize": 2,
"_list": [
{
"_id": "5ced0cdea717bb1892f81a93",
"source_id": "150f10e7-70e9-40e4-86e8-4fb92aa169a8-000bd95a",
"package_id": 12143,
"type_elements": {
"_pageSize": 2,
"_list": [
{
"_id": "5ced0cdea717bb1892f81464",
"properties": {
"Revit Category": {
"val": "OST_StructuralFraming"
},
"baBIMAssureType": {
"val": "Beams"
}
}
},
{
"_id": "5ced0cdea717bb1892f81464",
"properties": {
"Revit Category": {
"val": "OST_StructuralFraming"
},
"baBIMAssureType": {
"val": "Beams"
}
}
}
],
"_offset": 0,
"_total": 2
}
},
{
"_id": "5ced0cdea717bb1892f81a94",
"source_id": "e5db3719-101e-4bac-b26e-161a11a108f3-000fc8f5",
"package_id": 15208,
"type_elements": {
"_pageSize": 2,
"_list": [
{
"_id": "5ced0cdea717bb1892f81464",
"properties": {
"Revit Category": {
"val": "OST_StructuralFraming"
},
"baBIMAssureType": {
"val": "Beams"
}
}
},
{
"_id": "5ced0cdea717bb1892f81464",
"properties": {
"Revit Category": {
"val": "OST_StructuralFraming"
},
"baBIMAssureType": {
"val": "Beams"
}
}
}
],
"_offset": 0,
"_total": 2
}
}
],
"_offset": 0,
"_total": 14
},
"_id": "5ced191a91816a6d369aacaa",
"_isTip": false,
"_metadata": {
"_updatedById": "17285382-7f67-4b04-b231-bcdca454ed2c",
"_createdAt": 1559039208862,
"_createdById": "17285382-7f67-4b04-b231-bcdca454ed2c",
"_updatedAt": 1559112185463
},
"_version": 1
},
{
"_userItemDbId": "5ced0ce85502b659e49cad12",
"_relatedItems": {
"_pageSize": 2,
"_list": [
{
"_id": "5ced0cdea717bb1892f81a92",
"source_id": "150f10e7-70e9-40e4-86e8-4fb92aa169a8-000bd958",
"package_id": 12138,
"type_elements": {
"_pageSize": 0,
"_list": [],
"_offset": 0,
"_total": 0
}
},
{
"_id": "5ced0cdea717bb1892f81a93",
"source_id": "150f10e7-70e9-40e4-86e8-4fb92aa169a8-000bd95a",
"package_id": 12143,
"type_elements": {
"_pageSize": 0,
"_list": [],
"_offset": 0,
"_total": 0
}
}
],
"_offset": 0,
"_total": 15
},
"_id": "5cee29f98702dd0b75f7983d",
"_isTip": true,
"_metadata": {
"_updatedById": "17285382-7f67-4b04-b231-bcdca454ed2c",
"_createdAt": 1559039208862,
"_createdById": "17285382-7f67-4b04-b231-bcdca454ed2c",
"_updatedAt": 1559112185464
},
"_version": 2
}
],
"_irn": "itemsvc:nameduseritem:5ced0ce85502b659e49cad12",
"_id": "5ced0ce85502b659e49cad12",
"_kind": "collection"
}
],
"_time": "107ms"
}

Get Named User Item Update Logs

Endpoints

GET /itemsvc/api/v1/nameduseritems/{id}/updatelogs

Request

Query parameters

ParameterTypeDescriptionRequired
userItemVersionIdStringPass the RelatedItem userItemVersionId if you want to update a specific version.Optional
nsfilterStringnamespace contextRequired

Path parameters

ParameterTypeDescriptionRequired
idStringPass the NamedUserCollection _id or _userItemId value.Required

Response

Response codes

CodeDescription
200Success
404File Not Found

Response data

[
{
"_updatedBy": "1b457660-92c2-461d-9895-78e731a031c6",
"_updatedAt": 1542267364347
}
]

Endpoints

GET /itemsvc/api/v1/nameduseritems/{id}/relateditems/{relatedItemId}/updatelogs

Request

Path parameters

ParameterTypeDescriptionRequired
idStringPass the NamedUserCollection _id or _userItemId value.Required
relatedItemIdStringPass the RelatedItem's id.Required
userItemVersionIdStringPass the RelatedItem userItemVersionId if you want to update a specific version.Optional
nsfilterStringnamespace contextRequired

Response

Response codes

CodeDescription
200Success
404File Not Found

Response

[
{
"_updatedBy": "1b457660-92c2-461d-9895-78e731a031c6",
"_updatedAt": 1542267364347
}
]