Skip to main content
Version: v5.2

Workspace

Get Workspaces for Current User

Endpoint

GET /passportsvc/api/v1/workspaces

Request

Query parameters

ParameterTypeDescriptionRequired
_nameStringThe Workspace nameOptional
_userTypeStringThe Workspace's unique or common _userTypeOptional
_shortNameStringThe Workspace's _shortName valueOptional
_offsetStringResponse offsetOptional
_pageSizeStringResponse page sizeOptional
_userAttributes.<attribute_name>StringQuery a user attribute, for example, _userAttributes.customAttr=customAttrValueOptional
queryStringWild card search query on the _name, _shortName, and _description fields, for example, ?query=xyzOptional

Note: The _name, _shortName and _userType accept multiple values, for example, _shortName=shortname1&_shortName=shortname2.

Response

Response data example

{
"_offset": 0,
"_pageSize": 2,
"_total": 2,
"_list": [
{
"_id": "08f61188-7850-45f9-9dae-be8a66f7d4c7",
"_description": "This workspace handles all the data about XYZ Airport",
"_name": "XYZ Airport",
"_shortName": "xyz_airport",
"_userType": "project_workspace",
"_namespaces": [
"xyz_VcwyvHDp"
],
"_metadata": {
"_createdAt": 1524206338260,
"_updatedAt": 1524206338279,
"_createdById": "1bae25c6-9d57-429d-ac6f-a6146d71d6f5",
"_updatedById": "1bae25c6-9d57-429d-ac6f-a6146d71d6f5",
"_createdByName": "xxxxxxx",
"_updatedByName": "xxxxxxx"
}
},
{
"_id": "0e24afb4-3de9-477d-b94a-602afd7e2746",
"_description": "This workspace handles all the data about ABC Hospital",
"_name": "ABC Hospital",
"_shortName": "abc_hospital",
"_userType": "project_workspace",
"_namespaces": [
"abc_HmV86tZk"
],
"_userAttributes": {
"location": "Gotham city",
"userarray": [
"hey",
"hello"
]
},
"_metadata": {
"_createdAt": 1523019996201,
"_updatedAt": 1523019996208,
"_createdById": "1bae25c6-9d57-429d-ac6f-a6146d71d6f5",
"_updatedById": "1bae25c6-9d57-429d-ac6f-a6146d71d6f5",
"_createdByName": "xxxxxxx",
"_updatedByName": "xxxxxxx"
}
}
]
}

Get Workspace by Id

Endpoint

GET /passportsvc/api/v1/workspaces/{id}

Request

Path parameters

ParameterTypeDescriptionRequired
idStringThe Workspace's idRequired

Response

Codes

CodeDescription
200Success
404Not Found

Response

{
"_description": "Sample Description",
"_id": "8cbc25a8-e753-4b35-aaa3-3312f0cd080a",
"_name": "ws_SPonnusamy",
"_shortName": "ws_SPonnusamy",
"_userType": "Sample Project",
"_namespaces": [
"ws_SPonnusamy_PCbOW2cz"
],
"_userAttributes": {
"number": 100,
"userarray": [
"hey",
"hello"
]
},
"_metadata": {
"_createdAt": 1524206338260,
"_updatedAt": 1524206338279,
"_createdById": "1bae25c6-9d57-429d-ac6f-a6146d71d6f5",
"_updatedById": "1bae25c6-9d57-429d-ac6f-a6146d71d6f5",
"_createdByName": "xxxxxxx",
"_updatedByName": "xxxxxxx"
}
}

Edit Workspace

Endpoint

PUT /passportsvc/api/v1/workspaces/{id}

Request

Path parameters

ParameterTypeDescriptionRequired
idStringThe Workspace's idRequired

Body parameters

