In this blog, I'll show you how to get the created date of SharePoint list using the REST API.
REST API Endpoint:
  1. https://sharepointsiteurl/_api/web/getByTitle('ListName')?$select=created
Add-In Code snippet:

The following code snippet can be used in creating SharePoint Add-Ins,
  1. // Load the cross-domain library JS file
  2. $.getScript(scriptbase + "SP.RequestExecutor.js", execCrossDomainRequest);
  3. });
  4. function execCrossDomainRequest() {
  5. var executor;
  6. // Initialize the RequestExecutor with the app web URL.
  7. executor = new SP.RequestExecutor(appweburl);
  8. // To get the title using REST we can hit the endpoint:
  9. // app_web_url/_api/SP.AppContextSite(@target)/web/lists/getByTitle('ListName')?$select=Created&@target='siteUrl'
  10. // The response formats the data in the JSON format.
  11. executor.executeAsync({
  12. url: appweburl + "/_api/SP.AppContextSite(@target)/web/lists/getByTitle('TestList')?$select=Created&@target='" + hostweburl + "'",
  13. method: "GET",
  14. headers: {
  15. "Accept": "application/json; odata=verbose"
  16. },
  17. success: successHandler,
  18. error: errorHandler
  19. });
  20. }
  21. // Function to handle the success event.
  22. // Prints the host web's title to the page.
  23. function successHandler(data) {
  24. var jsonObject = JSON.parse(data.body);
  25. console.log('List Created Date: ' + jsonObject.d.Created);
  26. }
  27. function errorHandler(data, errorCode, errorMessage) {
  28. console.log("Could not complete cross-domain call: " + errorMessage;
  29. }
Embed Code Snippet:

The following code snippet can be embedded in SharePoint page or Content editor webpart to get the output using REST API,
  1. <script type="text/javascript" src="/SiteAssets/Scripts/jquery-1.9.1.min.js"></script>
  2. <script type="text/javascript">
  3. $.ajax({
  4. url: _spPageContextInfo.webAbsoluteUrl+"/_api/web/lists/getByTitle('TestList')?$select=created", //THE ENDPOINT
  5. method: "GET",
  6. headers: { "Accept": "application/json; odata=verbose" },
  7. success: function (data) {
  8. console.log(data.d.Created) //RESULTS HERE!!
  9. }
  10. });
  11. </script>