Title: REST API looking for complete sample javascript example
Last modified: July 11, 2017

---

# REST API looking for complete sample javascript example

 *  [CCC](https://wordpress.org/support/users/chanecullens/)
 * (@chanecullens)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/rest-api-looking-for-complete-sample-javascript-example/)
 * Hi I’m attempting to create a single page application that deals with uploading
   photos. Outside of WordPress I’ve not having a problem. However I want the single
   page application to run inside WordPress and end up with the photo (image file)
   within wp-content. Thus, I’m looking for an end to end use case example of using
   WordPress REST API for a single page application written in JavaScript.
    Coding
   style
    - ES6 – modern JavaScript is good
    - No JavaScript frameworks, use Backbone if that is the only way
    - Assume modern browser, e.g. latest Google Chrome
 * Flow
    - User has logged into WorkPress normally, that is using site GUI, thus there
      should be a cookie or something to use for security
    - User clicks on a URL that goes to a page on the same site, which is the single
      page application. Thus, there is probably an html page somewhere
    - This is what I’m looking for >> This page does a very basic REST API call,
      for example, lists the last 5 posts. This can be so simple, that only Javascript
      console.log() is used to print something
 * Thats all. You’re thinking all of these parts are documented elsewhere. While
   the parts might be, I’ve yet to find an example that is end to end complete.
   
   Thanks for helping CCC
    -  This topic was modified 8 years, 9 months ago by [CCC](https://wordpress.org/support/users/chanecullens/).

The topic ‘REST API looking for complete sample javascript example’ is closed to
new replies.

 * In: [Developing with WordPress](https://wordpress.org/support/forum/wp-advanced/)
 * 0 replies
 * 1 participant
 * Last reply from: [CCC](https://wordpress.org/support/users/chanecullens/)
 * Last activity: [8 years, 9 months ago](https://wordpress.org/support/topic/rest-api-looking-for-complete-sample-javascript-example/)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
