Api documentation

Api documentation

Submit dealer review

Ratings and Reviews
 
 
v2 v1
 
 

Description

The Edmunds review submission and verification process does not require a user to create an account or password. We validate legitimacy via a verification email sent to the reviewer. A review may not be published until it is confirmed via this email.

URL

  1. POST http://api.edmunds.com/api/dealerreviews/v2?api_key={api key}

Request Body

  1. {
  2. "dealerId": 838870,
  3. "stateCode": "AK",
  4. "publishingSource": "EDMUNDS_REST_API",
  5. "title": "test",
  6. "text": "test",
  7. "authorName": "John",
  8. "email": "John@edmunds.com",
  9. "overallRating": "5",
  10. "reviewType": "sales",
  11. "dealerRecommended": true,
  12. "carBought": true,
  13. "ipAddress": "111.11.11.11"
  14. }

Code Example

You need the Javascript SDK to run this example.

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset=utf-8>
  5. <title>Edmunds API Example</title>
  6. </head>
  7. <body>
  8. <div id="results-body"></div>
  9. <script>
  10. window.sdkAsyncInit = function() {
  11. // Instantiate the SDK
  12. var res = new EDMUNDSAPI('YOUR API KEY');
  13. // Optional parameters
  14. var options = {
  15. "dealerId": 838870,
  16. "stateCode": "AK",
  17. "publishingSource": "EDMUNDS_REST_API",
  18. "title": "test",
  19. "text": "test",
  20. "authorName": "John",
  21. "email": "John@edmunds.com",
  22. "overallRating": "5",
  23. "reviewType": "sales",
  24. "dealerRecommended": true,
  25. "carBought": true,
  26. "ipAddress": "111.11.11.11"
  27. };
  28. // Callback function to be called when the API response is returned
  29. function success(res) {
  30. var body = document.getElementById('results-body');
  31. body.innerHTML = "This dealer's name is : " + res.dealerName;
  32. }
  33. // Oops, Houston we have a problem!
  34. function fail(data) {
  35. console.log(data);
  36. }
  37. // Fire the API call
  38. res.api('/api/dealerreviews/v2', options, success, fail);
  39. // Additional initialization code such as adding Event Listeners goes here
  40. };
  41. // Load the SDK asynchronously
  42. (function(d, s, id){
  43. var js, sdkjs = d.getElementsByTagName(s)[0];
  44. if (d.getElementById(id)) {return;}
  45. js = d.createElement(s); js.id = id;
  46. js.src = "path/to/sdk/file";
  47. sdkjs.parentNode.insertBefore(js, sdkjs);
  48. }(document, 'script', 'edmunds-jssdk'));
  49. </script>
  50. </body>
  51. </html>