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

Latest commit

 

History

History
311 lines (222 loc) · 18.5 KB

GoalRelationshipsApi.md

File metadata and controls

311 lines (222 loc) · 18.5 KB

Asana.GoalRelationshipsApi

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

Method HTTP request Description
addSupportingRelationship POST /goals/{goal_gid}/addSupportingRelationship Add a supporting goal relationship
getGoalRelationship GET /goal_relationships/{goal_relationship_gid} Get a goal relationship
getGoalRelationships GET /goal_relationships Get goal relationships
removeSupportingRelationship POST /goals/{goal_gid}/removeSupportingRelationship Removes a supporting goal relationship
updateGoalRelationship PUT /goal_relationships/{goal_relationship_gid} Update a goal relationship

addSupportingRelationship

GetGoalRelationship200Response addSupportingRelationship(goalGid, addSupportingRelationshipRequest, opts)

Add a supporting goal relationship

Creates a goal relationship by adding a supporting resource to a given goal. Returns the newly created goal relationship record.

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.GoalRelationshipsApi();
let goalGid = 12345; // String | Globally unique identifier for the goal.
let addSupportingRelationshipRequest = new Asana.AddSupportingRelationshipRequest(); // AddSupportingRelationshipRequest | The supporting resource to be added to the goal
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.addSupportingRelationship(goalGid, addSupportingRelationshipRequest, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
goalGid String Globally unique identifier for the goal.
addSupportingRelationshipRequest AddSupportingRelationshipRequest The supporting resource to be added to the goal
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

GetGoalRelationship200Response

Authorization

oauth2, personalAccessToken

HTTP request headers

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

getGoalRelationship

GetGoalRelationship200Response getGoalRelationship(goalRelationshipGid, opts)

Get a goal relationship

Returns the complete updated goal relationship record for a single goal relationship.

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.GoalRelationshipsApi();
let goalRelationshipGid = 12345; // String | Globally unique identifier for the goal relationship.
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.getGoalRelationship(goalRelationshipGid, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
goalRelationshipGid String Globally unique identifier for the goal relationship.
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

GetGoalRelationship200Response

Authorization

oauth2, personalAccessToken

HTTP request headers

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

getGoalRelationships

GetGoalRelationships200Response getGoalRelationships(supportedGoal, opts)

Get goal relationships

Returns compact goal relationship records.

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.GoalRelationshipsApi();
let supportedGoal = 12345; // String | Globally unique identifier for the supported goal in the goal relationship.
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.
  'resourceSubtype': subgoal // String | If provided, filter to goal relationships with a given resource_subtype.
};
apiInstance.getGoalRelationships(supportedGoal, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
supportedGoal String Globally unique identifier for the supported goal in the goal relationship.
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]
resourceSubtype String If provided, filter to goal relationships with a given resource_subtype. [optional]

Return type

GetGoalRelationships200Response

Authorization

oauth2, personalAccessToken

HTTP request headers

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

removeSupportingRelationship

DeleteAttachment200Response removeSupportingRelationship(goalGid, removeSupportingRelationshipRequest, opts)

Removes a supporting goal relationship

Removes a goal relationship for a given parent goal.

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.GoalRelationshipsApi();
let goalGid = 12345; // String | Globally unique identifier for the goal.
let removeSupportingRelationshipRequest = new Asana.RemoveSupportingRelationshipRequest(); // RemoveSupportingRelationshipRequest | The supporting resource to be removed from the goal
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.removeSupportingRelationship(goalGid, removeSupportingRelationshipRequest, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
goalGid String Globally unique identifier for the goal.
removeSupportingRelationshipRequest RemoveSupportingRelationshipRequest The supporting resource to be removed from the goal
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

DeleteAttachment200Response

Authorization

oauth2, personalAccessToken

HTTP request headers

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

updateGoalRelationship

GetGoalRelationship200Response updateGoalRelationship(goalRelationshipGid, updateGoalRelationshipRequest, opts)

Update a goal relationship

An existing goal relationship can be updated by making a PUT request on the URL for that goal relationship. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged. Returns the complete updated goal relationship record.

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.GoalRelationshipsApi();
let goalRelationshipGid = 12345; // String | Globally unique identifier for the goal relationship.
let updateGoalRelationshipRequest = new Asana.UpdateGoalRelationshipRequest(); // UpdateGoalRelationshipRequest | The updated fields for the goal relationship.
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.updateGoalRelationship(goalRelationshipGid, updateGoalRelationshipRequest, opts, (error, data, response) => {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
});

Parameters

Name Type Description Notes
goalRelationshipGid String Globally unique identifier for the goal relationship.
updateGoalRelationshipRequest UpdateGoalRelationshipRequest The updated fields for the goal relationship.
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

GetGoalRelationship200Response

Authorization

oauth2, personalAccessToken

HTTP request headers

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