> **Experimental**
>
> `@aws-cdk/integ-tests-alpha` is an [**experimental**](/stability) (alpha) package: its API may change in any release, without a major version bump.
# IApiCall

Represents an ApiCall.

Extends: IApiCall
Extends: IConstruct
Implemented by: ApiCallBase, AwsApiCall, HttpApiCall, LambdaInvokeFunction

- Stability: [Experimental](/cdk/api/stability.html)
- Source: [`lib/assertions/api-call-base.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0-alpha.0/packages/@aws-cdk/integ-tests-alpha/lib/assertions/api-call-base.ts#L11)

## Properties

- `node`: [Node](/cdk/api/v2/docs/constructs.Node.html) — The tree node.

- `provider`: [AssertionsProvider](/cdk/api/v2/docs/@aws-cdk_integ-tests-alpha.AssertionsProvider.html) — access the AssertionsProvider.

  This can be used to add additional IAM policies
  the provider role policy

  ```ts
  declare const apiCall: AwsApiCall;
  apiCall.provider.addToRolePolicy({
    Effect: 'Allow',
    Action: ['s3:GetObject'],
    Resource: ['*'],
  });
  ```

## Methods

- `assertAtPath(path: string, expected: ExpectedResult): IApiCall // chainable` — Assert that the ExpectedResult is equal to the result of the AwsApiCall at the given path.

  Providing a path will filter the output of the initial API call.

  For example the SQS.receiveMessage api response would look
  like:

  If you wanted to assert the value of `Body` you could do

  ```ts
  const actual = {
    Messages: [{
      MessageId: '',
      ReceiptHandle: '',
      MD5OfBody: '',
      Body: 'hello',
      Attributes: {},
      MD5OfMessageAttributes: {},
      MessageAttributes: {}
    }]
  };

  declare const integ: IntegTest;
  const message = integ.assertions.awsApiCall('SQS', 'receiveMessage');

  message.assertAtPath('Messages.0.Body', ExpectedResult.stringLikeRegexp('hello'));
  ```

- `expect(expected: ExpectedResult): IApiCall // chainable` — Assert that the ExpectedResult is equal to the result of the AwsApiCall.

  ```ts
  declare const integ: IntegTest;
  const invoke = integ.assertions.invokeFunction({
    functionName: 'my-func',
  });
  invoke.expect(ExpectedResult.objectLike({ Payload: 'OK' }));
  ```

- `getAtt(attributeName: string): Reference` — Returns the value of an attribute of the custom resource of an arbitrary type.

  Attributes are returned from the custom resource provider through the
  `Data` map where the key is the attribute name.

  **Parameters**

  - `attributeName` — the name of the attribute.

  **Returns:** a token for `Fn::GetAtt`. Use `Token.asXxx` to encode the returned `Reference` as a specific type or use the convenience `getAttString` for string attributes.

- `getAttString(attributeName: string): string` — Returns the value of an attribute of the custom resource of type string.

  Attributes are returned from the custom resource provider through the
  `Data` map where the key is the attribute name.

  **Parameters**

  - `attributeName` — the name of the attribute.

  **Returns:** a token for `Fn::GetAtt` encoded as a string.

- `next(next: IApiCall): IApiCall // chainable` — Allows you to chain IApiCalls. This adds an explicit dependency betweent the two resources.

  Returns the IApiCall provided as `next`

  ```ts
  declare const first: IApiCall;
  declare const second: IApiCall;

  first.next(second);
  ```

- `waitForAssertions(options?: WaiterStateMachineOptions): IApiCall // chainable` — Wait for the IApiCall to return the expected response.

  If no expected response is specified then it will wait for
  the IApiCall to return a success

  ```ts
  declare const integ: IntegTest;
  declare const executionArn: string;
  integ.assertions.awsApiCall('StepFunctions', 'describeExecution', {
     executionArn,
  }).waitForAssertions();
  ```

- `with(...mixins: IMixin[]): IConstruct` — Applies one or more mixins to this construct.

  Mixins are applied in order. The list of constructs is captured at the
  start of the call, so constructs added by a mixin will not be visited.

  **Parameters**

  - `mixins` — The mixins to apply.

  **Returns:** This construct for chaining
