List Groups -- Current User
Query
GET /api/1.0/groups
No parameters |
---|
Response
HTTP Status | Response |
---|---|
200 OK | Output example:
{ "list":[ { "id":889, "groupName":"Default" }, { "id":890, "groupName":"group1" }, { "id":891, "groupName":"group2" } ] } |
400 BAD_REQUEST |
{ "message": <Error details>, "documentation_url": <Documentation link> } Common error details:
|
401 UNAUTHORIZED |
{ "message": <Error details>, "documentation_url": <Documentation link> } Common error details:
|
Example
curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER"
https://www.knowi.com/api/1.0/groups/
List Groups - By User
Query
GET /api/1.0/users/<user_id>/groups
Parameter | Comments |
---|---|
user_id | User id of User to get Groups |
Response
HTTP Status | Response |
---|---|
200 OK | Output example:
{ "list":[ { "id":889, "groupName":"Default" }, { "id":890, "groupName":"group1" }, { "id":891, "groupName":"group2" } ] } |
400 BAD_REQUEST |
{ "message": <Error details>, "documentation_url": <Documentation link> } Common error details:
|
401 UNAUTHORIZED |
{ "message": <Error details>, "documentation_url": <Documentation link> } Common error details:
|
403 FORBIDDEN |
{ "message": <Error details>, "documentation_url": <Documentation link> } Error details:
|
Example
curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER"
https://www.knowi.com/api/1.0/users/10001/groups/
Get Group Details (current user)
Query
GET /api/1.0/groups/<group_id>
Parameter | Comments |
---|---|
group_id | Group id of Group to get |
withSharing | Optional query parameter, value (boolean) true/false. The default value is false. If true, then output will contain list of assets shared into group, and also autoShareUsers field with list of Users which autoShared into this group |
Response
HTTP Status | Response |
---|---|
200 OK | Output example:
|
400 BAD_REQUEST |
{ "message": <Error details>, "documentation_url": <Documentation link> } Common error details:
|
401 UNAUTHORIZED |
{ "message": <Error details>, "documentation_url": <Documentation link> } Common error details:
|
403 FORBIDDEN |
{ "message": <Error details>, "documentation_url": <Documentation link> } Error details:
|
Example
curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER"
https://www.knowi.com/1.0/groups/10001?withSharing=true
Get Groups - By User
Query
GET /api/1.0/users/<user_id>/groups/<group_id>
Parameter | Comments |
---|---|
userid | User id of User to get specified Group in it |
group_id | Group id of Group to get info about inside specified User |
withSharing | Optional query parameter, value (boolean) true/false. The default value is false. If true, then output will contain list of assets shared into group, and also autoShareUsers field with list of Users which autoShared into this group |
Response
HTTP Status | Response |
---|---|
200 OK | Output example:
|
400 BAD_REQUEST |
{ "message": <Error details>, "documentation_url": <Documentation link> } Common error details:
|
401 UNAUTHORIZED |
{ "message": <Error details>, "documentation_url": <Documentation link> } Common error details:
|
403 FORBIDDEN |
{ "message": <Error details>, "documentation_url": <Documentation link> } Error details:
|
Example
curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER"
https://www.knowi.com/api/1.0/users/10001/groups/90002?withSharing=true
Create Group within current user
Query
POST /api/1.0/groups/
Parameter | Comments |
---|---|
groupName | Group name of new group |
Response
HTTP Status | Response |
---|---|
200 OK | Return created group json info (same as "Get group" command). Output example:
{ "id":890, "groupName":"group1" } |
400 BAD_REQUEST |
{ "message": <Error details>, "documentation_url": <Documentation link> } Common error details:
|
401 UNAUTHORIZED |
{ "message": <Error details>, "documentation_url": <Documentation link> } Common error details:
|
Example
curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -d "groupname=newGroupName1"
https://www.knowi.com/api/1.0/groups
Create Group inside specified user
Query
POST /api/1.0/users/<user_id>/groups/
Parameter | Comments |
---|---|
userid | User id of User to create Group in it |
groupName | Group name of new group |
Response
HTTP Status | Response |
---|---|
200 OK | Return created group json info (same as "Get group" command). Output example:
{ "id":890, "groupName":"group1" } |
400 BAD_REQUEST |
{ "message": <Error details>, "documentation_url": <Documentation link> } Common error details:
|
401 UNAUTHORIZED |
{ "message": <Error details>, "documentation_url": <Documentation link> } Common error details:
|
403 FORBIDDEN |
{ "message": <Error details>, "documentation_url": <Documentation link> } Error details:
|
Example
curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -d "groupname=newGroupName1"
https://www.knowi.com/api/1.0/users/10001/groups
Delete Group of current User
Query
DELETE /api/1.0/groups/<group_id>
Parameter | Comments |
---|---|
group_id | Group id of Group to delete |
Response
HTTP Status | Response |
---|---|
200 OK | No response body |
400 BAD_REQUEST |
{ "message": <Error details>, "documentation_url": <Documentation link> } Common error details:
|
401 UNAUTHORIZED |
{ "message": <Error details>, "documentation_url": <Documentation link> } Common error details:
|
403 FORBIDDEN |
{ "message": <Error details>, "documentation_url": <Documentation link> } Error details:
|
Example
curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -X DELETE
https://www.knowi.com/api/1.0/groups/895
Delete Group of specified User
Query
DELETE /api/1.0/users/<user_id>/groups/<group_id>
Parameter | Comments |
---|---|
userid | User id of User to delete Group in it |
group_id | Group id of Group to delete |
Response
HTTP Status | Response |
---|---|
200 OK | No response body |
400 BAD_REQUEST |
{ "message": <Error details>, "documentation_url": <Documentation link> } Common error details:
|
401 UNAUTHORIZED |
{ "message": <Error details>, "documentation_url": <Documentation link> } Common error details:
|
403 FORBIDDEN |
{ "message": <Error details>, "documentation_url": <Documentation link> } Error details:
|
Example
curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -X DELETE
https://www.knowi.com/api/1.0/users/10001/groups/895
Edit Group of current User
Query
PUT /api/1.0/groups/<group_id>
Parameter | Comments |
---|---|
group_id | Group id of Group to edit |
groupName | New group name of Group |
Response
HTTP Status | Response |
---|---|
200 OK | Return updated group json info (same as "Get group" command). Output example:
{ "id":890, "groupName":"group1" } |
400 BAD_REQUEST |
{ "message": <Error details>, "documentation_url": <Documentation link> } Common error details:
|
401 UNAUTHORIZED |
{ "message": <Error details>, "documentation_url": <Documentation link> } Common error details:
|
403 FORBIDDEN |
{ "message": <Error details>, "documentation_url": <Documentation link> } Error details:
|
Example
curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -X PUT -d "groupName=updatedGroupName1"
https://www.knowi.com/api/1.0/groups/897
Edit Group of selected User
Query
PUT /api/1.0/users/<user_id>/groups/<group_id>
Parameter | Comments |
---|---|
user_id | User id where edit the Group |
group_id | Group id of Group to edit |
groupName | New group name of Group |
Response
HTTP Status | Response |
---|---|
200 OK | Return updated group json info (same as "Get group" command). Output example:
{ "id":890, "groupName":"group1" } |
400 BAD_REQUEST |
{ "message": <Error details>, "documentation_url": <Documentation link> } Common error details:
|
401 UNAUTHORIZED |
{ "message": <Error details>, "documentation_url": <Documentation link> } Common error details:
|
403 FORBIDDEN |
{ "message": <Error details>, "documentation_url": <Documentation link> } Error details:
|
Example
curl -i -H "Authorization: Bearer HERE_IS_YOUR_BEARER" -X PUT -d "groupName=updatedGroupName1"
https://www.knowi.com/api/1.0/users/10001/groups/897