Retrieves all the available versions of the specified Zone in a Space.
Parameters
| Name |
Type |
In |
Required |
Description |
| fields |
string |
query |
Optional
|
Specifies the fields (comma-separated) to retrieve.
Allowed values: version_time, modified_by,
description,
version_id.
|
| edition_id |
string |
path |
Required
|
The unique ID of the edition.
|
| space_id |
string |
path |
Required
|
The unique ID of the Space.
|
| zone_id |
string |
path |
Required
|
The unique ID of the Zone.
|
success with allowed version - Response
{
"data": {
"zone_versions": {
"restricted_versions": [],
"allowed_versions": [
{
"version_time": "Sun, 16 Feb 2025, 03:09:13",
"modified_by": "96384499",
"description": "",
"version_id": "1505000000099005"
},
{
"version_time": "Sun, 16 Feb 2025, 03:08:50",
"modified_by": "96384499",
"description": "activated",
"version_id": "1505000000097249"
}
]
}
},
"message": "Zone versions fetched successfully",
"request_uri": "/vani/api/v1/editions/97375109/spaces/1505000000022005/zones/DBB83581-F98F-4120-9431-FDC16515FE00/version",
"status": "success"
}
sucess with restricted version - Response
{
"data": {
"zone_versions": {
"restricted_versions": [
{
"version_time": "Tue, 04 Feb 2025, 12:58:24",
"modified_by": "96384499",
"description": "activated",
"version_id": "1600000000657036"
}
],
"allowed_versions": []
}
},
"message": "Zone versions fetched successfully",
"request_uri": "/vani/api/v1/editions/85572652/spaces/1600000000657005/zones/ef7b7fe1-327b-4ec1-904d-8232677d689c/version",
"status": "success"
}
using fields - Response
{
"data": {
"zone_versions": {
"restricted_versions": [
{
"modified_by": "80215739",
"version_id": "1373000000529563"
}
],
"allowed_versions": []
}
},
"message": "Zone versions fetched successfully",
"request_uri": "/vani/api/v1/editions/80585907/spaces/1373000000529203/zones/1b28dc96-a3bc-45c3-9977-e4089b513a31/version",
"status": "success"
}
from & limit - Response
{
"data": {
"zone_versions": {
"restricted_versions": [],
"allowed_versions": [
{
"modified_by": "80215739",
"version_id": "149000043835113"
}
]
}
},
"message": "Zone versions fetched successfully",
"request_uri": "/vani/api/v1/editions/75434908/spaces/149000042348078/zones/89cf903a-0701-41b3-823c-f2229436333e/version",
"status": "success"
}
fromDate - Response
{
"data": {
"zone_versions": {
"restricted_versions": [],
"allowed_versions": [
{
"version_time": "Fri, 24 Jan 2025, 11:55:53",
"modified_by": "80215739",
"description": "",
"version_id": "149000043835113"
}
]
}
},
"message": "Zone versions fetched successfully",
"request_uri": "/vani/api/v1/editions/75434908/spaces/149000042348078/zones/89cf903a-0701-41b3-823c-f2229436333e/version",
"status": "success"
}
zone not found - Response
{
"error": {
"details": {
"current_user_id": "80215739",
"error_code": "Z1008",
"edition_id": "75434908",
"message": "Zone not found",
"space_id": "149000042348078"
}
},
"request_uri": "/vani/api/v1/editions/75434908/spaces/149000042348078/zones/89cf103a-0701-41b3-823c-f2229436333e/version",
"status": "error"
}
unauthorized - Response
{
"error": {
"details": {
"current_user_id": "96384499",
"error_code": "A1003",
"edition_id": "85572652",
"message": "The user doesn't have permission to perform this action",
"space_id": "160000000657005"
}
},
"request_uri": "/vani/api/v1/editions/85572652/spaces/160000000657005/zones/ef7b7fe1-327b-4ec1-904d-8232677d689c/version",
"status": "error"
}
cURL
curl -X GET "https://api.app.vanihq.com/vani/api/v1/editions/{edition_id}/spaces/{space_id}/zones/{zone_id}/version" \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json"
JavaScript
const response = await fetch('https://api.app.vanihq.com/vani/api/v1/editions/{edition_id}/spaces/{space_id}/zones/{zone_id}/version', {
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json'
}
});
const data = await response.json();
// Process the response data
return data;
Node.js
const https = require('https');
const url = require('url');
const options = {
...url.parse('https://api.app.vanihq.com/vani/api/v1/editions/{edition_id}/spaces/{space_id}/zones/{zone_id}/version'),
method: 'GET',
headers: {
'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
'Content-Type': 'application/json'
}
};
const req = https.request(options, (res) => {
let data = '';
res.on('data', (chunk) => data += chunk);
res.on('end', () => {
const result = JSON.parse(data);
// Process the response data
});
});
req.end();
Python
import requests
url = "https://api.app.vanihq.com/vani/api/v1/editions/{edition_id}/spaces/{space_id}/zones/{zone_id}/version"
headers = {
"Authorization": "Bearer YOUR_ACCESS_TOKEN",
"Content-Type": "application/json"
}
response = requests.get(url, headers=headers)
data = response.json()
print(data)
Java
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import java.net.URI;
import java.time.Duration;
public class ApiClient {
public static void main(String[] args) throws Exception {
HttpClient client = HttpClient.newBuilder()
.connectTimeout(Duration.ofSeconds(10))
.build();
HttpRequest.Builder requestBuilder = HttpRequest.newBuilder()
.uri(URI.create("https://api.app.vanihq.com/vani/api/v1/editions/{edition_id}/spaces/{space_id}/zones/{zone_id}/version"))
.header("Authorization", "Bearer YOUR_ACCESS_TOKEN")
.header("Content-Type", "application/json")
.timeout(Duration.ofSeconds(30));
HttpRequest request = requestBuilder
.GET(HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response = client.send(request,
HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());
}
}
Deluge
info "Making API request to: https://api.app.vanihq.com/vani/api/v1/editions/{edition_id}/spaces/{space_id}/zones/{zone_id}/version";
headers = Map();
headers.put("Authorization", "Bearer YOUR_ACCESS_TOKEN");
headers.put("Content-Type", "application/json");
response = invokeurl
[
url: "https://api.app.vanihq.com/vani/api/v1/editions/{edition_id}/spaces/{space_id}/zones/{zone_id}/version"
type: GET
headers: headers
];
if (response.get("status_code") == 200) {
info "Request successful";
responseData = response.get("response");
info responseData;
} else {
info "Request failed with status: " + response.get("status_code");
info response.get("response");
}