API

Use our API for custom integration.

post
Request Screenshot Data

https://api-screenshot.visual-knight.io/v1
This endpoint allows you to send an image to our backend which will perform the regression
Request
Response
Headers
x-api-key
required
string
Authentication token
Form Data Parameters
autoBaseline
optional
boolean
Accept automatically the first result of an variation
additional
required
object
Additional information (maximum 1 level) Add your webdriver capabilities with the key capabilities to provide us information that we can autodetect the browser and device.
misMatchTolerance
required
number
The mismatch tolerance for the test (max 1.00, min 0.00)
test
required
string
Identifier against which test the screenshot will be compared
project
required
string
Project id or name
200: OK
You receive the presigned url where you have to upload the screenshot and the created testSessionId
{
url: "MY_PRESIGNED_URL",
testSessionId: "SOME_TEST_SESSION_ID"
}
400: Bad Request
{
"message": "Not all required fields are set."
}
403: Forbidden
{
"message": "Not Authorized! Check if your key is set correct."
}

post

https://api-screenshot.visual-knight.io/v1
Request
Response
Form Data Parameters
deviceName
optional
string
capabilities
200: OK

post

https://api-screenshot.visual-knight.io/v1
Request
Response
Form Data Parameters
deviceName
optional
string
Note
200: OK

post

https://api-screenshot.visual-knight.io/v1
Request
Response
Form Data Parameters
browserName
optional
string
which was used
200: OK

put
Upload screenshot

https://yourpresigned.url/
Uploads the decoded screenshot to the presigned url endpoint The screenshot must be decoded as Base64 added via body You receive the presigned url from the Request Screenshot Data Api
Request
Response
Headers
Content-Type
required
string
Must be set to "image/png"
200: OK

get
Testsession Status

https://api-testsession.visual-knight.io/v1
Requests the status for a given test session id
Request
Response
Query Parameters
testSessionId
required
string
The id of the requesting Testsession
200: OK
JSON with the Testsession data
{
/**
* The value of the mismatch with the baseline comparison
* if no baseline exists this value is null
*/
misMatchPercentage: number | null;
// Has the screenshot the same dimension like the baseline
isSameDimensions: boolean | null;
/**
* link to the test session in visual knight if an error occures
* An error can be e.g.: no baseline, mismatch higher than allowed
*/
link: string;
}