Appearance
Project Examples
To see full the full API spec see the reference.
Get the Most Recent Project that is Active or on Hold
Make the following request to get the newest project that is active or on hold:
bash
curl -X GET "https://api.vectorse.com/projects?status=active&status=hold&page=1&pageSize=1" \
-H "Authorization:Bearer {YOUR_API_KEY}"
By default the results are sorted by newest to oldest projects.
Here's what an example response looks like:
json
{
"page": 1,
"pageSize": 1,
"total": 100,
"items": [
{
"number": "U0001.0215.241",
"name": "Residential Solar Example",
"status": "active",
"createDate": "2024-02-20T22:56:53.070Z",
"estimatedCompletionDate": null,
"completionDate": null,
"type": "31",
"typeName": "Solar - Residential",
"disciplines": ["ST"],
"jobId": "custom-unique-identifier-423951",
"ahj": "Salt Lake County",
"instructions": null,
"address1": "651 W Galena Park Cir",
"address2": "101",
"address3": null,
"city": "Draper",
"state": "UT",
"zip": "84020",
"county": "Salt Lake County",
"country": "US",
"latitude": 0,
"longitude": 0
}
]
}
Creating a Project and Uploading Files
First, create the project:
bash
curl -X POST https://api.vectorse.com/projects \
-H "Content-Type:application/json" \
-H "Authorization:Bearer {YOUR_API_KEY}" \
-d '{
"name": "Residential Solar Example",
"jobId": "custom-unique-identifier-423951",
"scope": ["ST"],
"type": "31",
"instructions": "",
"address1": "651 W Galena Park Cir",
"address2": "Suite 101",
"city": "Draper",
"state": "UT",
"country": "US",
"ahj": "Salt Lake County"
}'
If the request is successful, the project number is returned:
json
{ "number": "U0001.0202.241" }
Now that the project has been successfully created, the files can be uploaded.
This is done by sending a second PUT
request to /projects/U0001.0202.241/upload
. This API route, unlike most of the others, uses multipart/form
data so multiple files can be uploaded as binary data instead of text.
INFO
Only one file upload request can be made within the first hour after the project is created.
For this example, we will assume that you are trying to upload image.png
and plans.pdf
that are located in your current working directory.
bash
curl -X PUT https://api.vectorse.com/projects/U0001.0202.241/upload \
-H "Authorization: Bearer {YOUR_API_KEY}" \
-F "files=@image.png" \
-F "files=@plans.pdf"
This request uploads the files as an array stored in the files
input. That's why files
is being assigned twice in the command.
For the file upload to work, the file name needs to be specified. curl
automatically adds the filename and type data to the request, but if you want to manually specify it, it can be done like this:
bash
curl -X PUT https://api.vectorse.com/projects/U0001.0202.241/upload \
-H "Authorization: Bearer {YOUR_API_KEY}" \
-F "files=@image.png;filename=house.png;type=image/png" \
-F "files=@plans.pdf;filename=house-plans.pdf;type=application/pdf"
Download Project Files
When you make a request to download project files, the server compresses all the files into a zip folder and redirects you to a download link.
To download the zip file you must follow the redirect.
The following command uses the -L
option to follow redirects and --output
to specify where to download the file.
bash
curl -X GET https://api.vectorse.com/projects/U0001.0202.241/download \
-L --output files.zip
Here are the possible responses:
code | description |
---|---|
204 | The project specified does not have any files available to download |
302 | Redirect to the download link |
403 | The project has files ready to download you do not have access to download them. You probably need to make a payment for this project to access the files |
404 | The project specified cannot be found |