AppDynamics Knowledge Base

How do I gather mobile crash stack traces using the API?

How do I gather mobile crash stack traces using the API?

Question

How can a user capture mobile crash stack traces automatically using an API? 

Users may be gathering crash data from the mobile_crash_reports table using ADQL, but there is no stack trace information in this table.

Stack trace data is stored within the AppDynamics system, and displayed in a web browser.

Example: 

image.png

Answer

As of AppDynamics version 20.x, there is no API available to gather crash data from the mobile_crash_reports analytics schema.

As a workaround, set the following variables and use curl to request the full crash report.

Note:

  • The URLs may change in different controller versions because these are not public APIs.
  • The following example is for AppDynamics Controllers version >=20.x.
  • The sample cURL command below retrieves a single stack trace for the specified crash ID.
  • Customers are advised to develop their own automation solutions tailored to their platform to handle bulk crash report processing.

To obtain the stack trace, follow these steps:

1. Generate an Access Token for the API call to your controller. Refer to the following documentation for guidance: https://help.splunk.com/en/appdynamics-saas/extend-splunk-appdynamics/25.7.0/extend-splunk-appdynami....

2. After generating the Access Token, execute the command below to retrieve a crash stack trace.

# Set these variables:
YOUR_ACCESS_TOKEN=  #Set Token ID from above step, maximum validity 24hours, based on your setting 
APPLICATION= # You can find this in the url when viewing an app. It will say "application=X" where X is an integer CRASH_ID= # This is the crashid field from mobile_crash_reports analytics schema (not groupid) # Get a stacktrace for a particular crashid from the controller: curl --location --request GET \
"http://${CONTROLLER_URL}/controller/restui/crashDetails/download/${APPLICATION}/${CRASH_ID}" \
--header "Authorization: Bearer ${YOUR_ACCESS_TOKEN}"

Sample request:

On bash set environment variables -

APPLICATION=6789

CRASH_ID=64D17A66-6A84-49E0-B8DE-0731E42244CF

YOUR_ACCESS_TOKEN=eyJraWQiOiJhOWUyMTM2NC1lYTc3LTQ3OWUtOTdmZi1lYmJkMjc2NjNmYmUiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJBcHBEeW5hbWljcyIsImF1ZCI6IkFwcERfQVBJcyIsImp0aSI6IjlybDVyU0tWZDZwN3hKM3A5NWRfemciLCJzdWIiOiJwb3N0bWFuIiwiaWRUeXBlIjoiQVBJX0NMSUVOVCIsImlkIjoiNjgzZmZmODMtNTY5YS00OGRkLWE4MjMtYWE0ODA4NGYzN2UxIiwiYWNjdElkIjoiYTllMjEzNjQtZWE3Ny00NzllLTk3ZmYtZWJiZDI3NjYzZmJlIiwidG50SWQiOiJhOWUyMTM2NC1lYTc3LTQ3OWUtOTdmZi1lYmJkMjc2NjNmYmUiLCJhY2N0TmFtZSI6ImFwcGR5bmFtaWNzIiwidGVuYW50TmFtZSI6ImFwcGR5bmFtaWNzIiwiZm1tVG50SWQiOm51bGwsImFjY3RQZXJtIjpbXSwicm9sZUlkcyI6W10sImlhdCI6MTY1OTQ4Njk1NiwibmJmIjoxNjU5NDg2ODM2LCJleHAiOjE2NTk1NzMzNTYsInRva2VuVHlwZSI6IkFDQ0VTUyJ9.sKG2hkFofWK9avqr7RlzVEM_APiCUiXRXmA7qm12Wr4

curl --location --request GET \
"https://${CONTROLLER_URL}/controller/restui/crashDetails/download/${APPLICATION}/${CRASH_ID}" \
--header "Authorization: Bearer ${YOUR_ACCESS_TOKEN}"

OR

curl --location --request GET \
'https:/${CONTROLLER_URL}/controller/restui/crashDetails/download/6789/64D17A66-6A84-49E0-B8DE-0731E42244CF' \
--header 'Authorization: Bearer eyJraWQiOiJhOWUyMTM2NC1lYTc3LTQ3OWUtOTdmZi1lYmJkMjc2NjNmYmUiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJBcHBEeW5hbWljcyIsImF1ZCI6IkFwcERfQVBJcyIsImp0aSI6IjlybDVyU0tWZDZwN3hKM3A5NWRfemciLCJzdWIiOiJwb3N0bWFuIiwiaWRUeXBlIjoiQVBJX0NMSUVOVCIsImlkIjoiNjgzZmZmODMtNTY5YS00OGRkLWE4MjMtYWE0ODA4NGYzN2UxIiwiYWNjdElkIjoiYTllMjEzNjQtZWE3Ny00NzllLTk3ZmYtZWJiZDI3NjYzZmJlIiwidG50SWQiOiJhOWUyMTM2NC1lYTc3LTQ3OWUtOTdmZi1lYmJkMjc2NjNmYmUiLCJhY2N0TmFtZSI6ImFwcGR5bmFtaWNzIiwidGVuYW50TmFtZSI6ImFwcGR5bmFtaWNzIiwiZm1tVG50SWQiOm51bGwsImFjY3RQZXJtIjpbXSwicm9sZUlkcyI6W10sImlhdCI6MTY1OTQ4Njk1NiwibmJmIjoxNjU5NDg2ODM2LCJleHAiOjE2NTk1NzMzNTYsInRva2VuVHlwZSI6IkFDQ0VTUyJ9.sKG2hkFofWK9avqr7RlzVEM_APiCUiXRXmA7qm12Wr4' 
 

Sample OutputSample Output

 

Labels (1)
Version history
Last update:
‎08-04-2025 09:41 AM
Updated by:
Contributors