Page Resources

Selectify aims to render webpages exactly as your browser does. This lets you replay workflows over time, no matter how the underlying page has changed in the meantime. It also helps our ML models determine what you're looking for.

Selectify provides the Page Resource model for this purpose. It allows users to upload browser-based files such as stylesheets, images, scripts, and fonts that were intercepted during test time. The feature helps ensure that these essential elements are accessible during page replays.

By default, if Page Resources haven't been uploaded for a given Page State, our server will attempt to fetch them automatically. While we make a best effort to succeed in these fetches, it's important to bear in mind that explicit uploads are necessary under specific circumstances. For instance, if you're running tests from behind a firewall or on a domain that doesn't have public Internet access. Our server resolves pages over the public Internet and cannot access resources on privately held or shielded domains. Manual uploads also help ensure that Selectify is able to render page contents exactly as your browser has seen them.


Create a page resource

This endpoint allows you to add a new page resource. To add a resource, you must provide the content value and the type of the resource as requested by your browser.

Header Values

  • Name
    authorization
    Type
    Description

Request Body

Requests should be formatted as a PageResourceCreate object.

  • Name
    url
    Type
    string
    Description
    The raw URL of the page resource.
  • Name
    resource_type
    Type
    ResourceType
    Description
    The type of the page resource.
  • Name
    content_type
    Type
    string
    Description
    The Content-Type header value returned by the page resource when accessed.
  • Name
    content
    Type
    string
    Description
    The content of the resource, base64 encoded for upload.

Response Body

Responses will be formatted as a PageResource object.

  • Name
    id
    Type
    string
    Description
  • Name
    url
    Type
    string
    Description
    The raw URL of the page resource.
  • Name
    resource_type
    Type
    enum[stylesheet | script | image | document | font]
    Description
    The type of the page resource.

Request

curl -X POST "https://api.selectify.ai/page_resource/" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN"\
  -d '{
    "url": "string",
    "resource_type": "stylesheet",
    "content_type": "string",
    "content": "base64 content"
  }'

Response

{
  "id": "00000000-0000-0000-0000-000000000000",
  "url": "string",
  "resource_type": "stylesheet"
}

Reconcile a page resource

This endpoint allows you to determine whether a page resource already exists on the server, without having to spend the time and bandwidth to upload the full content. We recommend checking each page resource with this endpoint before upload.

Header Values

  • Name
    authorization
    Type
    Description

Request Body

Requests should be formatted as a PageResourceReconcileCreate object.

  • Name
    url
    Type
    string
    Description
    The URL of the page resource.
  • Name
    hash
    Type
    string
    Description
    The hash of the page resource. This should be the md5 hash of the exact page content that you upload, ie. md5(base64(bytes))

Response Body

Responses will be formatted as a PageResourceReconcile object.

  • Name
    url
    Type
    string
    Description
    The URL of the page resource.
  • Name
    hash
    Type
    string
    Description
    The hash of the page resource. This should be the md5 hash of the exact page content that you upload, ie. md5(base64(bytes))
  • Name
    found
    Type
    boolean
    Description
    Whether or not the page resource was found.
  • Name
    page_resources
    Type
    Description
    The page resource, if found.

Request

curl -X POST "https://api.selectify.ai/page_resource/reconcile" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_TOKEN"\
  -d '{
    "url": "string",
    "hash": "md5(base64(content))"
  }'

Response

{
  "url": "string",
  "hash": "md5(base64(content))",
  "found": true,
  "page_resources": null
}