Create an Asset Report 
=======================

#### Learn how to create Asset Reports with the Assets product 

In this guide, we'll start from scratch and walk through how to use [Assets](https://plaid.com/docs/api/products/assets/index.html.md) to generate and retrieve Asset Reports. If a user's Asset Report involves data from multiple financial institutions, the user will need to allow access to each institution, which will in turn enable you to access their data from each institution. If you are already familiar with using Plaid and are set up to make calls to the Plaid API, you can skip ahead to [Creating Asset Reports](https://plaid.com/docs/assets/add-to-app/index.html.md#creating-asset-reports) .

#### Get Plaid API keys and complete application and company profile 

If you don't already have one, you'll need to [create a Plaid developer account](https://dashboard.plaid.com/signup) . After creating your account, you can find your [API keys](https://dashboard.plaid.com/developers/keys) under the Developers menu on the Plaid Dashboard.

You will also need to complete your [application profile](https://dashboard.plaid.com/settings/company/app-branding) and [company profile](https://dashboard.plaid.com/settings/company/profile) in the Dashboard. This will provide basic information about your app to help users manage their connection on the Plaid Portal at [my.plaid.com](https://my.plaid.com) . The application profile and company profile must be completed before connecting to certain institutions in Production.

#### Install and initialize Plaid libraries 

You can use our official server-side client libraries to connect to the Plaid API from your application:

```node
// Install via npm
npm install --save plaid

```

```bash
## Not applicable with curl calls

```

```ruby
# Available as a gem
gem install plaid

```

```java
/*
For Gradle, add the following dependency to your build.gradle and replace {VERSION} with the version number you want to use from
- https://github.com/plaid/plaid-java/releases/latest
*/
implementation "com.plaid:plaid-java:{VERSION}"

/*
For Maven, add the following dependency to your POM and replace {VERSION} with the version number you want to use from
- https://github.com/plaid/plaid-java/releases/latest
*/

  com.plaid
  plaid-java
  {VERSION}


```

```python
# Install through pip, only supports Python 3
pip install --upgrade plaid-python

```

```go
go get github.com/plaid/plaid-go

```

After you've installed Plaid's client libraries, you can initialize them by passing in your `client_id`, `secret`, and the environment you wish to connect to (Sandbox or Production). This will make sure the client libraries pass along your `client_id` and `secret` with each request, and you won't need to explicitly include it in any other calls.

```node
// Using Express
const express = require('express');
const app = express();
app.use(express.json());

const { Configuration, PlaidApi, PlaidEnvironments } = require('plaid');

const configuration = new Configuration({
  basePath: PlaidEnvironments.sandbox,
  baseOptions: {
    headers: {
      'PLAID-CLIENT-ID': process.env.PLAID_CLIENT_ID,
      'PLAID-SECRET': process.env.PLAID_SECRET,
    },
  },
});

const client = new PlaidApi(configuration);

```

```bash
## Not applicable with curl calls

```

```ruby
require 'sinatra'
require 'plaid'

set :port, ENV['APP_PORT'] || 8000

configuration = Plaid::Configuration.new
configuration.server_index = Plaid::Configuration::Environment[ENV['PLAID_ENV'] || 'sandbox']
configuration.api_key['PLAID-CLIENT-ID'] =  ENV['PLAID_CLIENT_ID']
configuration.api_key['PLAID-SECRET'] = ENV['PLAID_SECRET']

api_client = Plaid::ApiClient.new(
  configuration
)

client = Plaid::PlaidApi.new(api_client)

```

```java
import java.net.*;
import java.io.*;
import retrofit2.Response;
import java.util.Arrays;
import com.sun.net.httpserver.*;

import com.plaid.client.ApiClient;
import com.plaid.client.request.PlaidApi;

public class PlaidExample {
  private static final String CLIENT_ID = System.getenv("PLAID_CLIENT_ID");
  private static final String SECRET = System.getenv("PLAID_SECRET");

  public static void main(String[] args) {
    HttpServer server = HttpServer.create(
      new InetSocketAddress("localhost", 8000), 0);
    server.createContext("/create_link_token", new GetLinkToken());
    server.setExecutor(null);
    server.start();
  }

  // Additional server code goes here

}

```

```python
import plaid
from plaid.api import plaid_api

from flask import Flask
from flask import render_template
from flask import request
from flask import jsonify

app = Flask(name)

configuration = plaid.Configuration(
  host=plaid.Environment.Sandbox,
  api_key={
    'clientId': PLAID_CLIENT_ID,
    'secret': PLAID_SECRET,
  }
)

api_client = plaid.ApiClient(configuration)
client = plaid_api.PlaidApi(api_client)

# Additional server code goes here

if __name__ == "__main__":
    app.run(port=8000)

```

```go
import (
    "context"
    "net/http"
    "os"

    "github.com/gin-gonic/gin"
    "github.com/plaid/plaid-go/v3/plaid"
)


configuration := plaid.NewConfiguration()
configuration.AddDefaultHeader("PLAID-CLIENT-ID", os.Getenv("CLIENT_ID"))
configuration.AddDefaultHeader("PLAID-SECRET", os.Getenv("SECRET"))
configuration.UseEnvironment(plaid.Sandbox)
client := plaid.NewAPIClient(configuration)


func main() {
  r := gin.Default()
  // Server endpoints would be declared here
  // e.g.  r.POST("/create_link_token", createLinkToken)
 r.POST("/create_link_token", createLinkToken)

  err := r.Run(":8000")
  if err != nil {
    panic("unable to start server")
  }
}

```

#### Create an Item in Link 

Plaid Link is a drop-in module that provides a secure, elegant authentication flow for each institution that Plaid supports. Link makes it secure and easy for users to connect their bank accounts to Plaid. Note that these instructions cover Link on the web. For instructions on using Link within mobile apps, see the [Link documentation](https://plaid.com/docs/link/index.html.md) .

Using Link, we will create a Plaid _Item_, which is a Plaid term for a login at a financial institution. An Item is not the same as a financial institution account, although every account will be associated with an Item. For example, if a user has one login at their bank that allows them to access both their checking account and their savings account, a single Item would be associated with both of those accounts. Asset Reports can consist of user data from multiple financial institutions; users will need to use Link to provide access to each financial institution, providing you with multiple Items. If you want to customize Link's look and feel, you can do so from the [Dashboard](https://dashboard.plaid.com/link) .

Before initializing Link, you will need to create a new `link_token` on the server side of your application. A `link_token` is a short-lived, one-time use token that is used to authenticate your app with Link. You can create one using the [/link/token/create](https://plaid.com/docs/api/link/index.html.md#linktokencreate) endpoint. Then, on the client side of your application, you'll need to initialize Link with the `link_token` that you just created. Since, for Assets, users may need to grant access to more than one financial institution via Link, you may need to initialize Link more than once.

In the code samples below, you will need to replace `PLAID_CLIENT_ID` and `PLAID_SECRET` with your own keys, which you can obtain from the [Dashboard](https://dashboard.plaid.com/developers/keys) .

##### Create a link\_token 

```node
app.post('/api/create_link_token', async function (request, response) {
  // Get the client_user_id by searching for the current user
  const user = await User.find(...);
  const clientUserId = user.id;
  const linkTokenRequest = {
    user: {
      // This should correspond to a unique id for the current user.
      client_user_id: clientUserId,
    },
    client_name: 'Plaid Test App',
    products: ['assets'],
    language: 'en',
    webhook: 'https://webhook.example.com',
    redirect_uri: 'https://domainname.com/oauth-page.html',
    country_codes: ['US'],
  };
  try {
    const createTokenResponse = await client.linkTokenCreate(linkTokenRequest);
    response.json(createTokenResponse.data);
  } catch (error) {
    // handle error
  }
});

```

```bash
curl -X POST https://sandbox.plaid.com/link/token/create \
-H 'Content-Type: application/json' \
-d '{
  "client_id": "${PLAID_CLIENT_ID}",
  "secret": "${PLAID_SECRET}",
  "client_name": "Plaid Test App",
  "user": { "client_user_id": "${UNIQUE_USER_ID}" },
  "products": ["assets"],
  "country_codes": ["US"],
  "language": "en",
  "webhook": "https://webhook.example.com",
  "redirect_uri": "https://domainname.com/oauth-page.html"
}'

```

```ruby
post '/api/create_link_token' do
  # Get the client_user_id by searching for the current user
  current_user = User.find(...)
  client_user_id = current_user.id

  # Create a link_token for the given user
  request = Plaid::LinkTokenCreateRequest.new(
    {
      user: { client_user_id: client_user_id },
      client_name: 'Plaid Test App',
      products: ['assets'],
      country_codes: ['US'],
      language: "en",
      redirect_uri: nil_if_empty_envvar('PLAID_REDIRECT_URI'),
      webhook: 'https://webhook.example.com'
    }
  )
  response = client.link_token_create(request)
  content_type :json
  response.to_json
end

```

```java
import com.plaid.client.model.Products;
import com.plaid.client.model.CountryCode;
import com.plaid.client.model.LinkTokenCreateRequest;
import com.plaid.client.model.LinkTokenCreateRequestUser;
import com.plaid.client.model.LinkTokenCreateResponse;

public class PlaidExample {

  ...
  static class GetLinkToken implements HttpHandler {
    private static PlaidApi plaidClient;

    public void handle(HttpExchange t) throws IOException {
      // Create your Plaid client
      HashMap apiKeys = new HashMap();
      apiKeys.put("clientId", CLIENT_ID);
      apiKeys.put("secret", SECRET);
      ApiClient apiClient = new ApiClient(apiKeys);
      apiClient.setPlaidAdapter(ApiClient.Sandbox);

      plaidClient = apiClient.createService(PlaidApi.class);

      // Get the clientUserId by searching for the current user
      User userFromDB = db.find(...);
      String clientUserId = userFromDB.id;
      LinkTokenCreateRequestUser user = new LinkTokenCreateRequestUser()
        .clientUserId(clientUserId);

      // Create a link_token for the given user
      LinkTokenCreateRequest request = new LinkTokenCreateRequest()
        .user(user)
        .clientName("Plaid Test App")
        .products(Arrays.asList(Products.fromValue("assets")))
        .countryCodes(Arrays.asList(CountryCode.US))
        .language("en")
        .redirectUri("https://domainname.com/oauth-page.html")
        .webhook("https://webhook.example.com");

      Response response = plaidClient
        .linkTokenCreate(request)
        .execute();

      // Send the data to the client
      return response.body();
    }
  }
}

```

```python
from plaid.model.link_token_create_request import LinkTokenCreateRequest
from plaid.model.link_token_create_request_user import LinkTokenCreateRequestUser
from plaid.model.products import Products
from plaid.model.country_code import CountryCode

@app.route("/create_link_token", methods=['POST'])
def create_link_token():
    # Get the client_user_id by searching for the current user
    user = User.find(...)
    client_user_id = user.id

    # Create a link_token for the given user
    request = LinkTokenCreateRequest(
            products=[Products("assets")],
            client_name="Plaid Test App",
            country_codes=[CountryCode('US')],
            redirect_uri='https://domainname.com/oauth-page.html',
            language='en',
            webhook='https://webhook.example.com',
            user=LinkTokenCreateRequestUser(
                client_user_id=client_user_id
            )
        )
    response = client.link_token_create(request)

    # Send the data to the client
    return jsonify(response.to_dict())


```

```go
func createLinkToken(c *gin.Context) {
  ctx := context.Background()

  // Get the client_user_id by searching for the current user
  user, _ := usermodels.Find(...)
  clientUserId := user.ID.String()

  // Create a link_token for the given user
  request := plaid.NewLinkTokenCreateRequest("Plaid Test App", "en", []plaid.CountryCode{plaid.COUNTRYCODE_US}, *plaid.NewLinkTokenCreateRequestUser(clientUserId))
  request.SetWebhook("https://webhook.sample.com")
  request.SetRedirectUri("https://domainname.com/oauth-page.html")
  request.SetProducts([]plaid.Products{plaid.PRODUCTS_ASSETS})

  resp, _, err := testClient.PlaidApi.LinkTokenCreate(ctx).LinkTokenCreateRequest(*request).Execute()

  // Send the data to the client
  c.JSON(http.StatusOK, gin.H{
    "link_token": resp.GetLinkToken(),
  })
}


```

##### Install Link dependency 

index.html

```html
<head>
  <title>Connect a bank</title>
  <script src="https://cdn.plaid.com/link/v2/stable/link-initialize.js"></script>
</head>
```

##### Configure the client-side Link handler 

app.js

```javascript
const linkHandler = Plaid.create({
  token: (await $.post('/create_link_token')).link_token,
  onSuccess: (public_token, metadata) => {
    // Send the public_token to your app server.
    $.post('/exchange_public_token', {
      public_token: public_token,
    });
  },
  onExit: (err, metadata) => {
    // Optionally capture when your user exited the Link flow.
    // Storing this information can be helpful for support.
  },
  onEvent: (eventName, metadata) => {
    // Optionally capture Link flow events, streamed through
    // this callback as your users connect an Item to Plaid.
  },
});

linkHandler.open();
```

#### Get a persistent access\_token 

Next, on the server side, we need to exchange our `public_token` for an `access_token` and `item_id` for each Item the user provided you with via Link. The `access_token` will allow us to make authenticated calls to the Plaid API for its corresponding financial institution. Doing so is as easy as calling the [/item/public\_token/exchange](https://plaid.com/docs/api/items/index.html.md#itempublic_tokenexchange) endpoint from our server-side handler. We'll use the client library we configured earlier to make the API call.

Save the `access_token`s and `item_id`s in a secure datastore, as they're used to access `Item` data and identify `webhooks`, respectively. An `access_token` will remain valid unless you actively choose to expire it via rotation or remove the corresponding Item via [/item/remove](https://plaid.com/docs/api/items/index.html.md#itemremove) . An `access_token` should be stored securely and never in client-side code. A `public_token` is a one-time use token with a lifetime of 30 minutes, so there is no need to store it.

```node
app.post('/api/exchange_public_token', async function (
  request,
  response,
  next,
) {
  const publicToken = request.body.public_token;
  try {
    const tokenResponse = await client.itemPublicTokenExchange({
      public_token: publicToken,
    });

    // These values should be saved to a persistent database and
    // associated with the currently signed-in user
    const accessToken = tokenResponse.data.access_token;
    const itemID = tokenResponse.data.item_id;

    response.json({ public_token_exchange: 'complete' });
  } catch (error) {
    // handle error
  }
});

```

```bash
curl -X POST https://sandbox.plaid.com/item/public_token/exchange \
-H 'Content-Type: application/json' \
-d '{
  "client_id": "${PLAID_CLIENT_ID}",
  "secret": "${PLAID_SECRET}",
  "public_token": "public-sandbox-12345678-abcd-1234-abcd-1234567890ab"
}'

```

```ruby
access_token = nil

post '/api/exchange_public_token' do
  request = Plaid::ItemPublicTokenExchangeRequest.new(
    {
      public_token: params["public_token"]
    }
  )
  response = client.item_public_token_exchange(request)

  # These values should be saved to a persistent database and
  # associated with the currently signed-in user
  access_token = response.access_token
  item_id = response.item_id

  content_type :json
  {public_token_exchange: "complete"}.to_json
end

```

```java
import com.plaid.client.model.ItemPublicTokenExchangeRequest;
import com.plaid.client.model.ItemPublicTokenExchangeResponse;

public class PlaidExample {

  ...
  static class GetAccessToken implements HttpHandler {
    private static PlaidClient plaidClient;

    private String publicToken;
    private String accessToken;
    private String itemId;

    public void handle(HttpExchange t) throws IOException {
      // Simplified pseudo-code for obtaining public_token
      InputStream is = t.getRequestBody();
      publicToken = is.publicToken();

      // Create your Plaid client
      HashMap apiKeys = new HashMap();
      apiKeys.put("clientId", CLIENT_ID);
      apiKeys.put("secret", SECRET);
      apiKeys.put("plaidVersion", "2020-09-14");
      apiClient = new ApiClient(apiKeys);
      apiClient.setPlaidAdapter(ApiClient.Sandbox);

      plaidClient = apiClient.createService(PlaidApi.class);

      // Exchange public_token for an access_token
      ItemPublicTokenExchangeRequest request = new ItemPublicTokenExchangeRequest()
        .publicToken(publicToken);

      Response response = plaidClient
        .itemPublicTokenExchange(request)
        .execute();

      // These values should be saved to a persistent database and
      // associated with the currently signed-in user
      accessToken = response.body().getAccessToken();
      itemId      = response.body().getItemId();

      String message = "{\"public_token_exchange\": \"complete\"}";
      return Response
        .status(Response.Status.OK)
        .entity(message)
        .type(MediaType.APPLICATION_JSON)
      }
  }
}

```

```python
access_token = None
item_id = None

@app.route('/exchange_public_token', methods=['POST'])
def exchange_public_token():
    global access_token
    public_token = request.form['public_token']
    request = ItemPublicTokenExchangeRequest(
      public_token=public_token
    )
    response = client.item_public_token_exchange(request)

    # These values should be saved to a persistent database and
    # associated with the currently signed-in user
    access_token = response['access_token']
    item_id = response['item_id']

    return jsonify({'public_token_exchange': 'complete'})

```

```go
func getAccessToken(c *gin.Context) {
  ctx := context.Background()
  publicToken := c.PostForm("public_token")

  // exchange the public_token for an access_token
  exchangePublicTokenReq := plaid.NewItemPublicTokenExchangeRequest(publicToken)
    exchangePublicTokenResp, _, err := client.PlaidApi.ItemPublicTokenExchange(ctx).ItemPublicTokenExchangeRequest(
        *exchangePublicTokenReq,
    ).Execute()

  // These values should be saved to a persistent database and
  // associated with the currently signed-in user
  accessToken := exchangePublicTokenResp.GetAccessToken()
  itemID := exchangePublicTokenResp.GetItemId()

  c.JSON(http.StatusOK, gin.H{"public_token_exchange": "complete"})
}



```

#### Creating Asset Reports 

Now that the authentication step is out of the way, we can begin using authenticated endpoints from the Plaid API and create an Asset Report using the [/asset\_report/create](https://plaid.com/docs/api/products/assets/index.html.md#asset_reportcreate) endpoint.

##### Assets sample request: create 

```python
import plaid
from plaid.model.asset_report_create_request import AssetReportCreateRequest
from plaid.model.asset_report_create_request_options import AssetReportCreateRequestOptions
from plaid.model.asset_report_user import AssetReportUser

# access_tokens is a list of Item access tokens.
# Note that the assets product must be enabled for all Items.
# All fields on the options object are optional.
request = AssetReportCreateRequest(
    access_tokens=[access_token],
    days_requested=90,
    options=AssetReportCreateRequestOptions(
        webhook='https://www.example.com',
        client_report_id='123',
        user=AssetReportUser(
            client_user_id='789',
            first_name='Jane',
            middle_name='Leah',
            last_name='Doe',
            ssn='123-45-6789',
            phone_number='(555) 123-4567',
            email='jane.doe@example.com',
        )
    )
)
response = client.asset_report_create(request)
asset_report_id = response['asset_report_id']
asset_report_token = response['asset_report_token']

```

```ruby
require 'plaid'

# access_tokens is a list of Item access tokens.
# Note that the assets product must be enabled for all Items.
# All fields on the options Hash are optional.
options = {
  client_report_id: '123',
  webhook: 'https://www.example.com',
  user: {
    client_user_id: '789',
    first_name: 'Jane',
    middle_name: 'Leah',
    last_name: 'Doe',
    ssn: '123-45-6789',
    phone_number: '(555) 123-4567',
    email: 'jane.doe@example.com',
  },
}
request = Plaid::AssetReportCreateRequest.new(
  {
    access_tokens: [access_token],
    days_requested: 90,
    options: options
  }
)
response = client.asset_report_create(request)
asset_report_id = response.asset_report_id
asset_report_token = response.asset_report_token

```

```go
import (
    "context"

    "github.com/plaid/plaid-go/v42/plaid"
)

request := plaid.NewAssetReportCreateRequest(90)
request.SetAccessTokens([]string{accessToken})
response, _, err := client.PlaidApi.AssetReportCreate(ctx).AssetReportCreateRequest(
  *request,
).Execute()

```

```bash
curl -X POST https://sandbox.plaid.com/asset_report/create \
-H 'Content-Type: application/json' \
-d '{
 "client_id": "${PLAID_CLIENT_ID}",
 "secret": "${PLAID_SECRET}",
 "access_tokens": [String],
 "days_requested": Integer,
 "options": {
    // all optional
    "client_report_id": String,
    "webhook": String,
    "user": {
      // all optional
      "client_user_id": String,
      "first_name": String,
      "middle_name": String,
      "last_name": String,
      "ssn": String,
      "phone_number": String,
      "email": String
    }
 }
}'

```

```java
import com.plaid.client.model.AssetReportCreateRequest;
import com.plaid.client.model.AssetReportCreateRequestOptions;
import com.plaid.client.model.AssetReportUser;
import com.plaid.client.model.AssetReportCreateResponse;

// access_tokens is an array of Item access tokens.
// Note that the assets product must be enabled for all Items.
// All fields on the options object are optional.
AssetReportCreateRequest assetReportCreateRequest = new AssetReportCreateRequest()
  .accessTokens(access_tokens)
  .daysRequested(90);

AssetReportUser assetReportUser = new AssetReportUser()
  .firstName("Alberta")
  .middleName("Bobbeth")
  .lastName("Charleson");

AssetReportCreateRequestOptions assetReportCreateOptions = new AssetReportCreateRequestOptions()
  .user(assetReportUser)
  .webhook(webhookUrl);

assetReportCreateRequest.options(assetReportCreateOptions);

Response response = client
  .assetReportCreate(assetReportCreateRequest)
  .execute();
String assetReportId = response.body().getAssetReportId();
String assetReportToken = response.body().getAssetReportToken();

```

```node
const { AssetReportCreateRequest } = require('plaid');

const daysRequested = 90;
const options = {
  client_report_id: '123',
  webhook: 'https://www.example.com',
  user: {
    client_user_id: '789',
    first_name: 'Jane',
    middle_name: 'Leah',
    last_name: 'Doe',
    ssn: '123-45-6789',
    phone_number: '(555) 123-4567',
    email: 'jane.doe@example.com',
  },
};
const request: AssetReportCreateRequest = {
  access_tokens: [accessToken],
  days_requested,
  options,
};
// accessTokens is an array of Item access tokens.
// Note that the assets product must be enabled for all Items.
// All fields on the options object are optional.
try {
  const response = await plaidClient.assetReportCreate(request);
  const assetReportId = response.data.asset_report_id;
  const assetReportToken = response.data.asset_report_token;
} catch (error) {
  // handle error
}

```

Sample response data is below.

Assets response: create

```json
{
  "asset_report_token": "assets-sandbox-6f12f5bb-22dd-4855-b918-f47ec439198a",
  "asset_report_id": "1f414183-220c-44f5-b0c8-bc0e6d4053bb",
  "request_id": "Iam3b"
}
```

#### Fetching asset data 

Once an Asset Report has been created, it can be retrieved to analyze the user's loan eligibility. For more detailed information on the schema for Asset Reports, see [/asset\_report/get](https://plaid.com/docs/api/products/assets/index.html.md#asset_reportget) .

Asset Reports are not generated instantly. If you receive a `PRODUCT_NOT_READY` error when calling [/asset\_report/get](https://plaid.com/docs/api/products/assets/index.html.md#asset_reportget) , the requested Asset Report has not yet been generated. To be alerted when the requested Asset Report has been generated, listen to [Assets webhooks](https://plaid.com/docs/api/products/assets/index.html.md#product_ready) .

##### Assets sample request: get 

```go
import (
    "context"

    "github.com/plaid/plaid-go/v42/plaid"
)

request := plaid.NewAssetReportGetRequest()
request.SetAssetReportToken(assetReportToken)
response, _, err := client.PlaidApi.AssetReportGet(ctx).AssetReportGetRequest(*request).Execute()

```

```bash
curl -X POST https://sandbox.plaid.com/asset_report/get \
 -H 'Content-Type: application/json' \
 -d '{
   "client_id": "${PLAID_CLIENT_ID}",
   "secret": "${PLAID_SECRET}",
   "asset_report_token": String,
   "include_insights": Boolean
 }'

```

```python
import plaid
from plaid.model.asset_report_get_request import AssetReportGetRequest

# asset_report_token is the token from the AssetReport.create response.
try:
    request = AssetReportGetRequest(asset_report_token=asset_report_token)
    response = client.asset_report_get(request)
    report = response['report']
except plaid.ApiException as e:
   if e.code == 'PRODUCT_NOT_READY':
       # Asset report is not ready yet. Try again later.
   else:
       # Handle error.

```

```java
import com.plaid.client.model.AssetReportGetRequest;
import com.plaid.client.model.AssetReportGetResponse;

// assetReportToken is the token from the AssetReportCreateRequest response.
AssetReportGetRequest request = new AssetReportGetRequest()
    .includeInsights(true)
    .assetReportToken(assetReportToken);

Response response =
    client().assetReportGet(request).execute();
AssetReport report = response.body().getReport();

```

```ruby
require 'plaid'

# asset_report_token is the token from the AssetReport.create response.
request = Plaid::AssetReportGetRequest.new({ asset_report_token: asset_report_token })
response = client.asset_report_get(request)
report = response.report

```

```node
const { AssetReportGetRequest } = require('plaid');

const request: AssetReportGetRequest = {
  asset_report_token: assetReportToken,
  include_insights: true,
};
try {
  const response = await plaidClient.assetReportGet(request);
  const assetReportId = response.data.asset_report_id;
} catch (error) {
  // handle error
}

```

Sample response data is below.

Assets response: get

```json
{
  "report": {
    "asset_report_id": "bf3a0490-344c-4620-a219-2693162e4b1d",
    "client_report_id": "123abc",
    "date_generated": "2020-06-05T22:47:53Z",
    "days_requested": 2,
    "items": [
      {
        "accounts": [
          {
            "account_id": "3gE5gnRzNyfXpBK5wEEKcymJ5albGVUqg77gr",
            "balances": {
              "available": 200,
              "current": 210,
              "iso_currency_code": "USD",
              "limit": null,
              "unofficial_currency_code": null
            },
            "days_available": 2,
            "historical_balances": [
              {
                "current": 210,
                "date": "2020-06-04",
                "iso_currency_code": "USD",
                "unofficial_currency_code": null
              },
              {
                "current": 210,
                "date": "2020-06-03",
                "iso_currency_code": "USD",
                "unofficial_currency_code": null
              }
            ],
            "mask": "1111",
            "name": "Plaid Saving",
            "official_name": "Plaid Silver Standard 0.1% Interest Saving",
            "owners": [
              {
                "addresses": [
                  {
                    "data": {
                      "city": "Malakoff",
                      "country": "US",
                      "postal_code": "14236",
                      "region": "NY",
                      "street": "2992 Cameron Road"
                    },
                    "primary": true
                  },
                  {
                    "data": {
                      "city": "San Matias",
                      "country": "US",
                      "postal_code": "93405-2255",
                      "region": "CA",
                      "street": "2493 Leisure Lane"
                    },
                    "primary": false
                  }
                ],
                "emails": [
                  {
                    "data": "accountholder0@example.com",
                    "primary": true,
                    "type": "primary"
                  },
                  {
                    "data": "extraordinarily.long.email.username.123456@reallylonghostname.com",
                    "primary": false,
                    "type": "other"
                  }
                ],
                "names": ["Alberta Bobbeth Charleson"],
                "phone_numbers": [
                  {
                    "data": "1112223333",
                    "primary": false,
                    "type": "home"
                  },
                  {
                    "data": "1112225555",
                    "primary": false,
                    "type": "mobile1"
                  }
                ]
              }
            ],
            "ownership_type": null,
            "subtype": "savings",
            "transactions": [],
            "type": "depository"
          },
          {
            "account_id": "BxBXxLj1m4HMXBm9WZJyUg9XLd4rKEhw8Pb1J",
            "balances": {
              "available": null,
              "current": 56302.06,
              "iso_currency_code": "USD",
              "limit": null,
              "unofficial_currency_code": null
            },
            "days_available": 2,
            "historical_balances": [],
            "mask": "8888",
            "name": "Plaid Mortgage",
            "official_name": null,
            "owners": [
              {
                "addresses": [
                  {
                    "data": {
                      "city": "Malakoff",
                      "country": "US",
                      "postal_code": "14236",
                      "region": "NY",
                      "street": "2992 Cameron Road"
                    },
                    "primary": true
                  },
                  {
                    "data": {
                      "city": "San Matias",
                      "country": "US",
                      "postal_code": "93405-2255",
                      "region": "CA",
                      "street": "2493 Leisure Lane"
                    },
                    "primary": false
                  }
                ],
                "emails": [
                  {
                    "data": "accountholder0@example.com",
                    "primary": true,
                    "type": "primary"
                  },
                  {
                    "data": "extraordinarily.long.email.username.123456@reallylonghostname.com",
                    "primary": false,
                    "type": "other"
                  }
                ],
                "names": ["Alberta Bobbeth Charleson"],
                "phone_numbers": [
                  {
                    "data": "1112223333",
                    "primary": false,
                    "type": "home"
                  },
                  {
                    "data": "1112225555",
                    "primary": false,
                    "type": "mobile1"
                  }
                ]
              }
            ],
            "ownership_type": null,
            "subtype": "mortgage",
            "transactions": [],
            "type": "loan"
          },
          {
            "account_id": "dVzbVMLjrxTnLjX4G66XUp5GLklm4oiZy88yK",
            "balances": {
              "available": null,
              "current": 410,
              "iso_currency_code": "USD",
              "limit": null,
              "unofficial_currency_code": null
            },
            "days_available": 2,
            "historical_balances": [
              {
                "current": 410,
                "date": "2020-06-04",
                "iso_currency_code": "USD",
                "unofficial_currency_code": null
              },
              {
                "current": 410,
                "date": "2020-06-03",
                "iso_currency_code": "USD",
                "unofficial_currency_code": null
              }
            ],
            "mask": "3333",
            "name": "Plaid Credit Card",
            "official_name": "Plaid Diamond 12.5% APR Interest Credit Card",
            "owners": [
              {
                "addresses": [
                  {
                    "data": {
                      "city": "Malakoff",
                      "country": "US",
                      "postal_code": "14236",
                      "region": "NY",
                      "street": "2992 Cameron Road"
                    },
                    "primary": true
                  },
                  {
                    "data": {
                      "city": "San Matias",
                      "country": "US",
                      "postal_code": "93405-2255",
                      "region": "CA",
                      "street": "2493 Leisure Lane"
                    },
                    "primary": false
                  }
                ],
                "emails": [
                  {
                    "data": "accountholder0@example.com",
                    "primary": true,
                    "type": "primary"
                  },
                  {
                    "data": "extraordinarily.long.email.username.123456@reallylonghostname.com",
                    "primary": false,
                    "type": "other"
                  }
                ],
                "names": ["Alberta Bobbeth Charleson"],
                "phone_numbers": [
                  {
                    "data": "1112223333",
                    "primary": false,
                    "type": "home"
                  },
                  {
                    "data": "1112225555",
                    "primary": false,
                    "type": "mobile1"
                  }
                ]
              }
            ],
            "ownership_type": null,
            "subtype": "credit card",
            "transactions": [],
            "type": "credit"
          }
        ],
        "date_last_updated": "2020-06-05T22:47:52Z",
        "institution_id": "ins_3",
        "institution_name": "Chase",
        "item_id": "eVBnVMp7zdTJLkRNr33Rs6zr7KNJqBFL9DrE6"
      }
    ],
    "user": {
      "client_user_id": "123456789",
      "email": "accountholder0@example.com",
      "first_name": "Alberta",
      "last_name": "Charleson",
      "middle_name": "Bobbeth",
      "phone_number": "111-222-3333",
      "ssn": "123-45-6789"
    }
  },
  "request_id": "eYupqX1mZkEuQRx",
  "warnings": []
}
```

#### Working with Assets data 

After your initial [/asset\_report/create](https://plaid.com/docs/api/products/assets/index.html.md#asset_reportcreate) and [/asset\_report/get](https://plaid.com/docs/api/products/assets/index.html.md#asset_reportget) requests, you may want your application to fetch updated Asset Reports, provide Audit Copies of Asset Reports, and more. Consult the [API Reference](https://plaid.com/docs/api/products/assets/index.html.md) to explore these and other options.