# CallApiGatewayRestApiEndpointJsonPathProps

Properties for calling an REST API Endpoint using JSONPath.

Extends: [CallApiGatewayEndpointJsonPathBaseProps](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions_tasks.CallApiGatewayEndpointJsonPathBaseProps.html), CallApiGatewayRestApiEndpointOptions
Used as argument in: [CallApiGatewayRestApiEndpoint.jsonPath](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions_tasks.CallApiGatewayRestApiEndpoint.html#jsonpath)

- Source: [`aws-stepfunctions-tasks/lib/apigateway/call-rest-api.ts`](https://github.com/aws/aws-cdk/blob/v2.278.0/packages/aws-cdk-lib/aws-stepfunctions-tasks/lib/apigateway/call-rest-api.ts#L35)
- Type last changed: v2.178.0 · 6 Feb 2025

## Example

TypeScript:

```ts
import * as apigateway from 'aws-cdk-lib/aws-apigateway';
declare const api: apigateway.RestApi;

tasks.CallApiGatewayRestApiEndpoint.jsonPath(this, 'Endpoint', {
  api,
  stageName: 'Stage',
  method: tasks.HttpMethod.PUT,
  integrationPattern: sfn.IntegrationPattern.WAIT_FOR_TASK_TOKEN,
  headers: sfn.TaskInput.fromObject({
    TaskToken: sfn.JsonPath.array(sfn.JsonPath.taskToken),
  }),
});
```

Python:

```python
import aws_cdk.aws_apigateway as apigateway
# api: apigateway.RestApi

tasks.CallApiGatewayRestApiEndpoint.json_path(self, "Endpoint",
    api=api,
    stage_name="Stage",
    method=tasks.HttpMethod.PUT,
    integration_pattern=sfn.IntegrationPattern.WAIT_FOR_TASK_TOKEN,
    headers=sfn.TaskInput.from_object({
        "TaskToken": sfn.JsonPath.array(sfn.JsonPath.task_token)
    })
)
```

Java:

```java
import software.amazon.awscdk.services.apigateway.*;
RestApi api;

CallApiGatewayRestApiEndpoint.jsonPath(this, "Endpoint", CallApiGatewayRestApiEndpointJsonPathProps.builder()
        .api(api)
        .stageName("Stage")
        .method(HttpMethod.PUT)
        .integrationPattern(IntegrationPattern.WAIT_FOR_TASK_TOKEN)
        .headers(TaskInput.fromObject(Map.of(
                "TaskToken", JsonPath.array(JsonPath.getTaskToken()))))
        .build());
```

C# / .NET:

```csharp
// Install: dotnet add package Amazon.CDK.Lib
using Amazon.CDK.AWS.APIGateway;
RestApi api;

CallApiGatewayRestApiEndpoint.JsonPath(this, "Endpoint", new CallApiGatewayRestApiEndpointJsonPathProps {
    Api = api,
    StageName = "Stage",
    Method = HttpMethod.PUT,
    IntegrationPattern = IntegrationPattern.WAIT_FOR_TASK_TOKEN,
    Headers = TaskInput.FromObject(new Dictionary<string, object> {
        { "TaskToken", JsonPath.Array(JsonPath.TaskToken) }
    })
});
```

Golang:

```go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
import apigateway "github.com/aws/aws-cdk-go/awscdk"
var api RestApi

tasks.CallApiGatewayRestApiEndpoint_JsonPath(this, jsii.String("Endpoint"), &CallApiGatewayRestApiEndpointJsonPathProps{
	Api: Api,
	StageName: jsii.String("Stage"),
	Method: tasks.HttpMethod_PUT,
	IntegrationPattern: sfn.IntegrationPattern_WAIT_FOR_TASK_TOKEN,
	Headers: sfn.TaskInput_FromObject(map[string]interface{}{
		"TaskToken": sfn.JsonPath_array(sfn.JsonPath_taskToken()),
	}),
})
```

## Properties

- `api`: [IRestApi](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_apigateway.IRestApi.html) (required) — API to call.

- `apiPath`: string — Path parameters appended after API endpoint.

  **Default:** No path

- `assign`: { [key: string]: any } — Workflow variables to store in this step.

  **Default:** Not assign variables

  Using workflow variables, you can store data in a step and retrieve that data in future steps.

- `authType`: [AuthType](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions_tasks.AuthType.html) = AuthType.NO_AUTH — Authentication methods.

- `comment`: string — A comment describing this state.

  **Default:** No comment

- `credentials`: [Credentials](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.Credentials.html) — Credentials for an IAM Role that the State Machine assumes for executing the task.

  **Default:** None (Task is executed using the State Machine's execution role)

  This enables cross-account resource invocations.

- `headers`: [TaskInput](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.TaskInput.html) — HTTP request information that does not relate to contents of the request.

  **Default:** No headers

- `heartbeat`: [Duration](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.Duration.html) = None — use `heartbeatTimeout`

- `heartbeatTimeout`: [Timeout](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.Timeout.html) = None — Timeout for the heartbeat.

  [disable-awslint:duration-prop-type] is needed because all props interface in
  aws-stepfunctions-tasks extend this interface

- `inputPath`: string = $ — JSONPath expression to select part of the state to be the input to this state.

  May also be the special value JsonPath.DISCARD, which will cause the effective
  input to be the empty object {}.

- `integrationPattern`: [IntegrationPattern](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.IntegrationPattern.html) — AWS Step Functions integrates with services directly in the Amazon States Language.

  **Default:** `IntegrationPattern.REQUEST_RESPONSE` for most tasks. `IntegrationPattern.RUN_JOB` for the following exceptions: `BatchSubmitJob`, `EmrAddStep`, `EmrCreateCluster`, `EmrTerminationCluster`, and `EmrContainersStartJobRun`.

  You can control these AWS services using service integration patterns.

  Depending on the AWS Service, the Service Integration Pattern availability will vary.

- `method`: [HttpMethod](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions_tasks.HttpMethod.html) (required) — Http method for the API.

- `outputPath`: string = $ — JSONPath expression to select part of the state to be the output to this state.

  May also be the special value JsonPath.DISCARD, which will cause the effective
  output to be the empty object {}.

- `queryLanguage`: [QueryLanguage](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.QueryLanguage.html) = JSONPath — The name of the query language used by the state.

  If the state does not contain a `queryLanguage` field,
  then it will use the query language specified in the top-level `queryLanguage` field.

- `queryParameters`: [TaskInput](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.TaskInput.html) — Query strings attached to end of request.

  **Default:** No query parameters

- `region`: string — Specify a custom Region where the API is deployed, e.g. 'us-east-1'.

  **Default:** Uses the Region of the stack containing the `api`.

- `requestBody`: [TaskInput](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.TaskInput.html) — HTTP Request body.

  **Default:** No request body

- `resultPath`: string = $ — JSONPath expression to indicate where to inject the state's output.

  May also be the special value JsonPath.DISCARD, which will cause the state's
  input to become its output.

- `resultSelector`: { [key: string]: any } = None — The JSON that will replace the state's raw result and become the effective result before ResultPath is applied.

  You can use ResultSelector to create a payload with values that are static
  or selected from the state's raw result.

- `stageName`: string (required) — Name of the stage where the API is deployed to in API Gateway.

- `stateName`: string — Optional name for this state.

  **Default:** The construct ID will be used as state name

- `taskTimeout`: [Timeout](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_stepfunctions.Timeout.html) = None — Timeout for the task.

  [disable-awslint:duration-prop-type] is needed because all props interface in
  aws-stepfunctions-tasks extend this interface

- `timeout`: [Duration](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.Duration.html) = None — use `taskTimeout`
