PractiTest Discussion Forum

Creating multiple TestSets in 1 API call (bulk API)

Hello,

Would like to create multiple TestSets in a single POST API call to POST “https://api.practitest.com/api/v2/projects/YOUR_PROJECT_ID/sets.json”.

Creating a single TestSet goes fine, but when sending a JSON which holds multiple TestSets I get an 500 Error back.

Is anyone able to do this, or is this a limitation of this API?

Best regards
Thomas

Call in curl:
curl -d “@dataMultiple.json” -H “Content-Type:application/json” -X POST https://api.practitest.com/api/v2/projects/[MY Project]/sets.json?api_token=[My token]

dataMultiple.json:

{
“data”: [
{
“type”: “sets”,
“attributes”: {
“name”: “API TEST: Create TestSet via API MULTI SET1 V1”,
“version”: “1”,
“priority”: “highest”,
“custom-fields”: {
“—f-73978”: “Cycle1”
}
},
“instances”: {
“test-ids”: [
6069486,
6096211
]
}
},
{
“type”: “sets”,
“attributes”: {
“name”: “API TEST: Create TestSet via API MULTI SET2 V1”,
“version”: “1”,
“priority”: “highest”,
“custom-fields”: {
“—f-73978”: “Cycle1”
}
},
“instances”: {
“test-ids”: [
6069486,
6045408,
6045409
]
}
}
]
}

Hello Thomas!

Indeed this is a current limitation of this specific API call - Creation of a Test Set POST request.
In this request, you can create only one Test Set per call.

In order to check whether you are able to apply POST requests for more than 1 entity, I’d recommend to go through the parameters of each request and to see if there is a mention of users being able to create more than 1 entity per request - usually it appears with asterisk in the bottom of the parameters page.

If you’re interested in the enhancement of the Test Set POST request, I’d recommend to leave a Feature Request in our Feedback Forum.
When the requests gets more upvotes from other PractiTest users, our Product Team will put it on higher priority for the implementation.

Have a good day!

Alex