Api documentation

Api documentation

Submit comments for 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/comments?api_key={api key}

Request Body

  1. {
  2. "parentId": 111111111,
  3. "text": "testText",
  4. "authorName": "testName",
  5. "email": "test@email.com",
  6. "dealerComment": false,
  7. "created": 11111111111,
  8. "ipAddress": "111.11.11.11"
  9. }

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. "parentId": 111111111,
  16. "text": "testText",
  17. "authorName": "testName",
  18. "email": "test@email.com",
  19. "dealerComment": false,
  20. "created": 11111111111,
  21. "ipAddress": "111.11.11.11"
  22. };
  23. // Callback function to be called when the API response is returned
  24. function success(res) {
  25. var body = document.getElementById('results-body');
  26. body.innerHTML = "This dealer's name is : " + res.dealerName;
  27. }
  28. // Oops, Houston we have a problem!
  29. function fail(data) {
  30. console.log(data);
  31. }
  32. // Fire the API call
  33. res.api('/api/dealerreviews/v2/comments', options, success, fail);
  34. // Additional initialization code such as adding Event Listeners goes here
  35. };
  36. // Load the SDK asynchronously
  37. (function(d, s, id){
  38. var js, sdkjs = d.getElementsByTagName(s)[0];
  39. if (d.getElementById(id)) {return;}
  40. js = d.createElement(s); js.id = id;
  41. js.src = "path/to/sdk/file";
  42. sdkjs.parentNode.insertBefore(js, sdkjs);
  43. }(document, 'script', 'edmunds-jssdk'));
  44. </script>
  45. </body>
  46. </html>