Solar Ratings

Share rating data about solar providers, products, comments, questions and answers.

Create Rating by URI

HTTP POST http://api.opensolar.org/V1/rating

The content item that is being rated can be identified by URI:

Example JSON passed in via POST

{
    "rating":
    {
	"item":"http:\/\/api.opensolar.org\/V1\/product\/1234",
	"value":3.5
    }
}

Create Rating by GUID

HTTP POST http://api.opensolar.org/V1/rating/239874124

{
    "rating":
    {
	"value":3.5
    }
}

Response

If the request is successful, the API will return the HTTP 201 (Created) status code containing a Location header pointing to the URI of this newly created resource.

Example

Location: http://api.opensolar.org/V1/user/william/rating/124214

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.


Update an Existing Provider

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.

Example

Posting the following piece of JSON to http://api.opensolar.org/V1/provider/1234 would overwrite these five fields for provider 1234.

{
    "provider":
    {
	"website":"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"
    }
}