Skip to content
This repository has been archived by the owner on Jan 17, 2024. It is now read-only.

Latest commit

 

History

History
195 lines (140 loc) · 12.8 KB

WorkspaceMembershipsApi.md

File metadata and controls

195 lines (140 loc) · 12.8 KB

Asana.WorkspaceMembershipsApi

All URIs are relative to https://app.asana.com/api/1.0

Method HTTP request Description
getWorkspaceMembership GET /workspace_memberships/{workspace_membership_gid} Get a workspace membership
getWorkspaceMembershipsForUser GET /users/{user_gid}/workspace_memberships Get workspace memberships for a user
getWorkspaceMembershipsForWorkspace GET /workspaces/{workspace_gid}/workspace_memberships Get the workspace memberships for a workspace

getWorkspaceMembership

GetWorkspaceMembership200Response getWorkspaceMembership(workspaceMembershipGid, opts)

Get a workspace membership

Returns the complete workspace record for a single workspace membership.

Example

import Asana from 'asana';
let defaultClient = Asana.ApiClient.instance;
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';
// Configure Bearer access token for authorization: personalAccessToken
let personalAccessToken = defaultClient.authentications['personalAccessToken'];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN"

let apiInstance = new Asana.WorkspaceMembershipsApi();
let workspaceMembershipGid = 12345; // String | 
let opts = {
  'optPretty': true, // Boolean | Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.
  'optFields': ["followers","assignee"] // [String] | Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options.
};
apiInstance.getWorkspaceMembership(workspaceMembershipGid, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
workspaceMembershipGid String
optPretty Boolean Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. [optional]
optFields [String] Defines fields to return. Some requests return compact representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. [optional]

Return type

GetWorkspaceMembership200Response

Authorization

oauth2, personalAccessToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getWorkspaceMembershipsForUser

GetWorkspaceMembershipsForUser200Response getWorkspaceMembershipsForUser(userGid, opts)

Get workspace memberships for a user

Returns the compact workspace membership records for the user.

Example

import Asana from 'asana';
let defaultClient = Asana.ApiClient.instance;
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';
// Configure Bearer access token for authorization: personalAccessToken
let personalAccessToken = defaultClient.authentications['personalAccessToken'];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN"

let apiInstance = new Asana.WorkspaceMembershipsApi();
let userGid = me; // String | A string identifying a user. This can either be the string \"me\", an email, or the gid of a user.
let opts = {
  'optPretty': true, // Boolean | Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.
  'optFields': ["followers","assignee"], // [String] | Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options.
  'limit': 50, // Number | Results per page. The number of objects to return per page. The value must be between 1 and 100.
  'offset': eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9 // String | Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.'
};
apiInstance.getWorkspaceMembershipsForUser(userGid, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
userGid String A string identifying a user. This can either be the string "me", an email, or the gid of a user.
optPretty Boolean Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. [optional]
optFields [String] Defines fields to return. Some requests return compact representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. [optional]
limit Number Results per page. The number of objects to return per page. The value must be between 1 and 100. [optional]
offset String Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' [optional]

Return type

GetWorkspaceMembershipsForUser200Response

Authorization

oauth2, personalAccessToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

getWorkspaceMembershipsForWorkspace

GetWorkspaceMembershipsForUser200Response getWorkspaceMembershipsForWorkspace(workspaceGid, opts)

Get the workspace memberships for a workspace

Returns the compact workspace membership records for the workspace.

Example

import Asana from 'asana';
let defaultClient = Asana.ApiClient.instance;
// Configure OAuth2 access token for authorization: oauth2
let oauth2 = defaultClient.authentications['oauth2'];
oauth2.accessToken = 'YOUR ACCESS TOKEN';
// Configure Bearer access token for authorization: personalAccessToken
let personalAccessToken = defaultClient.authentications['personalAccessToken'];
personalAccessToken.accessToken = "YOUR ACCESS TOKEN"

let apiInstance = new Asana.WorkspaceMembershipsApi();
let workspaceGid = 12345; // String | Globally unique identifier for the workspace or organization.
let opts = {
  'user': me, // String | A string identifying a user. This can either be the string \"me\", an email, or the gid of a user.
  'optPretty': true, // Boolean | Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging.
  'optFields': ["followers","assignee"], // [String] | Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options.
  'limit': 50, // Number | Results per page. The number of objects to return per page. The value must be between 1 and 100.
  'offset': eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9 // String | Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.'
};
apiInstance.getWorkspaceMembershipsForWorkspace(workspaceGid, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
workspaceGid String Globally unique identifier for the workspace or organization.
user String A string identifying a user. This can either be the string "me", an email, or the gid of a user. [optional]
optPretty Boolean Provides “pretty” output. Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. [optional]
optFields [String] Defines fields to return. Some requests return compact representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. [optional]
limit Number Results per page. The number of objects to return per page. The value must be between 1 and 100. [optional]
offset String Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' [optional]

Return type

GetWorkspaceMembershipsForUser200Response

Authorization

oauth2, personalAccessToken

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json