Organization User Resource

The org_user resource is used to associate users with organizations. A user is added or removed from an organization via the org_user resource.

The org_user resource will have the same uid as the user resource it is associated with. An org_user also has attributes related to the organization it belongs too such as "affiliation". When an organization is deleted all of the org_user resources will be deleted with it but not the actual user resource.

An organization must have one, and only one, org_user with an isOwner attribute set to true. When an org_user resource is PUT or POSTed with isOwner as true the other org_user who was previously the owner will no longer be the owner.

When a user resource is deleted all org_user resources for that user will also be deleted thus removing that user from any organization they belong to.

A user or an org_user cannot be deleted if it is an owner of an organization. The organization must be deleted first.

RoleTypes:
  • NONE
  • EDITOR
  • VIEWER

GET org_user/{org_userUid}



Get the org_user with the specified uid.

For session token calls: only a user who is an owner can make this call or a user can request their own org_user resource. This allows the UI to make this request for the currently logged in user and make adjustments to the UI according to what rights the user has. Users cannot GET other user's org_user information.
Resource Information
Rate Limited? Yes
session, oauth and org tokens compatible? Yes
api_key compatible? Yes

Resource URL

http://grovestreams.com/api/org_user/{org_userUid}

Parameters

none


Example Requests

/OrgUser/d251a8f2-f7b9-4df7-886d-b24c7f4929d4

Response Body

{
  "message": "",
  "org_user": {
    "uid": "d251a8f2-f7b9-4df7-886d-b24c7f4929d4",
    "affiliation": "vp",
    "isOwner": "true",
    "compStudioRole": "EDITOR",
    "compRole": "EDITOR",
    "contentRole": "EDITOR",
    "fullName": "Fred Flintstone"
  },
  "success": true
}


GET org_user/new



Returns a default org_user entity with a unique UID. Does not persist the new org_user entity. It's the callers responsibility to PUT the new org_user. Note that the UID has to be a user UID and a use with that UID must exist within GroveStreams.
Resource Information
Rate Limited? Yes
session, oauth and org tokens compatible? yes
api_key compatible yes

Resource URL

http://grovestreams.com/api/org_user/new

Parameters

none

Example Requests

/org_user/new

Response Body
{
  "message": "",
  "org_user": {
    "uid": "d251a8f2-f7b9-4df7-886d-b24c7f4929d4",
    "affiliation": "",
    "isOwner": "false",
    "compStudioRole": "EDITOR",
    "compRole": "EDITOR",
    "contentRole": "EDITOR",
    "fullName": ""
  },
  "success": true
}


GET org_user/  



Returns a list of org_user resources.

For session token calls: only a user who is an owner can make this call.
Resource Information
Rate Limited? Yes
session, oauth and org tokens compatible? Yes
api_key compatible Yes
org

Resource URL

http://grovestreams.com/api/org_user

Parameters

none


Example Requests

/org_user

Response Body
{
  "message": "",
  "org_user": [
    {
      "uid": "2690fa7c-e320-4c12-8bcb-3b03956b270b",
      "compStudioRole": "EDITOR",
      "contentRole": "EDITOR",
      "isOwner": true,
      "affiliation": "",
      "fullName": "Fred Flintstone",
      "compRole": "EDITOR"
    },
    {
      "uid": "79207be7-fd54-4172-ac0a-be3733d1ab02",
      "compStudioRole": "EDITOR",
      "contentRole": "EDITOR",
      "isOwner": false,
      "affiliation": "vp2",
      "fullName": "Fred Flintstone2",
      "compRole": "EDITOR"
    },
    {
      "uid": "8a0a379c-3122-476d-bee2-4df3945696bf",
      "compStudioRole": "EDITOR",
      "contentRole": "EDITOR",
      "isOwner": false,
      "affiliation": "vp",
      "fullName": "Fred Flintstone2",
      "compRole": "EDITOR"
    }
  ],
  "success": true
}


PUT org_user



Adds a user to an organization. If a user is an owner then any role attributes passed in will be ignored and set to EDITOR. The org_user uid must be a uid of an existing user resource.

For session token calls: only a user who is an owner can make this call.
Resource Information
Rate Limited? Yes
session, oauth and org tokens compatible? Yes
api_key compatible Yes

Resource URL

http://grovestreams.com/api/org_user

Parameters

none

Example Requests

/org_user

Request Body
{
  "org_user": {
    "uid": "8e3ae863-d8a4-4e3f-9231-719495093a3c",
    "affiliation": "Vice President",
    “isOwner”: “false”,
    "compStudioRole": "EDITOR",
    "compRole": "EDITOR",
    "contentRole": "EDITOR",
  }
}


POST org_user



Used to update org_user information. If a user is an owner then any role attributes passed in will be ignored and set to EDITOR. The org_user uid must be a uid of an existing user resource.

For session token calls: only a user who is an owner can make this call.
Resource Information
Rate Limited? Yes
session, oauth and org tokens compatible? Yes
api_key compatible Yes

Resource URL

http://grovestreams.com/api/org_user

Parameters

none

Example Requests

/org_user

Request Body
{
  "org_user": {
    "uid": "8e3ae863-d8a4-4e3f-9231-719495093a3c",
    "affiliation": "Vice President",
    “isOwner”: “true”
  }
}

DELETE org_user/{org_userUid}



Deletes an org_user and all resources that belong to it.

For session token calls: only a user who is an owner can make this call.
Resource Information
Rate Limited? Yes
session, oauth and org tokens compatible? Yes
api_key compatible Yes

Resource URL

http://grovestreams.com/api/org_user/{org_userUid}

Parameters

none

Example Requests

/org_user/d251a8f2-f7b9-4df7-886d-b24c7f4929d4

Response Body
{
    "message" : "Deleted OrgUser with uid 'd251a8f2-f7b9-4df7-886d-b24c7f4929d4'",
    "success" : true

}