Share data about solar providers.
HTTP POST http://api.opensolar.org/V1/provider
{
"provider":
{
"name":"OpenSolar"
"summary":"OpenSolar connects solar providers, products and people."
"ownerEmail":"william@opensolar.org",
"webpage":"http:\/\/www.opensolar.org",
"logo":"http:\/\/www.opensolar.org\/images\/logo.png",
"about":"OpenSolar stores data about solar installations, products and the providers who installed them.",
"type":"private",
"size":"small",
"offices":
[
{
"postalAddress":"500 West 45th Street, New York, NY 10036",
"geoPt":
{
"lat":40.75,
"lon":-74.0
},
"telephone":"(212) 555-1212",
"fax":"(212) 555-1212",
"serviceArea":"25"
},
{
"postalAddress":"22 Plymouth Street, Boston, MA",
"geoPt":
{
"lat":41.51,
"lon":-72.32
},
"telephone":"(212) 555-1212",
"serviceArea":"25"
}
]
}
}
The following fields are required at a minimum for this request to be successful:
{
"provider":
{
"name":"OpenSolar",
"owner":"http:\/\/api.opensolar.org\/V1\/user\/william",
"ownerEmail":"william@opensolar.org"
}
}
If the request is successful, the API will return the HTTP 201 (Created) status code with a simple JSON result object in the body. The "Location" header will point to the newly created resource:
Location: http://api.opensolar.org/V1/provider/1234
{ "result":"success" }
If there has been an error, the service will return the appropriate HTTP status code - most likely a 400 (Bad Request), 401 (Unauthorized) or 403 (Forbidden) error. See the Developer Authorization page for details on how to submit authenticated API requests.
HTTP POST http://api.opensolar.org/V1/provider/1234
Where 1234 is the ID of the provider that you are trying to modify.
The method will overwrite any root element that you pass in.
Posting the following piece of JSON to http://api.opensolar.org/V1/provider/1234 would overwrite these five fields for provider 1234.
{
"provider":
{
"webpage":"http:\/\/www.opensolar.org",
"logo":"http:\/\/www.opensolar.org\/images\/logo.png",
"about":"OpenSolar connects solar businesses, people and products together.",
"type":"private",
"size":"small"
}
}
If the request is successful, the API will return a HTTP 200 (OK) status code.
{ "result":"success" }