ParameterTypeDescriptionRequired
_nameStringEdit the Workspace nameOptional
_shortNameStringEdit the Workspace's _shortName valueOptional
_descriptionStringEdit the Workspace's descriptionOptional
_userTypeStringThe the Workspace's _userType, which is a unique or common identifier.Optional
_userAttributes.<attribute_name>StringAdd or edit a custom user attribute, for example, _userAttributes.customAttr=customAttrValueOptional
Body example
{
"_description": "Sample Description_1",
"_name": "ws_SPonnusamy",
"_userType": "Sample Project",
"_namespaces": [
"ws_SPonnusamy_PCbOW2cz"
],
"_userAttributes": {
"number": 100,
"userarray": [
"hey",
"hello"
]
}
}

Response

Codes

CodeDescription
200Success
400Bad Request
404Not Found

Response data example

{
"_description": "Sample Description_1",
"_id": "8cbc25a8-e753-4b35-aaa3-3312f0cd080a",
"_name": "ws_SPonnusamy",
"_shortName": "ws_SPonnusamy",
"_userType": "Sample Project",
"_namespaces": [
"ws_SPonnusamy_PCbOW2cz"
],
"_userAttributes": {
"number": 100,
"userarray": [
"hey",
"hello"
]
},
"_metadata": {
"_createdAt": 1524206338260,
"_updatedAt": 1524206338279,
"_createdById": "1bae25c6-9d57-429d-ac6f-a6146d71d6f5",
"_updatedById": "1bae25c6-9d57-429d-ac6f-a6146d71d6f5",
"_createdByName": "xxxxxxx",
"_updatedByName": "xxxxxxx"
}
}

Delete workspace

DELETE /passportsvc/api/v1/workspaces/{id}

Request

Path parameters

ParameterTypeDescriptionRequired
idStringThe Workspace's idRequired

Response

Codes

CodeDescription
204No Content
404Not Found

Response

None

Add Workspaces

Endpoint

POST /passportsvc/api/v1/workspaces

Request

Body parameters

ParameterTypeDescriptionRequired
_nameStringReadable long-form nameOptional
_shortNameStringAn abbreviated name up to 22 characters that is used for referenceOptional
_descriptionStringDescribes the purpose of the the Workspace's descriptionOptional
_userTypeStringThe the Workspace's _userType, which is a unique or common identifier.Optional
_userAttributes.<attribute_name>StringAdd or edit a custom user attribute, for example, _userAttributes.customAttr=customAttrValueOptional

Body example

[
{
"_description": "account workspace",
"_name": "abc",
"_shortName": "aw",
"_userType": "account_workspace"
},
{
"_description": "abc",
"_name": "abc",
"_shortName": "aw1",
"_userType": "account_workspace"
}
]

Response data example

{
"_offset": 0,
"_pageSize": 2,
"_total": 2,
"_list": [
{
"_id": "d719bb0c-e0b1-42f9-9fd0-46e849e723cc",
"_description": "account workspace",
"_name": "abc",
"_shortName": "aw",
"_userType": "account_workspace",
"_namespaces": [
"aw_1Ab9eyxX"
],
"_metadata": {
"_createdAt": 1561009726483,
"_updatedAt": 1561009726582,
"_createdById": "891ccc4f-6165-4c74-b6a4-e2281d201e7b",
"_updatedById": "891ccc4f-6165-4c74-b6a4-e2281d201e7b",
"_createdByName": "xxxxxxx",
"_updatedByName": "xxxxxxx"
}
},
{
"_id": "90d4cd6e-b777-4b37-a04c-577481bae5d3",
"_description": "abc",
"_name": "abc",
"_shortName": "aw1",
"_userType": "account_workspace",
"_namespaces": [
"aw1_3FcJuJhO"
],
"_metadata": {
"_createdAt": 1561009726578,
"_updatedAt": 1561009726675,
"_createdById": "891ccc4f-6165-4c74-b6a4-e2281d201e7b",
"_updatedById": "891ccc4f-6165-4c74-b6a4-e2281d201e7b",
"_createdByName": "xxxxxxx",
"_updatedByName": "xxxxxxx"
}
}
]
}