---
schema_version: "1"
id: 4cb56b2cb5da28de666b9642de679f688c7b87bbbed9d5a35e65250a058543ef
title: Get Context Data Action
collection: legacydeveloper
version: current
locale: en-us
portal_url: https://docs.salesforce.com/legacydeveloper/current/en-us/life_sciences_dev_guide/ls_actions_get_context_data.md
canonical_url: https://developer.salesforce.com/docs/atlas.en-us.life_sciences_dev_guide.meta/life_sciences_dev_guide/ls_actions_get_context_data.htm
source_site: developer.salesforce.com
content_type: documentation
content_hash: 6dfd716655fadd6713d92b02ed00ce4e2e203167ade2751c4688db3a805f1aa1
description: Retrieves the context data that is passed as an input to a prompt template that generates a summary of the data.
---
# Get Context Data Action

Retrieves the context data that is passed as an input to a prompt template that generates a summary of the data.

This action is available in API version 62.0 and later.

## Supported REST HTTP Methods

**URI**: /services/data/vXX.X/actions/standard/getContextData

Where XX.X is the latest API version.

**Formats**: JSON, XML

**HTTP Methods**: GET

**Authentication**: Authorization: Bearer TOKEN

Where TOKEN is your OAuth access token.

## Inputs

<table class="featureTable sort_table" summary="">



          <thead class="thead sorted" align="left">
            <tr>
              <th class="featureTableHeader  " id="d491193e98">Input</th>

              <th class="featureTableHeader  " id="d491193e101">Type</th>

              <th class="featureTableHeader  " id="d491193e104">Description</th>

            </tr>

          </thead>

          <tbody class="tbody">
            <tr>
              <td class="entry" headers="d491193e98" data-title="Input"><span class="keyword parmname">contextInputRepresentation</span></td>

              <td class="entry" headers="d491193e101" data-title="Type">List&lt;Apex&gt;</td>

              <td class="entry" headers="d491193e104" data-title="Description">Required<p class="p">A collection of Apex <samp class="codeph apex_code">embeddedai__ContextInputRep</samp> records that
                  contain details of the hierarchical data of the sObjects
                  to get the context data for.</p>
              </td>

            </tr>

            <tr>
              <td class="entry" headers="d491193e98" data-title="Input"><span class="keyword parmname">contextDefinitionName</span></td>

              <td class="entry" headers="d491193e101" data-title="Type">String</td>

              <td class="entry" headers="d491193e104" data-title="Description">Required<p class="p">The name of the context definition to use to get the
                  context data.</p>
              </td>

            </tr>

          </tbody>

        </table>

## Outputs

| Output | Type | Description |
| --- | --- | --- |
| recordApexRepresentation | List<Apex> | A collection of Apex embeddedai\_\_RecordApexRepresentationrecords that contain the context data. |

## Example

Sample Request

{
    "inputs": \[
        {
            "contextInputRepresentation": \[
                {
                    "mappingName": "OutcomeSummaryMapping",
                    "ids": \[
                        "9OCxx0000004C92GAE"
                    \],
                    "objectName": "Outcome",
                    "nodeName": "SummaryContext"
                }
            \],
            "contextDefinitionName": "CareProgramOutcomeSummary\_\_stdctx"
        }
    \]
}

Sample Response

\[
    {
        "recordApexRepresentation": \[
            {
                "relatedRecordData": \[
                    {
                        "relatedRecordData": \[
                            {
                                "recordData": \[
                                    {
                                        "value": "Percentage",
                                        "key": "UnitOfMeasureName"
                                    },
                                    {
                                        "value": "Symptom Monitoring",
                                        "key": "IndicatorDefinitionName"
                                    }
                                \],
                                "objectType": "IndicatorAssignment"
                            }
                        \],
                        "recordData": \[
                            {
                                "value": "Reduced Symptoms",
                                "key": "Name"
                            }
                        \],
                        "objectType": "Outcome"
                    }
                \],
                "recordData": \[
                    {
                        "value": "Drug Use Satisfaction Improvement Program",
                        "key": "Name"
                    }
                \],
                "objectType": "CareProgram"
            }
        \]
    }
\]