# Validating a Program

<span class="rvts6">This REST call can be used to validate a view, report or generator program. The program’s code must be in Python and use the Voxel Farm Python API.</span>

##### <span class="rvts16">Method</span>

<span class="rvts6">POST</span>

<span class="rvts16">URL</span>

<span class="rvts6">&lt;server&gt;/entity.ashx</span>

##### <span class="rvts16">Parameters</span>

<div class="rvps2" id="bkmrk-program-must-be-set-"><table border="1" cellpadding="7" cellspacing="-1"><tbody><tr valign="top"><td valign="top" width="76"><span class="rvts6">program</span>

</td><td valign="top" width="548"><span class="rvts6">Must be set to “validate”</span>

</td></tr></tbody></table>

</div>##### <span class="rvts16">Post Payload</span>

<span class="rvts6">Text payload containing the program source code in Base64 format.</span>

##### <span class="rvts16">Returns</span>

<span class="rvts6">If completed (200 code), this call returns a JSON object that describes the result of the operation and lists the inputs as an array of objects. Each object in the array corresponds to one input, and it is expected to have the following properties:</span>

<span class="rvts6">  
</span>

<div class="rvps2" id="bkmrk-id-the-identifier-fo"><table border="1" cellpadding="7" cellspacing="-1"><tbody><tr valign="top"><td valign="top" width="76"><span class="rvts6">id</span>

</td><td valign="top" width="548"><span class="rvts6">The identifier for the input within the program</span>

</td></tr><tr valign="top"><td valign="top" width="76"><span class="rvts6">label</span>

</td><td valign="top" width="548"><span class="rvts6">Readable text that will be shown as a label for the input in the UI</span>

</td></tr><tr valign="top"><td valign="top" width="76"><span class="rvts6">type</span>

</td><td valign="top" width="548"><span class="rvts6">A numeric value that specifies the type of input:</span>

<span class="rvts6">0 – Numeric</span>

<span class="rvts6">1 – Date</span>

<span class="rvts6">2 – String</span>

<span class="rvts6">3 – Entity</span>

<span class="rvts6">4 – Attribute Set</span>

<span class="rvts6">5 – Query Expression</span>

<span class="rvts6">6 – Boolean (Checkbox)</span>

<span class="rvts6">7 – Color Legend</span>

<span class="rvts6">8 – Drill-hole Settings</span>

</td></tr><tr valign="top"><td valign="top" width="76"><span class="rvts6">filter</span>

</td><td valign="top" width="548"><span class="rvts6">Must be non-zero for type 3 (Entity), contains a numeric value containing a binary mask identifying which types of entities can be potentially selected. Use binary OR to merge different types into a single mask. The values identifying each identity type are (in hexadecimal):</span>

<span class="rvts6">0x01 – Voxel Terrain</span>

<span class="rvts6">0x02 – Voxel Block Model</span>

<span class="rvts6">0x04 – Voxel Generator</span>

<span class="rvts6">0x08 – Realtime Voxel Terrain</span>

<span class="rvts6">0x10 – Indexed Point Cloud</span>

</td></tr></tbody></table>

</div>##### <span class="rvts16">Example (PowerShell)</span>

<span class="rvts6">Python program to be validated:</span>

```python
import voxelfarm
print(voxelfarm.version)
```

<span class="rvts6"> </span><span class="rvts6">This POST call validates the program:</span>

<table border="1" id="bkmrk-invoke-webrequest--u" style="border-collapse: collapse; width: 100%;"><colgroup><col style="width: 99.881%;"></col></colgroup><tbody><tr><td><span class="rvts25">Invoke-WebRequest -Uri "http://localhost:58697/entity.ashx?program=validate" -Method "POST" -Headers @{"Origin"="http://localhost:58697"; "Accept-Encoding"="gzip, deflate, br"; "Accept-Language"="en-US,en;q=0.9,es;q=0.8"; "User-Agent"="Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36"; "Accept"="\*/\*"; "Referer"="http://localhost:58697/cloud/project.html?id=myproject"} -ContentType "application/json; charset=UTF-8" -Body "aW1wb3J0IHZveGVsZmFybQpwcmludCh2b3hlbGZhcm0udmVyc2lvbik="</span></td></tr></tbody></table>