curl --request PUT \
--url https://jmpy.me/api/v1/url-ab-tests/{testId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"min_sample_size": 123,
"confidence_level": 123
}
'Update a draft URL A/B test
curl --request PUT \
--url https://jmpy.me/api/v1/url-ab-tests/{testId} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"min_sample_size": 123,
"confidence_level": 123
}
'curl -X PUT "https://jmpy.me/api/v1/url-ab-tests/test_url_789" \
-H "Authorization: Bearer <token>" \
-H "Content-Type: application/json" \
-d '{
"name": "Updated Landing Page Test",
"min_sample_size": 200
}'
const testId = 'test_url_789';
const response = await fetch(`https://jmpy.me/api/v1/url-ab-tests/${testId}`, {
method: 'PUT',
headers: {
'Authorization': 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
name: 'Updated Landing Page Test',
min_sample_size: 200
})
});
import requests
test_id = "test_url_789"
response = requests.put(
f"https://jmpy.me/api/v1/url-ab-tests/{test_id}",
headers={"Authorization": "Bearer <token>"},
json={
"name": "Updated Landing Page Test",
"min_sample_size": 200
}
)
package main
import (
"bytes"
"net/http"
"encoding/json"
)
func main() {
testId := "test_url_789"
data := map[string]interface{}{
"name": "Updated Landing Page Test",
"min_sample_size": 200,
}
jsonData, _ := json.Marshal(data)
req, _ := http.NewRequest("PUT", "https://jmpy.me/api/v1/url-ab-tests/"+testId, bytes.NewBuffer(jsonData))
req.Header.Set("Authorization", "Bearer <token>")
req.Header.Set("Content-Type", "application/json")
http.DefaultClient.Do(req)
}
<?php
$client = new GuzzleHttp\Client();
$response = $client->request('PUT', 'https://jmpy.me/api/v1/url-ab-tests/test_url_789', [
'headers' => [
'Authorization' => 'Bearer <token>',
'Content-Type' => 'application/json'
],
'json' => [
'name' => 'Updated Landing Page Test',
'min_sample_size' => 200
]
]);
?>
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.URI;
import java.net.http.HttpResponse;
String json = """
{
"name": "Updated Landing Page Test",
"min_sample_size": 200
}
""";
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://jmpy.me/api/v1/url-ab-tests/test_url_789"))
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.PUT(HttpRequest.BodyPublishers.ofString(json))
.build();
client.send(request, HttpResponse.BodyHandlers.ofString());
{
"test": {
"id": "test_url_789",
"name": "Updated Landing Page Test",
"min_sample_size": 200,
"status": "draft"
}
}
{
"success": false,
"error": {
"code": "NOT_FOUND",
"message": "Test not found or cannot be modified (only draft tests can be updated)"
}
}