POST /goals/{goal_gid}/setMetric
Creates and adds a goal metric to a specified goal. Note that this replaces an existing goal metric if one already exists.
Servers
- https://app.asana.com/api/1.0
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
goal_gid |
String | Yes |
Globally unique identifier for the goal. |
Request headers
| Name | Type | Required | Description |
|---|---|---|---|
Content-Type |
String | Yes |
The media type of the request body.
Default value: "application/json" |
Query parameters
| Name | Type | Required | Description |
|---|---|---|---|
opt_pretty |
Boolean | No |
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. |
opt_fields[] |
Array | No |
This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. |
Request body fields
| Name | Type | Required | Description |
|---|---|---|---|
data |
Object | No |
A generic Asana Resource, containing a globally unique identifier. |
data.progress_source |
String | No |
This field defines how the progress value of a goal metric is being calculated. A goal's progress can be provided manually by the user, calculated automatically from contributing subgoals, projects, or tasks, or managed by an integration with an external data source, such as Salesforce. Valid values:
|
data.resource_type |
String | No |
The base type of this resource. |
data.currency_code |
String | No |
ISO 4217 currency code to format this custom field. This will be null if the |
data.gid |
String | No |
Globally unique identifier of the resource, as a string. |
data.target_number_value |
Number | No |
This number is the end value of a goal metric of type number. This number cannot equal |
data.current_display_value |
String | No |
This string is the current value of a goal metric of type string. |
data.is_custom_weight |
Boolean | No |
Conditional. Only relevant if |
data.resource_subtype |
String | No |
The subtype of this resource. Different subtypes retain many of the same fields and behavior, but may render differently in Asana or represent resources with different semantic meaning. Valid values:
|
data.precision |
Integer | No |
Conditional. Only relevant for goal metrics of type |
data.current_number_value |
Number | No |
This number is the current value of a goal metric of type number. |
data.initial_number_value |
Number | No |
This number is the start value of a goal metric of type number. |
data.unit |
String | No |
A supported unit of measure for the goal metric, or none. Valid values:
|
How to start integrating
- Add HTTP Task to your workflow definition.
- Search for the API you want to integrate with and click on the name.
- This loads the API reference documentation and prepares the Http request settings.
- Click Test request to test run your request to the API and see the API's response.