# API Key Authentication

API key authentication is the default method for invoking yCrash REST APIs. You pass your API key as a query parameter in the request URL. This approach is simple, stateless, and well suited for automation scripts, CI/CD pipelines, and integrations.

# How it works

Include the apiKey parameter in the URL of every API request. The server validates the key and processes the request if it is valid.

URL format:

https://<your-ycrash-server>/<api-endpoint>?apiKey=<YOUR_API_KEY>
1

For APIs that accept additional parameters, append them to the URL:

https://<your-ycrash-server>/<api-endpoint>?apiKey=<YOUR_API_KEY>&<param1>=<value1>&<param2>=<value2>
1

# Finding your API key

Your API key is provided with your yCrash license at the time of registration. You can also find it in the yCrash dashboard:

  1. Go to the yCrash home page.
  2. Locate the tool widget (GCeasy, HeapHero, FastThread).
  3. Click Launch REST API.
  4. The API endpoint shown in the popup includes your API key.

For more details, see How to find your API key in yCrash (opens new window).

# Invoking APIs with cURL

# GC Log Analysis API

curl -X POST --data-binary @./my-app-gc.log \
  "https://your-ycrash-server/analyzeGC?apiKey=<YOUR_API_KEY>" \
  -H "Content-Type: text/plain"
1
2
3

# Heap Dump Analysis API

curl -X POST --data-binary @./my-heap-dump.hprof \
  "https://your-ycrash-server/analyze-hd-api?apiKey=<YOUR_API_KEY>" \
  -H "Content-Type: application/octet-stream"
1
2
3

# Thread Dump Analysis API

curl -X POST --data-binary @./my-thread-dump.txt \
  "https://your-ycrash-server/fastthread-api?apiKey=<YOUR_API_KEY>" \
  -H "Content-Type: text/plain"
1
2
3

# Bundle Upload API

curl -F "bundleFile=@./yc-2024-01-15T10-30-00.zip" \
  "https://your-ycrash-server/bundle-upload?apiKey=<YOUR_API_KEY>"
1
2

# Tips

  • Compression: For large files, you can compress the payload and pass the compression format in the Content-Encoding header (e.g. zip, gz). See the individual API documentation for details.