

# GetRetrievedTracesGraph
<a name="API_GetRetrievedTracesGraph"></a>

 Retrieves a service graph for traces based on the specified `RetrievalToken` from the CloudWatch log group generated by Transaction Search. This API does not initiate a retrieval job. You must first execute `StartTraceRetrieval` to obtain the required `RetrievalToken`. 

The trace graph describes services that process incoming requests and any downstream services they call, which may include AWS resources, external APIs, or databases.

The response is empty until the `RetrievalStatus` is *COMPLETE*. Retry the request after the status changes from *RUNNING* or *SCHEDULED* to *COMPLETE* to access the full service graph.

 When CloudWatch log is the destination, this API can support cross-account observability and service graph retrieval across linked accounts.

For retrieving graphs from X-Ray directly as opposed to the Transaction-Search Log group, see [GetTraceGraph](https://docs.aws.amazon.com/xray/latest/api/API_GetTraceGraph.html).

## Request Syntax
<a name="API_GetRetrievedTracesGraph_RequestSyntax"></a>

```
POST /GetRetrievedTracesGraph HTTP/1.1
Content-type: application/json

{
   "NextToken": "string",
   "RetrievalToken": "string"
}
```

## URI Request Parameters
<a name="API_GetRetrievedTracesGraph_RequestParameters"></a>

The request does not use any URI parameters.

## Request Body
<a name="API_GetRetrievedTracesGraph_RequestBody"></a>

The request accepts the following data in JSON format.

 ** [NextToken](#API_GetRetrievedTracesGraph_RequestSyntax) **   <a name="xray-GetRetrievedTracesGraph-request-NextToken"></a>
 Specify the pagination token returned by a previous request to retrieve the next page of indexes.   
Type: String  
Required: No

 ** [RetrievalToken](#API_GetRetrievedTracesGraph_RequestSyntax) **   <a name="xray-GetRetrievedTracesGraph-request-RetrievalToken"></a>
 Retrieval token.   
Type: String  
Length Constraints: Minimum length of 0. Maximum length of 1020.  
Required: Yes

## Response Syntax
<a name="API_GetRetrievedTracesGraph_ResponseSyntax"></a>

```
HTTP/1.1 200
Content-type: application/json

{
   "NextToken": "string",
   "RetrievalStatus": "string",
   "Services": [ 
      { 
         "Links": [ 
            { 
               "DestinationTraceIds": [ "string" ],
               "ReferenceType": "string",
               "SourceTraceId": "string"
            }
         ],
         "Service": { 
            "AccountId": "string",
            "DurationHistogram": [ 
               { 
                  "Count": number,
                  "Value": number
               }
            ],
            "Edges": [ 
               { 
                  "Aliases": [ 
                     { 
                        "Name": "string",
                        "Names": [ "string" ],
                        "Type": "string"
                     }
                  ],
                  "EdgeType": "string",
                  "EndTime": number,
                  "ReceivedEventAgeHistogram": [ 
                     { 
                        "Count": number,
                        "Value": number
                     }
                  ],
                  "ReferenceId": number,
                  "ResponseTimeHistogram": [ 
                     { 
                        "Count": number,
                        "Value": number
                     }
                  ],
                  "StartTime": number,
                  "SummaryStatistics": { 
                     "ErrorStatistics": { 
                        "OtherCount": number,
                        "ThrottleCount": number,
                        "TotalCount": number
                     },
                     "FaultStatistics": { 
                        "OtherCount": number,
                        "TotalCount": number
                     },
                     "OkCount": number,
                     "TotalCount": number,
                     "TotalResponseTime": number
                  }
               }
            ],
            "EndTime": number,
            "Name": "string",
            "Names": [ "string" ],
            "ReferenceId": number,
            "ResponseTimeHistogram": [ 
               { 
                  "Count": number,
                  "Value": number
               }
            ],
            "Root": boolean,
            "StartTime": number,
            "State": "string",
            "SummaryStatistics": { 
               "ErrorStatistics": { 
                  "OtherCount": number,
                  "ThrottleCount": number,
                  "TotalCount": number
               },
               "FaultStatistics": { 
                  "OtherCount": number,
                  "TotalCount": number
               },
               "OkCount": number,
               "TotalCount": number,
               "TotalResponseTime": number
            },
            "Type": "string"
         }
      }
   ]
}
```

## Response Elements
<a name="API_GetRetrievedTracesGraph_ResponseElements"></a>

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

 ** [NextToken](#API_GetRetrievedTracesGraph_ResponseSyntax) **   <a name="xray-GetRetrievedTracesGraph-response-NextToken"></a>
 Specify the pagination token returned by a previous request to retrieve the next page of indexes.   
Type: String

 ** [RetrievalStatus](#API_GetRetrievedTracesGraph_ResponseSyntax) **   <a name="xray-GetRetrievedTracesGraph-response-RetrievalStatus"></a>
 Status of the retrieval.   
Type: String  
Valid Values: `SCHEDULED | RUNNING | COMPLETE | FAILED | CANCELLED | TIMEOUT` 

 ** [Services](#API_GetRetrievedTracesGraph_ResponseSyntax) **   <a name="xray-GetRetrievedTracesGraph-response-Services"></a>
 Retrieved services.   
Type: Array of [RetrievedService](API_RetrievedService.md) objects  
Array Members: Minimum number of 0 items. Maximum number of 1000 items.

## Errors
<a name="API_GetRetrievedTracesGraph_Errors"></a>

For information about the errors that are common to all actions, see [Common Error Types](CommonErrors.md).

 ** InvalidRequestException **   
The request is missing required parameters or has invalid parameters.  
HTTP Status Code: 400

 ** ResourceNotFoundException **   
The resource was not found. Verify that the name or Amazon Resource Name (ARN) of the resource is correct.  
HTTP Status Code: 404

 ** ThrottledException **   
The request exceeds the maximum number of requests per second.  
HTTP Status Code: 429

## See Also
<a name="API_GetRetrievedTracesGraph_SeeAlso"></a>

For more information about using this API in one of the language-specific AWS SDKs, see the following:
+  [AWS Command Line Interface V2](https://docs.aws.amazon.com/goto/cli2/xray-2016-04-12/GetRetrievedTracesGraph) 
+  [AWS SDK for .NET V4](https://docs.aws.amazon.com/goto/DotNetSDKV4/xray-2016-04-12/GetRetrievedTracesGraph) 
+  [AWS SDK for C\$1\$1](https://docs.aws.amazon.com/goto/SdkForCpp/xray-2016-04-12/GetRetrievedTracesGraph) 
+  [AWS SDK for Go v2](https://docs.aws.amazon.com/goto/SdkForGoV2/xray-2016-04-12/GetRetrievedTracesGraph) 
+  [AWS SDK for Java V2](https://docs.aws.amazon.com/goto/SdkForJavaV2/xray-2016-04-12/GetRetrievedTracesGraph) 
+  [AWS SDK for JavaScript V3](https://docs.aws.amazon.com/goto/SdkForJavaScriptV3/xray-2016-04-12/GetRetrievedTracesGraph) 
+  [AWS SDK for Kotlin](https://docs.aws.amazon.com/goto/SdkForKotlin/xray-2016-04-12/GetRetrievedTracesGraph) 
+  [AWS SDK for PHP V3](https://docs.aws.amazon.com/goto/SdkForPHPV3/xray-2016-04-12/GetRetrievedTracesGraph) 
+  [AWS SDK for Python](https://docs.aws.amazon.com/goto/boto3/xray-2016-04-12/GetRetrievedTracesGraph) 
+  [AWS SDK for Ruby V3](https://docs.aws.amazon.com/goto/SdkForRubyV3/xray-2016-04-12/GetRetrievedTracesGraph) 