Skip to main content
No Result Found

Media files

You can use your own media files(images/videos) for testing. Before starting test execution, you first need to upload these test files, fetch the details of the uploaded files on BrowserStack using REST API.

Upload media file

POST /app-automate/upload-media

Upload media files you want to use in your tests.

Request Parameters

Request

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X POST "https://api-cloud.browserstack.com/app-automate/upload-media" \
-F "file=@/path/to/media/file/profile.png" \
-F "custom_id=SampleMedia"
  • file* File

    Media File to upload.

  • custom_id String

    Custom ID for the media file. Accepted characters are A-Z, a-z, 0-9, ., -, _. All other characters are ignored. Character limit is 100.

Response Attributes 200 application/json

Response

{
        "media_url": "media://90c7a8h8dc82308108734e9a46c24d8f01de12881",
        "custom_id": "SampleMedia",
        "shareable_id": "steve/SampleMedia"
}
  • media_name String

    Name of the uploaded media file.

  • media_url String

    Unique identifier returned upon successful upload of your media file on BrowserStack. This value is used to specify the media files to be used in your tests.

  • media_id String

    Unique ID returned on successful upload of your media file on BrowserStack.
    Example: media://90c7a8h8dc82308108734e9a46c24d8f01de12881

  • uploaded_at String

    Media upload timestamp.

  • custom_id String

    Custom ID defined for the uploaded media file. Accepted characters are A-Z, a-z, 0-9, ., -, _. All other characters are ignored. Character limit is 100.

  • shareable_id String

    Shareable ID allows members of other teams to use the media files in their tests.
    Example: steve/SampleMedia.

List uploaded media files

GET /app-automate/recent_media_files

Retrieve the list of recently uploaded media files. Optionally, you can also specify the custom_id path parameter to get recent media file uploads under a specific custom id.

Request Parameters

Request

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X GET "https://api-cloud.browserstack.com/app-automate/recent_media_files"

# List media files using a custom ID
curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X GET "https://api-cloud.browserstack.com/app-automate/recent_media_files/SampleMedia"
  • customID String

    Filter recently uploaded media files by custom ID.

Response Attributes 200 application/json

Response

[
    {
        "media_name": "profile.png",
        "media_url": "media://90c7a8h8dc82308108734e9a46c24d8f01de12881",
        "media_id": "90c7a8h8dc82308108734e9a46c24d8f01de12881",
        "uploaded_at": "2020-08-19 19:32:47 UTC",
        "custom_id": "SampleMedia",
        "shareable_id": "steve/SampleMedia"
    },
    {...}
]
  • Array

    List of recently uploaded media files.

    SHOW VALUES
    • media_name String

      Name of the uploaded media file.

    • media_url String

      Unique identifier returned upon successful upload of your media file on BrowserStack. This value is used to specify the media files to be used in your tests.

    • media_id String

      Unique ID returned on successful upload of your media file on BrowserStack.
      Example: media://90c7a8h8dc82308108734e9a46c24d8f01de12881

    • uploaded_at String

      Media upload timestamp.

    • custom_id String

      Custom ID defined for the uploaded media file. Accepted characters are A-Z, a-z, 0-9, ., -, _. All other characters are ignored. Character limit is 100.

    • shareable_id String

      Shareable ID allows members of other teams to use the media files in their tests.
      Example: user/SampleMedia.

List uploaded media files by group

GET /app-automate/recent_group_media

Retrieve the list of recently uploaded media files for the entire group.

Request Parameters

Request

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X GET "https://api-cloud.browserstack.com/app-automate/recent_group_media"

No parameter required.

Response Attributes 200 application/json

Response

[
    {
        "media_name": "profile.png",
        "media_url": "media://90c7a8h8dc82308108734e9a46c24d8f01de12881",
        "media_id": "90c7a8h8dc82308108734e9a46c24d8f01de12881",
        "uploaded_at": "2020-08-19 19:32:47 UTC",
        "custom_id": "SampleMedia",
        "shareable_id": "steve/SampleMedia"
    },
    {
        "media_name": "checkReceipt.png",
        "media_url": "media://1t6db3a3f3108734e9a46c24d8f01de7t56f12o",
        "media_id": "1t6db3a3f3108734e9a46c24d8f01de7t56f12o",
        "uploaded_at": "2020-07-19 19:32:47 UTC",
        "custom_id": "CheckReceipts",
        "shareable_id": "rob/CheckReceipts"
    },
    {...}
]
  • Array

    List of recently uploaded media files.

    SHOW VALUES
    • media_name String

      Name of the uploaded media file.

    • media_url String

      Unique identifier returned upon successful upload of your media file on BrowserStack. This value is used to specify the media files to be used in your tests.

    • media_id String

      Unique ID returned on successful upload of your media file on BrowserStack.
      Example: media://90c7a8h8dc82308108734e9a46c24d8f01de12881

    • uploaded_at String

      Media upload timestamp.

    • custom_id String

      Custom ID defined for the uploaded media file. Accepted characters are A-Z, a-z, 0-9, ., -, _. All other characters are ignored. Character limit is 100.

    • shareable_id String

      Shareable ID allows members of other teams to use the media files in their tests.
      Example: user/SampleMedia.

Delete media file

DELETE /app-automate/custom_media/delete/{media_id}

Delete the uploaded media files.

Request Parameters

Request

curl -u "YOUR_USERNAME:YOUR_ACCESS_KEY" \
-X DELETE "https://api-cloud.browserstack.com/app-automate/custom_media/delete/90c7a8h8dc82308108734e9a46c24d8f01de12881"
  • media_id* String

    ID of the media file to be deleted.

Response Attributes 200 application/json

Response

{
    "success": true
}
  • success Object

    Indicates whether deletion was success or a failure.

    SHOW VALUES
    • success Boolean

      Indicates whether the media deletion was success or not.

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback

Download Copy Check Circle