Workspace
Get Workspaces for Current User
Endpoint
GET /passportsvc/api/v1/workspaces
Request
Query parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
_name | String | The Workspace name | Optional |
_userType | String | The Workspace's unique or common _userType | Optional |
_shortName | String | The Workspace's _shortName value | Optional |
_offset | String | Response offset | Optional |
_pageSize | String | Response page size | Optional |
_userAttributes.<attribute_name> | String | Query a user attribute, for example, _userAttributes.customAttr=customAttrValue | Optional |
query | String | Wild card search query on the _name, _shortName, and _description fields, for example, ?query=xyz | Optional |
Note: The
_name,_shortNameand_userTypeaccept 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
| Parameter | Type | Description | Required |
|---|---|---|---|
id | String | The Workspace's id | Required |
Response
Codes
| Code | Description |
|---|---|
200 | Success |
404 | Not 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
| Parameter | Type | Description | Required |
|---|---|---|---|
id | String | The Workspace's id | Required |
Body parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
_name | String | Edit the Workspace name | Optional |
_shortName | String | Edit the Workspace's _shortName value | Optional |
_description | String | Edit the Workspace's description | Optional |
_userType | String | The the Workspace's _userType, which is a unique or common identifier. | Optional |
_namespaces | String | Edit the namespaces for the Workspace | Optional |
_userAttributes.<attribute_name> | String | Add or edit a custom user attribute, for example, _userAttributes.customAttr=customAttrValue | Optional |
Body example
{
"_description": "Sample Description_1",
"_name": "ws_SPonnusamy",
"_userType": "Sample Project",
"_namespaces": [
"ws_SPonnusamy_PCbOW2cz"
],
"_userAttributes": {
"number": 100,
"userarray": [
"hey",
"hello"
]
}
}
Response
Codes
| Code | Description |
|---|---|
200 | Success |
400 | Bad Request |
404 | Not 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
| Parameter | Type | Description | Required |
|---|---|---|---|
id | String | The Workspace's id | Required |
Response
Codes
| Code | Description |
|---|---|
204 | No Content |
404 | Not Found |
Response
None
Add Workspaces
Endpoint
POST /passportsvc/api/v1/workspaces
Request
Body parameters
| Parameter | Type | Description | Required |
|---|---|---|---|
_name | String | Readable long-form name | Optional |
_shortName | String | An abbreviated name up to 22 characters that is used for reference | Optional |
_description | String | Describes the purpose of the the Workspace's description | Optional |
_userType | String | The the Workspace's _userType, which is a unique or common identifier. | Optional |
_userAttributes.<attribute_name> | String | Add or edit a custom user attribute, for example, _userAttributes.customAttr=customAttrValue | Optional |
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"
}
}
]
}