# Bundle Upload API

When you trigger a yc-360 script, it will capture 360-degree data from your application stack and transmit the data to the yCrash server for automated analysis. Sometimes due to security restrictions, you might not be able to transmit 360-degree data directly from your application container/server to yCrash server. In such circumstances, you might end up triggering yc-360 script in onlyCapture mode. When yc-360 script is triggered in 'onlyCapture' mode, yc-360 script will capture 360-degree snapshot data and bundle them in to a zip file (i.e. yc-*.zip) and store the zip file in the local disk of the application server.

You can then transmit this data manually to your preferred site/location. From this location, if you are looking to upload this snapshot data to yCrash server for automated analysis, you can use this Bundle Upload API..

# How to invoke Bundle Upload API?

Steps to invoke the 'Bundle Upload API' are outlined below:

Endpoint

You need to invoke the ‘Bundle Upload API’ in the below given endpoint

https://<HOST:PORT>/bundle-upload?apiKey=<YOUR_API_KEY>
1

where,

'HOST:' host/ip address where yCrash server is installed.

'PORT:' Port in which yCrash server is listening.

'YOUR_API_Key:' Key given to you at the registration time.

Request payload

The yc-360 script generated bundle zip file (i.e. yc-*.zip) should be submitted as multipart/form-data request payload with following as Key and Value.

'Key:' bundleFile

'Value:' file type (upload your ZIP file).

Below is an example of how to send a request payload through postman:

img

a. Select 'Body' radio button.
b. In the 'Body' form enter the key as "bundleFile".
c. Change the value type text to 'File' and upload the ZIP file.

Response Payload

Below is the sample response JSON payload sent from the yCrash server upon analyzing the bundle zip file (i.e. yc-*.zip):

{
    "results": "http://localhost:8080/yc-report.jsp?ou=czlWbG0rUko0UXAxazlSbjZrSUIwUT09&de=host&app=yc&ts=2022-09-01T17-04-23",
    "message": "Successfully analyzed file",
    "status": true
}
1
2
3
4
5

Here is description:

results: URL where you can access the root cause analysis report of the uploaded yc-*.zip file.
status: Contains either 'true' of 'false' indicating the status of the analysis. 'true' indicates that the analysis was successful. 'false' indicates that the analysis failed.
message: If analysis failed, 'message' element indicated the reason for failure.

# Invoking through Postman

img

Fig: 'Bundle Upload' API when invoked through Postman

Above is the screenshot showing the Bundle Upload API request and response when invoked through Postman.

# Invoking through curl

You can use the CURL command to upload the ZIP file using the Bundle Upload API. Below are the steps to use the CURL command:

curl -F "bundleFile=@<Zip file location directory path>" https://<HOST:PORT>/bundle-upload?apiKey=<YOUR_API_KEY>
1

where,

  • 'HOST:' host/ip address where yCrash server is installed.
  • 'PORT:' Port in which yCrash server is listening.
  • 'YOUR_API_Key:' Your API key was provided with your license at the time of registration. If you're not sure where to find the API key, click here (opens new window).

Example:

curl -F "bundleFile=@D:\TestData\BundleUpload-TestData\BundleUpload-TestData\yc-2022-12-14T09-40-37.zip" http://localhost:8080/bundle-upload?apiKey=<YOUR_API_KEY>
1

Once after executing the command yCrash server will analyze the uploaded ZIP file and generate the RCA report URL, and send it in the response.

Response Payload

Below is the sample response JSON payload sent from the yCrash server upon analyzing the bundle zip file (i.e. yc-*.zip):

{
    "results": "http://localhost:8080/yc-report.jsp?ou=czlWbG0rUko0UXAxazlSbjZrSUIwUT09&de=host&app=yc&ts=2022-09-01T17-04-23",
    "message": "Successfully analyzed file",
    "status": true
}
1
2
3
4
5