Opensolar supports the functionality to create new projects and fetch data directly using custom URL. This can be used to import project data quickly from CRM or Excel toolkits directly into OpenSolar.
Note: While creating a basic import URL can be simple to understand, more complex importing can be challenging and would require an experienced developer to build automation. The end of this articles shows a Javascript example on how a user can build an automation to quickly create custom URLs. You can create automated URLs that fetch relevant data from each project in your CRM/Excel Tool and import them directly to OpenSolar.
The steps below explains step by step how custom URL work. Please ensure that you are logged in to OpenSolar.
- Here's the link to create a new project on OpenSolar: https://app.opensolar.com/#/projects/create
- To add an import field in the custom URL, start by suffixing a "?" at the end of the create URL above:
https://app.opensolar.com/#/projects/create?
- Now you can add your first field to the URL. Let's try by adding "123" to the search field.
- The field name is called "addressSearch" (see the list of fields supported).
- To add a value, simply include an "=" sign after the field name and enter the value you want it to include.
- In most cases, the value entered will include a space which URLs do not support. To do that, you need to replace blank space with "%20". Let's try adding "123 Main St" to the search field. Here's how the URL will look like:
https://app.opensolar.com/#/projects/create?addressSearch=123%20Main%20St - We can import as many fields as we want. Let's try importing Customer First Name through the custom URL. Here we will fetch Gagan Singh as the customer first name.
- The field name for Customer First Name is "contacts_new.0.first_name".
- To add a value after the first field name has been added to the URL, suffix "&" at the end of the URL.
- Then follow the same pattern of entering a value to the field name as mentioned in point 3 and 4.
https://app.opensolar.com/#/projects/create?addressSearch=123%20Main%20St&contacts_new.0.first_name=Gagan%20Singh
- You can follow the step 5 again to keep on adding all the fields you want to import.
The list of all the fields you can import using custom URL:
Field Name | Input Type | Syntax/Options |
addressSearch | String | |
address | String | |
zip | String | valid Zip |
locality | String | |
state | String | |
county | String | |
lat | float | valid latitude |
lon | float | valid latitude |
business_name | string | |
business_identifier | string | |
is_residential | Boolean | 1 = yes, 0 = no |
contacts_new.0.first_name | string | |
contacts_new.0.family_name | string | |
contacts_new.0.email | string | valid email |
contacts_new.0.phone | integer | valid phone number |
priority | Boolean | 3 = high, 2 = medium, 1 = low |
tags | API URL | https://api.opensolar.com/api/orgs/<orgID>/tags/<tagID>/ |
assigned_role | API URL | https://api.opensolar.com/api/orgs/<orgID>/roles/<roleID>/ |
notes | string | |
add_more_details | Boolean | 1 = yes, 0 = no |
usage_data_source | string: match options | Enter Annual kWh |
kwh_annual | float | |
curve_weekday | string: match options | Flat, Mostly Day, Mostly Night, Evening Peak, Double Peak, Business Hours 9am-5pm, Extended Business Hours 7am-6pm |
curve_weekend | string: match options | Flat, Mostly Day, Mostly Night, Evening Peak, Double Peak, Business Hours 9am-5pm, Extended Business Hours 7am-6pm |
scale_weekend | Float | |
utilityTariffSupplied | Boolean | 1 = yes, 0 = no |
utility_tariff_current | API URL | https://api.opensolar.com/api/orgs/<orgID>/transition_to_utility_tariffs/<tariffID>/ |
utility_tariff_proposed | API URL | https://api.opensolar.com/api/orgs/<orgID>/transition_to_utility_tariffs/<tariffID>/ |
You will need to replace <orgID>, <tagID>, <roleID> and <tariffID> with the relevant IDs.
There are many ways of getting these IDs from your OpenSolar account. Here I have explained the most basic way of finding the relevant IDs.
Note: This will only work when using OpenSolar on a web browser.
<orgID> = Go to Control > Business Details and check the web URL. OrgID is the number at the end of the URL.
Example: in https://app.opensolar.com/#/content/3 the org ID is 3
<tagID> = Go to Control > Project Tags and check the web URL. tafID is the number at the end of the URL.
Example: inhttps://app.opensolar.com/#/tags/29 the org ID is 29
<roleID> = Go to Control > Team and select the team member (click Edit button) whose ID you want to see. RoleID is the number at the end of the web URL.
Example: in https://app.opensolar.com/#/roles/868 the role ID is 868.
<tariffID> = Go to Control > Utility tariff and select the tariff(click Edit button) that you want to use. Similar to before, the tariffID is the number at the end of the web URL.
Example: in https://app.opensolar.com/#/utility_tariffs/102190 the tariff ID is 102190.
Let's look at a complete API URL for assigned_role and utility_tariff_current. Based on the above example:
assigned_role = https://api.opensolar.com/api/orgs/3/roles/868/ where 3 is the orgID and 868 is the roleID.
utility_tariff_current = https://api.opensolar.com/api/orgs/3/transition_to_utility_tariffs/102190/
Important Note: If the tariff is not created or imported on to your personal OpenSolar account (i.e, you are not allowed to edit and save the tariff), the orgID should be 1 and not your OpenSolar account orgID. If that is the case, the utility_tariff_current will become https://api.opensolar.com/api/orgs/1/transition_to_utility_tariffs/102190/
You can use the above fields to build automation in CRM or Excel tools that you already use. This will help generate quick create project links directly from you previous tools and import relevant data of each project into OpenSolar.
Note: If your previous tool doesn't record the latitude and longitude of the project, the solar pro will need to select the address from the address search dropdown. This will ensure that the project has a valid latitude longitude for satellite imagery in Studio designing.
For developers, below is a Javascript example to quickly build a custom URL for importing:
var data = [
'addressSearch=123 Main St',
'address=123 Main St',
'zip=2021',
'locality=Randwick',
'state=NSW',
'county=Kuringai',
'lat=-39',
'lon=122',
'business_name=My Co',
'business_identifier=123 123 123',
'is_residential=1',
'contacts_new.0.first_name=Gagan Singh',
'contacts_new.0.family_name=Khosla',
'contacts_new.0.email=testemail123@opensolar.com',
'contacts_new.0.phone=94811111',
'priority=3',
'tags=https://api.opensolar.com/api/orgs/3/tags/29/',
'assigned_role=https://api.opensolar.com/api/orgs/3/roles/868/',
'notes=Great customer, very keen to go solar.',
'add_more_details=1',
'usage_data_source=Enter Annual kWh',
'kwh_annual=12000',
'curve_weekday=Flat',
'curve_weekend=Mostly Night',
'scale_weekend=1.1',
'utilityTariffSupplied=1',
'utility_tariff_proposed=https://api.opensolar.com/api/orgs/1/transition_to_utility_tariffs/12760/',,
]
var url = 'https://app.opensolar.com/#/projects/create?' + data.map(v => encodeURI(v)).join('&')
window.open(url,'_blank')
Note: In the above example, the auto generated URL will include references to IDs that are not associated with your account. This will give an error. Please ensure that the IDs are relevant to your account.
For more information about creating custom URLs please create a ticket here or reach us on support@opensolar.com
Comments
0 comments
Article is closed for comments.