curl --request POST \
--url https://myunite.ai/api/v1/pretests \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"uploadId": "<string>",
"channel": "ooh",
"ooh": {
"format": "<string>"
},
"title": "<string>",
"brandId": "<string>",
"metadata": {}
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
uploadId: '<string>',
channel: 'ooh',
ooh: {format: '<string>'},
title: '<string>',
brandId: '<string>',
metadata: {}
})
};
fetch('https://myunite.ai/api/v1/pretests', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://myunite.ai/api/v1/pretests"
payload = {
"uploadId": "<string>",
"channel": "ooh",
"ooh": { "format": "<string>" },
"title": "<string>",
"brandId": "<string>",
"metadata": {}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"object": "pretest",
"status": "queued",
"channel": "ooh",
"title": "<string>",
"locale": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"brand": {
"id": "<string>",
"name": "<string>"
},
"creative": {
"type": "image",
"thumbnailUrl": "<string>"
},
"result": {
"score": 123,
"recommendation": "launch",
"recommendationLabel": "<string>",
"conclusion": "<string>",
"pillars": {},
"findings": [
{
"check": "<string>",
"name": "<string>",
"category": "<string>",
"status": "pass",
"score": 123,
"summary": "<string>",
"optional": true
}
],
"recommendations": [
{
"title": "<string>",
"description": "<string>",
"priority": "high",
"category": "<string>"
}
],
"maps": {
"heatmap": {
"url": "<string>",
"mediaType": "image/jpeg"
},
"contrast": {
"url": "<string>",
"mediaType": "image/jpeg"
},
"focus": {
"url": "<string>",
"mediaType": "image/jpeg"
}
}
},
"report": {
"status": "pending",
"url": "<string>"
},
"error": {
"code": "video_too_long",
"message": "<string>"
},
"metadata": {}
}{
"error": {
"code": "invalid_api_key",
"message": "<string>",
"requestId": "<string>",
"docUrl": "<string>",
"param": "<string>"
}
}{
"error": {
"code": "invalid_api_key",
"message": "<string>",
"requestId": "<string>",
"docUrl": "<string>",
"param": "<string>"
}
}{
"error": {
"code": "invalid_api_key",
"message": "<string>",
"requestId": "<string>",
"docUrl": "<string>",
"param": "<string>"
}
}{
"error": {
"code": "invalid_api_key",
"message": "<string>",
"requestId": "<string>",
"docUrl": "<string>",
"param": "<string>"
}
}{
"error": {
"code": "invalid_api_key",
"message": "<string>",
"requestId": "<string>",
"docUrl": "<string>",
"param": "<string>"
}
}{
"error": {
"code": "invalid_api_key",
"message": "<string>",
"requestId": "<string>",
"docUrl": "<string>",
"param": "<string>"
}
}{
"error": {
"code": "invalid_api_key",
"message": "<string>",
"requestId": "<string>",
"docUrl": "<string>",
"param": "<string>"
}
}{
"error": {
"code": "invalid_api_key",
"message": "<string>",
"requestId": "<string>",
"docUrl": "<string>",
"param": "<string>"
}
}{
"error": {
"code": "invalid_api_key",
"message": "<string>",
"requestId": "<string>",
"docUrl": "<string>",
"param": "<string>"
}
}Create a pre-test
Creates a pre-test from a file you uploaded with POST /uploads. The response is 202: the analysis runs in the background. Poll GET /pretests/ until status is completed or failed. The Location header points to the new pre-test. The Idempotency-Key header is required: repeating a request with the same key and the same body returns the same pre-test with Idempotent-Replayed: true, and a different body returns 409. A workspace can have a limited number of API pre-tests in progress at once (about 10; the limit is approximate and can be exceeded briefly under concurrent requests): beyond it you get 429 concurrency_limit with Retry-After. An empty metadata object is the same as omitting it. Every 4xx rejection listed below happens before any quota is used. A 5xx response (or a dropped connection) can come after the pre-test was created: repeat the request with the same Idempotency-Key and the same body to get it back, and the pre-test is charged once. A new key creates another pre-test and can charge twice.
Requires the pretests:write scope.
curl --request POST \
--url https://myunite.ai/api/v1/pretests \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Idempotency-Key: <idempotency-key>' \
--data '
{
"uploadId": "<string>",
"channel": "ooh",
"ooh": {
"format": "<string>"
},
"title": "<string>",
"brandId": "<string>",
"metadata": {}
}
'const options = {
method: 'POST',
headers: {
'Idempotency-Key': '<idempotency-key>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
uploadId: '<string>',
channel: 'ooh',
ooh: {format: '<string>'},
title: '<string>',
brandId: '<string>',
metadata: {}
})
};
fetch('https://myunite.ai/api/v1/pretests', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://myunite.ai/api/v1/pretests"
payload = {
"uploadId": "<string>",
"channel": "ooh",
"ooh": { "format": "<string>" },
"title": "<string>",
"brandId": "<string>",
"metadata": {}
}
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"object": "pretest",
"status": "queued",
"channel": "ooh",
"title": "<string>",
"locale": "<string>",
"createdAt": "<string>",
"updatedAt": "<string>",
"brand": {
"id": "<string>",
"name": "<string>"
},
"creative": {
"type": "image",
"thumbnailUrl": "<string>"
},
"result": {
"score": 123,
"recommendation": "launch",
"recommendationLabel": "<string>",
"conclusion": "<string>",
"pillars": {},
"findings": [
{
"check": "<string>",
"name": "<string>",
"category": "<string>",
"status": "pass",
"score": 123,
"summary": "<string>",
"optional": true
}
],
"recommendations": [
{
"title": "<string>",
"description": "<string>",
"priority": "high",
"category": "<string>"
}
],
"maps": {
"heatmap": {
"url": "<string>",
"mediaType": "image/jpeg"
},
"contrast": {
"url": "<string>",
"mediaType": "image/jpeg"
},
"focus": {
"url": "<string>",
"mediaType": "image/jpeg"
}
}
},
"report": {
"status": "pending",
"url": "<string>"
},
"error": {
"code": "video_too_long",
"message": "<string>"
},
"metadata": {}
}{
"error": {
"code": "invalid_api_key",
"message": "<string>",
"requestId": "<string>",
"docUrl": "<string>",
"param": "<string>"
}
}{
"error": {
"code": "invalid_api_key",
"message": "<string>",
"requestId": "<string>",
"docUrl": "<string>",
"param": "<string>"
}
}{
"error": {
"code": "invalid_api_key",
"message": "<string>",
"requestId": "<string>",
"docUrl": "<string>",
"param": "<string>"
}
}{
"error": {
"code": "invalid_api_key",
"message": "<string>",
"requestId": "<string>",
"docUrl": "<string>",
"param": "<string>"
}
}{
"error": {
"code": "invalid_api_key",
"message": "<string>",
"requestId": "<string>",
"docUrl": "<string>",
"param": "<string>"
}
}{
"error": {
"code": "invalid_api_key",
"message": "<string>",
"requestId": "<string>",
"docUrl": "<string>",
"param": "<string>"
}
}{
"error": {
"code": "invalid_api_key",
"message": "<string>",
"requestId": "<string>",
"docUrl": "<string>",
"param": "<string>"
}
}{
"error": {
"code": "invalid_api_key",
"message": "<string>",
"requestId": "<string>",
"docUrl": "<string>",
"param": "<string>"
}
}{
"error": {
"code": "invalid_api_key",
"message": "<string>",
"requestId": "<string>",
"docUrl": "<string>",
"param": "<string>"
}
}Autorizações
Cabeçalhos
Corpo
- Option 1
- Option 2
- Option 3
Resposta
Pre-test accepted.