Your first call - create a project
/projects/create
This
Youguide canwalks createyou through creating a new Easy PV project using theour Open API.
Authentication
Endpoint:
POST https://[DOMAIN]/api/v1/projects/create
Headers:
Constructing
accept: application/json
X-API-KEY: YOUR_API_KEY
(Replace YOUR_API_KEY
with your actual API request
key.)
accept: application/json
X-API-KEY: YOUR_API_KEY
(Replace YOUR_API_KEY
with your actual API Content-Type: application/json
Request structure
AllEvery projectsproject request must haveinclude anthe following:
Owner field:
The owner
, which must be specified in the request POST. The owner email mustshould be a membervalid email address of thean proEasy PV Pro team thatmember. ownsThis email will become the API key. The owner can then subsequently share theprimary project withowner. other members of the team if they wish.
AdditionalMeta informationobject: needs
Use the meta
object. This can include: projectName customerName customerEmail customerPhone address postcode crmReference projectType
crmReference can be used for your internal reference - it's likely that you will have a unique database ID that you want to be associated with the project. All fields are optional.
projectType can be usedobject to set additional project settings and information.
- Mandatory fields:
projectType
Sets the design mode for theprojectproject.(Allowed values:"three-d-
modelmodel","quick-
roofroof","roof-
outlineoutline").
For3D
projectsyou - Enable automatic roof scanning
functionalityforby3Dincludingprojects:- To enable roof scanning you must include the following attribute in the meta object.
"magicMode" :
"true"true.
Youcan
runthis - To enable roof scanning you must include the following attribute in the meta object.
- Optional fields:
-
customerName
customerEmail
customerPhone
address
postcode
lat
andlng
- provide thecommand line or using a tool like postman to try it out. Change the owner email to a user within the Easy PV team (probably your own if you want to be able to check it has been successful),latitude andput your keylongitude in theX-API-KEYdecimalheader.degrees formatcrmReference
- include an ID or reference to the customer record or project in your CRM
-
Example API Request
Below is an example using curl
that demonstrates how to create a project with the required fields:
curl -X 'POST'POST 'https://sandbox.easy-pv.co.uk/api/v1/projects/create' \
-H 'accept: application/json' \
-H 'X-API-KEY: **********KEY***********'YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
"owner": "sales@midsummerenergy.co.uk"sales@example.com",
"meta": {
"projectType": "three-d-model",
"magicMode": "true",
"customerName": "Joe Bloggs",
"address": "123 Sample Street",
"postcode": "AB12 3CD"
}
}'
Response
TheA endpointsuccessful willcall returnreturns a JSON object withcontaining a projectId
property.which Youyou willshould almoststore certainly want to save this projectId withinin your own database.
for future reference. You can also use the ID to construct a link directly to athe project with a link ofusing the following format:link structure:
https://easy-pv.co.uk/?project=
872019[YOUR PROJECT ID HERE]
Congratulations! You've used our API to create a project within Easy PV. Read on to see how you can retrieve files and form data from an Easy PV project.