Uploading HAR Files via API


LiveConnect allows user to upload HAR files which can be extracted from a variety of sources. To support integrating the HAR file with CI/CD processes and automating the validation of web and mobile testing, this guide will walk you through how to integrate with ObservePoint's API.

Note: Uploading HAR files might not be a feature you have access to, reach out to your Consultant or Account Executive to verify if you have access.

Downloading HAR Files

HAR files can be accessed in a variety of ways. Most easily is done through the browser, as described here. You can also export them through a Charles Proxy and some device farm tools including, but not limited to SauceLabs, BrowserStack, and BitBar.

Note: These device farms only allow exports available for Web.

Uploading HAR Files

The steps below will walk you through the API call syntax required to upload HAR files programatically. We'll use Postman, but once successfully tested, you can convert your Postman request to a code snippet seamlessly.

  1. Start by created a new POST request with the following endpoint: 

    https://api.observepoint.com/v2/manual-journeys/{your deviceID goes here}/har-runs
    Note: You'll need to apply your own device ID. You can find it by editing the device and looking at the URL. e.g. https://app.observepoint.com/deviceProfile/mobile/ 6405
  2. Add 1 query parameter: name. This will be the name of the Journey in LiveConnect once the HAR file is uploaded.
  3. Add 2 headers: Authorization & Content-Type. Authorization needs to be assigned the value "api_key" followed by your API key with a space in between.

  4. For the body, choose form-data as the type and and add the key: harFile. Then, hover over the right side of the key field and switch it from Text to File. Then in the value field, click Select Files and find the HAR file you wish to upload.

  5. Once you have selected the file, give it a test run, click Send.
  6. Optionally, you can click Code and select various formats to export a code snippet to be used when implementing this request programmatically into a CI/CD process.

    Here is an example of a cURL snippet exported:
curl --location --request POST 'https://api.observepoint.com/v2/manual-journeys/1/har-runs?name=API_Test' \
--header 'Authorization: api_key XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX' \
--header 'Content-Type: application/json' \
--form 'harFile=@/Users/dylansellers/Downloads/jpstyle.us.har'
Did this answer your question? Thanks for the feedback There was a problem submitting your feedback. Please try again later.