Account API
Account¶
Add a contact¶
POST /account/contact/¶
Name | Type | Description |
---|---|---|
contactId | [String] | ID of the contact to add. |
contactEmail | [String] | Email of the contact to add. |
Example usage:
Error-Response:
Error-Response:
Add a role¶
POST /account/role/¶
Name | Type | Description |
---|---|---|
name | String | Name of the role. |
permissions | String | Permissions of the role. |
Example usage:
Error-Response:
Create a new Session¶
Example usage:
Success 200¶
Name | Type | Description |
---|---|---|
A | Object | JSON object containing the Session JWT. |
Error-Response:
Error-Response:
Error-Response:
Create a new account¶
POST /account/¶
Name | Type | Description |
---|---|---|
String | Email of the account. | |
password | String | optional Password of the account in plain text. Required by default and when strategy.name == "local". Must not be specified otherwise. |
username | String | optional Username of the account. Deduced from the email address if not provided. |
permissions | [String] | optional Permissions of the account. Can be any arbitrary array of strings. |
roles | [String] | optional Roles of the account. Can be any array of Role IDs. |
strategy.name | [String] | optional Name of the strategy used to create the Account. Possible values: - LDAP: The Account comes from an LDAP directory. - local: The Account is local to SmartShape. |
Example usage:
Error-Response:
Delete a contact¶
URL /account/contact/:contactId¶
Name | Type | Description |
---|---|---|
contactId | String | ID of the contact to delete. |
Example usage:
Delete a role¶
URL /account/role/:roleId¶
Name | Type | Description |
---|---|---|
roleId | String | ID of the role to delete. |
Example usage:
Delete an account¶
URL /account/:accountId¶
Name | Type | Description |
---|---|---|
accountId | String | ID of the account to be deleted. |
Example usage:
Delete the current Session¶
Example usage:
Error-Response:
Error-Response:
Error-Response:
Get a user avatar¶
accountId /account/avatar/:accountId?¶
Name | Type | Description |
---|---|---|
accountId | String | ID of the requested account avatar (optional). |
Example usage:
Success-Response:
List all SmartShape accounts¶
Success-Reponse:
List all contacts¶
Example usage:
Success-Response:
List all roles¶
Example usage:
Success-Response:
List all the permissions of the current SmartShape Account (including the ones specific to the current File)¶
Success-Reponse:
Log account out¶
Login account¶
POST /account/login/¶
Name | Type | Description |
---|---|---|
username | String | Account username (cannot be used with email). |
String | Account email (cannot be used with username). | |
password | String | Account password. |
Example usage:
Success-Response:
HTTP/1.1 200 OK
{
"success": true,
"username": "test",
"email": "test@smartshape.io",
"roles": ["6105f15bd5b76604f33330e7"],
"permissions": [
"create_account",
"delete_account"
],
"strategy": {
"name": "local"
},
"id": "60894bafbd56ffadb446065a",
"cookies": "jsonwebtoken=eyJhbGciOiJSUzI1NiIsInR5cCI6I..."
}
Success 200¶
Name | Type | Description |
---|---|---|
success | Boolean | |
String | Email of the account. | |
username | String | Username of the account. |
cookies | String | Cookies that contain the JWT. |
strategy.name | String | Name of the strategy used to create the Account. Possible values: - LDAP: The Account comes from an LDAP directory. - local: The Account is local to SmartShape. |
Error-Response:
Retrieve the details of an account¶
Example usage:
Success-Response:
Success 200¶
Name | Type | Description |
---|---|---|
id | String | ID of the account. |
username | String | Username of the account. |
String | Email of the account. | |
String | optional permissions Permissions specific to the account. | |
strategy.name | String | Name of the strategy used to create the Account. Possible values: - LDAP: The Account comes from an LDAP directory. - local: The Account is local to SmartShape. |
Update a Session to keep it alive¶
Example usage:
Error-Response:
Error-Response:
Error-Response:
Update a role¶
URL /account/role/:roleId¶
Name | Type | Description |
---|---|---|
roleId | String | ID of the role to update. |
POST /account/role/:roleId¶
Name | Type | Description |
---|---|---|
name | String | Name of the role. |
permissions | String | Permissions of the role. |
Example usage:
Update an account¶
URL /account/:accountId¶
Name | Type | Description |
---|---|---|
accountId | String | ID of the account to be updated. |
Example usage:
April 27, 2023
April 27, 2023